Page 2 of 3

Re: Samba build issue for Android

Posted: 13 Sep 2016, 21:06
by davilla
We are right in the middle of a release halt. Once MrMC 2.6.3 for fireOS passes review and is released, I can switch over to 22 and see what the issue really is.

Re: Samba build issue for Android

Posted: 13 Sep 2016, 21:10
by davilla

Re: Samba build issue for Android

Posted: 13 Sep 2016, 21:41
by KeyserSoze
No worries. Releases trump this for sure.

Found this in the makefile......
# configuration settings
# android does not really support LFS but we can force it
# in libsmbclient by defining off_t to off64_t and changing
# libsmbclient.h to match. Defining _OFF_T_DEFINED_ allows
# us to change the typedef of off_t in android's sys/type.h.
# Then xbmc will correctly access smb shares with LFS enabled
# using the altered libsmbclient.h.

If I remove the -D_OFF_T_DEFINED_ -Doff_t=off64_t from CFLAGS I get the proper configure output. However samba will fail to compile.
note: expected 'struct stat64 *' but argument is of type 'struct stat *' which I suspect is related to this. So does me having a newer sdk/ndk the cause of this? I might try to get the older sdk with the 11b NDK and see where that goes.

Edit: Commenting out the Android alteration in the makefile allows it to successfully compile with a lot of warnings that will probably cause me issues later. But interesting none the less.

Re: Samba build issue for Android

Posted: 13 Sep 2016, 21:49
by davilla
KeyserSoze wrote:No worries. Releases trump this for sure.

Found this in the makefile......
# configuration settings
# android does not really support LFS but we can force it
# in libsmbclient by defining off_t to off64_t and changing
# libsmbclient.h to match. Defining _OFF_T_DEFINED_ allows
# us to change the typedef of off_t in android's sys/type.h.
# Then xbmc will correctly access smb shares with LFS enabled
# using the altered libsmbclient.h.

If I remove the -D_OFF_T_DEFINED_ -Doff_t=off64_t from CFLAGS I get the proper configure output. However samba will fail to compile.
note: expected 'struct stat64 *' but argument is of type 'struct stat *' which I suspect is related to this. So does me having a newer sdk/ndk the cause of this? I might try to get the older sdk with the 11b NDK and see where that goes.
ok, that's a big hint :) sec while mr.goldfish remembers

Re: Samba build issue for Android

Posted: 13 Sep 2016, 21:57
by davilla
look in android-21/sysroot/usr/include/sys/types.h

I remember diddling that to get the right off_t defined. This is going to be sdk sensitive. other sdk's might have something different


/* This historical accident means that we had a 32-bit off_t on 32-bit architectures. */
#if !defined(__LP64__)
#ifndef _OFF_T_DEFINED_
#define _OFF_T_DEFINED_
typedef __kernel_off_t off_t;
#endif
typedef __kernel_loff_t loff_t;
typedef loff_t off64_t;
#else
/* We could re-use the LP32 definitions, but that would mean that although off_t and loff_t/off64_t
* would be the same size, they wouldn't actually be the same type, which can lead to warnings. */
typedef __kernel_off_t off_t;
typedef off_t loff_t;
typedef loff_t off64_t;
#endif

Re: Samba build issue for Android

Posted: 13 Sep 2016, 23:24
by KeyserSoze
So modifying types.h definitely did something. Samba built successfully. Didn't check the warnings this time but at least it looks like it's going to work.

Re: Samba build issue for Android

Posted: 14 Sep 2016, 00:18
by KeyserSoze
So I was able to compile everything successfully but packaging the apk failed.

mrmc/arm-linux-androideabi-android-21/lib/mrmc/system’: No such file or directory
Makefile:126: recipe for target 'libs' failed

So why would I be missing the system folder? I'm sure I just forgot to do something but it's not obvious to me at the moment.

Re: Samba build issue for Android

Posted: 14 Sep 2016, 04:06
by KeyserSoze
Commented out that line in the Makefile and I now have a working apk. Not sure if it's going to cause me issues or not.

Re: Samba build issue for Android

Posted: 14 Sep 2016, 05:44
by koying
I did it the hard way, to get done with this off_t nightmare:
https://github.com/koying/SPMC/commit/7 ... 2e5167dd20

PS I was very tempted to hack the NDK, too, but I knew it would bite me later ;)

Re: Samba build issue for Android

Posted: 14 Sep 2016, 13:00
by KeyserSoze
Very nice Koying. I approve and I've had enough issues I need to start over from scratch anyway. I might try to pull that into my fork for the time being.