Surge Raval
unread,Feb 10, 2017, 9:05:09 PM2/10/17Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to android-ndk
just do as you would for any toolchain build, but use ndk sysroot as sysroot for headers, define dynamic-linker=/system/bin/linker. I'd suggest to do a bootstrap build and set stage1 LDFLAGS to static. This will require making a few static libraries not found in ndk sysroot. Don't use glibc, build with newlib and add the path to ndk sysroot to LDFLAGS so it uses bionic headers.
probabaly a minimum of these:
LIBS='-lc -ldl -lgcc -lm -lz -lsupc++ -lstdc++ -lgnustl_static'
If you use shared libraries, you'll get a linker error when trying to execute any toolchain binaries since android will look for the libs in the default library path (most likely /system/lib /system/lib64)
And must configure with the -fPIC flag for android.
For just objdump, cross compiling binutils with target and host set to android arch triplet should be OK.
Takes a bit of work, but certainly is possible.
angler:/data/toolchain/bin # file objdump
objdump: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, stripped
angler:/data/toolchain/bin # file gcc
gcc: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, stripped