android compiled on Mac OS issue

  Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
kraka40 Offline
Donor
Posts: 69
Joined: May 2014
Reputation: 3
Post: #1
Hey folks, been trying to troubleshoot builds for Android on MacOS

Failing out with this error while making depends/target/zlib

Quote:/Library/Developer/CommandLineTools/usr/bin/make -C zlib
/Library/Developer/CommandLineTools/usr/bin/make -C arm-linux-androideabi-android-21-debug
/usr/bin/libtool -o libz.a adler32.o crc32.o deflate.o infback.o inffast.o inflate.o inftrees.o trees.o zutil.o compress.o uncompr.o gzclose.o gzlib.o gzread.o gzwrite.o
error: /Library/Developer/CommandLineTools/usr/bin/libtool: file: adler32.o is not an object file (not allowed in a library)
error: /Library/Developer/CommandLineTools/usr/bin/libtool: file: crc32.o is not an object file (not allowed in a library)
error: /Library/Developer/CommandLineTools/usr/bin/libtool: file: deflate.o is not an object file (not allowed in a library)
error: /Library/Developer/CommandLineTools/usr/bin/libtool: file: infback.o is not an object file (not allowed in a library)
error: /Library/Developer/CommandLineTools/usr/bin/libtool: file: inffast.o is not an object file (not allowed in a library)
error: /Library/Developer/CommandLineTools/usr/bin/libtool: file: inflate.o is not an object file (not allowed in a library)
error: /Library/Developer/CommandLineTools/usr/bin/libtool: file: inftrees.o is not an object file (not allowed in a library)
error: /Library/Developer/CommandLineTools/usr/bin/libtool: file: trees.o is not an object file (not allowed in a library)
error: /Library/Developer/CommandLineTools/usr/bin/libtool: file: zutil.o is not an object file (not allowed in a library)
error: /Library/Developer/CommandLineTools/usr/bin/libtool: file: compress.o is not an object file (not allowed in a library)
error: /Library/Developer/CommandLineTools/usr/bin/libtool: file: uncompr.o is not an object file (not allowed in a library)
error: /Library/Developer/CommandLineTools/usr/bin/libtool: file: gzclose.o is not an object file (not allowed in a library)
error: /Library/Developer/CommandLineTools/usr/bin/libtool: file: gzlib.o is not an object file (not allowed in a library)
error: /Library/Developer/CommandLineTools/usr/bin/libtool: file: gzread.o is not an object file (not allowed in a library)
error: /Library/Developer/CommandLineTools/usr/bin/libtool: file: gzwrite.o is not an object file (not allowed in a library)
make[2]: *** [libz.a] Error 1
make[1]: *** [arm-linux-androideabi-android-21-debug/zlib.a] Error 2
make: *** [zlib] Error 2

I noticed the configure file for zlib hardcoded AR to /usr/bin/libtool

Is this a mistake, shouldn't I use the libtool in my toolchain?

Thanks,
find quote
kraka40 Offline
Donor
Posts: 69
Joined: May 2014
Reputation: 3
Post: #2
Some specs if it helps anyone help pinpoint what either I'm doing wrong or where there is an issue in configuration:
- platform MacOS Sierra 10.12.4
- I've compiled with same error with both Android 10e and 12b NDKs
- target platform android-21

configure parameters...
./configure --with-tarballs=/Volumes/android-dev/kodi/kodi-depends/tarballs --host=arm-linux-androideabi --with-sdk-path=/Volumes/android-dev/android/sdk --with-ndk=/Volumes/android-dev/android/android-ndk-r10e --with-toolchain=/Volumes/android-dev/android/android-21 --prefix=/Volumes/android-dev/kodi/kodi-depends

Anyone have any success with this config?
find quote
kraka40 Offline
Donor
Posts: 69
Joined: May 2014
Reputation: 3
Post: #3
had some success ...

in the target/zlib/arm-linux-androideabi-android-21-debug directory

reran the configure command with the appropriate cross compiler variables:

Code:
LD=/Volumes/android-dev/android/android-21.12b/bin/arm-linux-androideabi-ld CC=/Volumes/android-dev/android/android-21.12b/bin/arm-linux-androideabi-gcc AR=/Volumes/android-dev/android/android-21.12b/bin/arm-linux-androideabi-ar LIBTOOL=/Volumes/android-dev/kodi/kodi-depends/x86_64-darwin16.5.0-native/bin/libtool ./configure
and got zlib to compile. Not sure yet how to patch this configuration to pull these variables from the depends directory Makefile.include (yet). Full compile still not working as it is trying to now install libz.a into /usr/local

Any recommendations on how to modify source to pickup right cross-compiler options?
find quote
Memphiz Offline
Kodi MVP
Posts: 16,104
Joined: Feb 2011
Reputation: 227
Location: germany
Post: #4
Zlib compiles on linux while picking up the cross platform flags fine i guess (else the compile would fail on jenkins as well). I have no idea what the current state of compiling droid on osx is. Its a long time ago that i added it to the readme but atm i just don't have the time to verify it again Sad

AppleTV4/iPhone/iPod/iPad: HowTo find debug logs and everything else which the devs like so much: click here
HowTo setup NFS for Kodi: NFS (wiki)
HowTo configure avahi (zeroconf): Avahi_Zeroconf (wiki)
READ THE IOS FAQ!: iOS FAQ (wiki)
find quote
kraka40 Offline
Donor
Posts: 69
Joined: May 2014
Reputation: 3
Post: #5
(2017-04-25 07:52)Memphiz Wrote:  Zlib compiles on linux while picking up the cross platform flags fine i guess (else the compile would fail on jenkins as well). I have no idea what the current state of compiling droid on osx is. Its a long time ago that i added it to the readme but atm i just don't have the time to verify it again Sad

Yep get it .. time is tough to come by .. any pointers and I'll do some digging .. working on restoring my muscle memory for coding/compiling/freeware development.
find quote
Memphiz Offline
Kodi MVP
Posts: 16,104
Joined: Feb 2011
Reputation: 227
Location: germany
Post: #6
Can you try with this branch and report back? I got it to compile successfully with ndk 12b and the current SDK and my changes in that branch (using macos sierra):

https://github.com/Memphiz/xbmc/commits/osx_droid

AppleTV4/iPhone/iPod/iPad: HowTo find debug logs and everything else which the devs like so much: click here
HowTo setup NFS for Kodi: NFS (wiki)
HowTo configure avahi (zeroconf): Avahi_Zeroconf (wiki)
READ THE IOS FAQ!: iOS FAQ (wiki)
find quote
kraka40 Offline
Donor
Posts: 69
Joined: May 2014
Reputation: 3
Post: #7
will try and get back to you...
find quote
kraka40 Offline
Donor
Posts: 69
Joined: May 2014
Reputation: 3
Post: #8
(2017-04-26 19:52)Memphiz Wrote:  Can you try with this branch and report back? I got it to compile successfully with ndk 12b and the current SDK and my changes in that branch (using macos sierra):

https://github.com/Memphiz/xbmc/commits/osx_droid

trying to debug further .. but got odd error during configuration

Code:
configure: error: "/Volumes/android-dev/android/android-ndk-r12b is not an NDK directory"

i'll rebuild ndk but no problem with other ./configure runs
find quote
kraka40 Offline
Donor
Posts: 69
Joined: May 2014
Reputation: 3
Post: #9
compiling now ...

looks like line 5663 of tools/depends/configure needs to change

from
if ! test -f "$use_ndk/RELEASE.TXT" ; then


to
if (! test -f "$use_ndk/source.properties" && ! test -f "$use_ndk/RELEASE.TXT") ; then
(This post was last modified: 2017-04-27 02:42 by kraka40.)
find quote
kraka40 Offline
Donor
Posts: 69
Joined: May 2014
Reputation: 3
Post: #10
ok so got past zlib but still having issues..


Code:
...
/Library/Developer/CommandLineTools/usr/bin/make -C python26-native
cd x86_64-osx-native; /Library/Developer/CommandLineTools/usr/bin/make
running build
running build_ext
sh: dpkg-architecture: command not found

Failed to find the necessary bits to build these modules:
_bsddb             _hashlib           _ssl            
dl                 gdbm               imageop        
linuxaudiodev      ossaudiodev        readline        
spwd               sunaudiodev                        
To find the necessary bits, look in setup.py in detect_modules() for the module's name.

...

Making all in intl
/bin/sh ../libtool  --tag=CC --mode=compile /Volumes/android-dev/android/android-21.12b/bin/arm-linux-androideabi-gcc -c -DLOCALEDIR=\"/Volumes/android-dev/kodi/kodi-depends-osxdroid/arm-linux-androideabi-android-17/share/locale\" -DLOCALE_ALIAS_PATH=\"/Volumes/android-dev/kodi/kodi-depends-osxdroid/arm-linux-androideabi-android-17/share/locale\" -DLIBDIR=\"/Volumes/android-dev/kodi/kodi-depends-osxdroid/arm-linux-androideabi-android-17/lib\" -DBUILDING_LIBINTL -DBUILDING_DLL -DIN_LIBINTL -DENABLE_RELOCATABLE=1 -DIN_LIBRARY -DINSTALLDIR=\"/Volumes/android-dev/kodi/kodi-depends-osxdroid/arm-linux-androideabi-android-17/lib\" -DNO_XMALLOC -Dset_relocation_prefix=libintl_set_relocation_prefix -Drelocate=libintl_relocate -DDEPENDS_ON_LIBICONV=1 -DHAVE_CONFIG_H -I. -I. -I.. -DANDROID -Os -fexceptions -march=armv7-a -mtune=cortex-a9 -mfloat-abi=softfp -mfpu=neon  -I/Volumes/android-dev/kodi/kodi-depends-osxdroid/arm-linux-androideabi-android-17/include/android-17 -isystem /Volumes/android-dev/kodi/kodi-depends-osxdroid/arm-linux-androideabi-android-17/include  -I/Volumes/android-dev/kodi/kodi-depends-osxdroid/arm-linux-androideabi-android-17/include -DANDROID -Os -fexceptions -march=armv7-a -mtune=cortex-a9 -mfloat-abi=softfp -mfpu=neon  -I/Volumes/android-dev/kodi/kodi-depends-osxdroid/arm-linux-androideabi-android-17/include/android-17 -isystem /Volumes/android-dev/kodi/kodi-depends-osxdroid/arm-linux-androideabi-android-17/include  -fvisibility=hidden  ./localename.c
libtool: compile:  /Volumes/android-dev/android/android-21.12b/bin/arm-linux-androideabi-gcc -c -DLOCALEDIR=\"/Volumes/android-dev/kodi/kodi-depends-osxdroid/arm-linux-androideabi-android-17/share/locale\" -DLOCALE_ALIAS_PATH=\"/Volumes/android-dev/kodi/kodi-depends-osxdroid/arm-linux-androideabi-android-17/share/locale\" -DLIBDIR=\"/Volumes/android-dev/kodi/kodi-depends-osxdroid/arm-linux-androideabi-android-17/lib\" -DBUILDING_LIBINTL -DBUILDING_DLL -DIN_LIBINTL -DENABLE_RELOCATABLE=1 -DIN_LIBRARY -DINSTALLDIR=\"/Volumes/android-dev/kodi/kodi-depends-osxdroid/arm-linux-androideabi-android-17/lib\" -DNO_XMALLOC -Dset_relocation_prefix=libintl_set_relocation_prefix -Drelocate=libintl_relocate -DDEPENDS_ON_LIBICONV=1 -DHAVE_CONFIG_H -I. -I. -I.. -DANDROID -Os -fexceptions -march=armv7-a -mtune=cortex-a9 -mfloat-abi=softfp -mfpu=neon -I/Volumes/android-dev/kodi/kodi-depends-osxdroid/arm-linux-androideabi-android-17/include/android-17 -isystem /Volumes/android-dev/kodi/kodi-depends-osxdroid/arm-linux-androideabi-android-17/include -I/Volumes/android-dev/kodi/kodi-depends-osxdroid/arm-linux-androideabi-android-17/include -DANDROID -Os -fexceptions -march=armv7-a -mtune=cortex-a9 -mfloat-abi=softfp -mfpu=neon -I/Volumes/android-dev/kodi/kodi-depends-osxdroid/arm-linux-androideabi-android-17/include/android-17 -isystem /Volumes/android-dev/kodi/kodi-depends-osxdroid/arm-linux-androideabi-android-17/include -fvisibility=hidden ./localename.c -o localename.o
./localename.c:41:23: fatal error: langinfo.h: No such file or directory
# include <langinfo.h>
                       ^
compilation terminated.
make[5]: *** [localename.lo] Error 1
make[4]: *** [all-recursive] Error 1
make[3]: *** [all] Error 2
make[2]: *** [arm-linux-androideabi-android-17/gettext-runtime/intl/.libs/libintl.a] Error 2
make[1]: *** [gettext] Error 2
make: *** [target/.installed-arm-linux-androideabi-android-17] Error 2

still researching
find quote
kraka40 Offline
Donor
Posts: 69
Joined: May 2014
Reputation: 3
Post: #11
reran configure adding
Code:
--with-sdk=android-21
as it looks like the sdk was defaulting to android-17

resulted in a better compile run, but failed in libintl.a .. before getting to zlib

Code:
libtool: compile:  /Volumes/android-dev/android/android-21.12b/bin/arm-linux-androideabi-gcc -c -DLOCALEDIR=\"/Volumes/android-dev/kodi/kodi-depends-osxdroid/arm-linux-androideabi-android-21/share/locale\" -DLOCALE_ALIAS_PATH=\"/Volumes/android-dev/kodi/kodi-depends-osxdroid/arm-linux-androideabi-android-21/share/locale\" -DLIBDIR=\"/Volumes/android-dev/kodi/kodi-depends-osxdroid/arm-linux-androideabi-android-21/lib\" -DBUILDING_LIBINTL -DBUILDING_DLL -DIN_LIBINTL -DENABLE_RELOCATABLE=1 -DIN_LIBRARY -DINSTALLDIR=\"/Volumes/android-dev/kodi/kodi-depends-osxdroid/arm-linux-androideabi-android-21/lib\" -DNO_XMALLOC -Dset_relocation_prefix=libintl_set_relocation_prefix -Drelocate=libintl_relocate -DDEPENDS_ON_LIBICONV=1 -DHAVE_CONFIG_H -I. -I. -I.. -DANDROID -Os -fexceptions -march=armv7-a -mtune=cortex-a9 -mfloat-abi=softfp -mfpu=neon -I/Volumes/android-dev/kodi/kodi-depends-osxdroid/arm-linux-androideabi-android-21/include/android-21 -isystem /Volumes/android-dev/kodi/kodi-depends-osxdroid/arm-linux-androideabi-android-21/include -I/Volumes/android-dev/kodi/kodi-depends-osxdroid/arm-linux-androideabi-android-21/include -DANDROID -Os -fexceptions -march=armv7-a -mtune=cortex-a9 -mfloat-abi=softfp -mfpu=neon -I/Volumes/android-dev/kodi/kodi-depends-osxdroid/arm-linux-androideabi-android-21/include/android-21 -isystem /Volumes/android-dev/kodi/kodi-depends-osxdroid/arm-linux-androideabi-android-21/include -fvisibility=hidden ./localename.c -o localename.o
./localename.c:41:23: fatal error: langinfo.h: No such file or directory
# include <langinfo.h>
                       ^
compilation terminated.
make[5]: *** [localename.lo] Error 1
make[4]: *** [all-recursive] Error 1
make[3]: *** [all] Error 2
make[2]: *** [arm-linux-androideabi-android-21/gettext-runtime/intl/.libs/libintl.a] Error 2
make[1]: *** [gettext] Error 2
make: *** [target/.installed-arm-linux-androideabi-android-21] Error 2
find quote
Memphiz Offline
Kodi MVP
Posts: 16,104
Joined: Feb 2011
Reputation: 227
Location: germany
Post: #12
Start from scratch and doe the make without -j{number of processes} - its most likely a parallel,building issue. I come around this by doing a make until it fails - then make -C tools/depends/target/{failing lib} distclean and run make again in tools/depends until you get through.

There are no further changes needed in my branch. Everything you encounter has to be related to wrongly setup ndk or sdk packages or configure lines.

AppleTV4/iPhone/iPod/iPad: HowTo find debug logs and everything else which the devs like so much: click here
HowTo setup NFS for Kodi: NFS (wiki)
HowTo configure avahi (zeroconf): Avahi_Zeroconf (wiki)
READ THE IOS FAQ!: iOS FAQ (wiki)
(This post was last modified: 2017-04-27 08:13 by Memphiz.)
find quote
kraka40 Offline
Donor
Posts: 69
Joined: May 2014
Reputation: 3
Post: #13
(2017-04-27 08:12)Memphiz Wrote:  Start from scratch and doe the make without -j{number of processes} - its most likely a parallel,building issue. I come around this by doing a make until it fails - then make -C tools/depends/target/{failing lib} distclean and run make again in tools/depends until you get through.

There are no further changes needed in my branch. Everything you encounter has to be related to wrongly setup ndk or sdk packages or configure lines.

ok will redo both builds w/o parallel make and report back.
find quote
kraka40 Offline
Donor
Posts: 69
Joined: May 2014
Reputation: 3
Post: #14
still not working

here's the error
Code:
libtool: compile:  /Volumes/android-dev/android/android-21.12b/bin/arm-linux-androideabi-gcc -c -DLOCALEDIR=\"/Volumes/android-dev/kodi/kodi-depends-osxdroid/arm-linux-androideabi-android-21/share/locale\" -DLOCALE_ALIAS_PATH=\"/Volumes/android-dev/kodi/kodi-depends-osxdroid/arm-linux-androideabi-android-21/share/locale\" -DLIBDIR=\"/Volumes/android-dev/kodi/kodi-depends-osxdroid/arm-linux-androideabi-android-21/lib\" -DBUILDING_LIBINTL -DBUILDING_DLL -DIN_LIBINTL -DENABLE_RELOCATABLE=1 -DIN_LIBRARY -DINSTALLDIR=\"/Volumes/android-dev/kodi/kodi-depends-osxdroid/arm-linux-androideabi-android-21/lib\" -DNO_XMALLOC -Dset_relocation_prefix=libintl_set_relocation_prefix -Drelocate=libintl_relocate -DDEPENDS_ON_LIBICONV=1 -DHAVE_CONFIG_H -I. -I. -I.. -DANDROID -Os -fexceptions -march=armv7-a -mtune=cortex-a9 -mfloat-abi=softfp -mfpu=neon -I/Volumes/android-dev/kodi/kodi-depends-osxdroid/arm-linux-androideabi-android-21/include/android-21 -isystem /Volumes/android-dev/kodi/kodi-depends-osxdroid/arm-linux-androideabi-android-21/include -I/Volumes/android-dev/kodi/kodi-depends-osxdroid/arm-linux-androideabi-android-21/include -DANDROID -Os -fexceptions -march=armv7-a -mtune=cortex-a9 -mfloat-abi=softfp -mfpu=neon -I/Volumes/android-dev/kodi/kodi-depends-osxdroid/arm-linux-androideabi-android-21/include/android-21 -isystem /Volumes/android-dev/kodi/kodi-depends-osxdroid/arm-linux-androideabi-android-21/include -fvisibility=hidden ./localename.c -o localename.o
./localename.c:41:23: fatal error: langinfo.h: No such file or directory
# include <langinfo.h>
                       ^
compilation terminated.
make[5]: *** [localename.lo] Error 1
make[4]: *** [all-recursive] Error 1
make[3]: *** [all] Error 2
make[2]: *** [arm-linux-androideabi-android-21/gettext-runtime/intl/.libs/libintl.a] Error 2
make[1]: *** [gettext] Error 2

here's my configure
Code:
./configure --with-tarballs=/Volumes/android-dev/kodi/kodi-depends-osxdroid/tarballs --host=arm-linux-androideabi --with-sdk-path=/Volumes/android-dev/android/sdk --with-ndk=/Volumes/android-dev/android/android-ndk-r12b --with-toolchain=/Volumes/android-dev/android/android-21.12b --prefix=/Volumes/android-dev/kodi/kodi-depends-osxdroid --with-sdk=android-21

my sdk
Code:
grep "Revision" source.properties
Pkg.Revision=25.2.5

my ndk
Code:
grep "Revision" source.properties
Pkg.Revision = 12.1.2977051
find quote
Memphiz Offline
Kodi MVP
Posts: 16,104
Joined: Feb 2011
Reputation: 227
Location: germany
Post: #15
That --with-toolchain in your configure has to point to the toolchain ( /Volumes/android-dev/kodi/kodi-depends-osxdroid/arm-linux-androideabi-android-21 i think) start over from scratch again (git clean -xfd in kodi src dir will get the tree cleaned 100%)

AppleTV4/iPhone/iPod/iPad: HowTo find debug logs and everything else which the devs like so much: click here
HowTo setup NFS for Kodi: NFS (wiki)
HowTo configure avahi (zeroconf): Avahi_Zeroconf (wiki)
READ THE IOS FAQ!: iOS FAQ (wiki)
(This post was last modified: 2017-04-28 07:48 by Memphiz.)
find quote
Post Reply