With android-ndk-r6 this builds libraries just fine.
The only issue we see with r6 is when it tries to build executables and then we see these errors:
using android-ndk-r6:
arm-linux-androideabi/bin/ld: warning: cannot find entry symbol _start; defaulting to 00008518
So does Android NDK not have crt0.o? Do we need to compile our own crt0.o and link it in for executables?
---------------------------------------------------------------------------------
With android-ndk-r7c we see this error even trying to link libraries:
arm-linux-androideabi/bin/ld: crtbegin_so.o: No such file: No such file or directory
Here the relevant linking setup:
LDFLAGS="-nostdlib
-Wl,-rpath-link=/usr/local/android-ndk/platforms/android-9/arch-arm/usr/lib/,-rpath-link=/home/greno/build/Android/2.3/PROJECT/libs/armeabi/,-dynamic-linker=/system/bin/linker
-L/usr/local/android-ndk/platforms/android-9/arch-arm/usr/lib/
-L/home/greno/build/Android/2.3/PROJECT/libs/armeabi/" LIBS="-lc"
# ls -ld /usr/local/android-ndk/platforms/android-9/arch-arm/usr/lib/crtbegin_so.o
-rwxrwxrwx 1 root root 1068 Aug 3 2011 /usr/local/android-ndk/platforms/android-9/arch-arm/usr/lib/crtbegin_so.o
The android system lib path is both in rpath-link and in -L so why is android-ndk-r7c having a problem finding
crtbegin_so.o?
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To post to this group, send email to andro...@googlegroups.com.
To unsubscribe from this group, send email to android-ndk...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.
configure: error: unrecognized option: `--sysroot=/usr/local/android-ndk/platforms/android-9/arch-arm'
I'll play around with this and see if I can get it to work in our setup.
On 04/18/2012 03:00 PM, David Turner wrote:
> Try using --sysroot=$NDK/platforms/android-9/arch-arm instead
>
> On Wed, Apr 18, 2012 at 8:58 PM, Gerry Reno <gr...@verizon.net <mailto:gr...@verizon.net>> wrote:
>
> We have built an internal setup for building existing C projects w/std Makefiles using NDK.
>
> With android-ndk-r6 this builds libraries just fine.
>
> The only issue we see with r6 is when it tries to build executables and then we see these errors:
> using android-ndk-r6:
>
> arm-linux-androideabi/bin/ld: warning: cannot find entry symbol _start; defaulting to 00008518
>
> So does Android NDK not have crt0.o? Do we need to compile our own crt0.o and link it in for executables?
>
>
> ---------------------------------------------------------------------------------
> With android-ndk-r7c we see this error even trying to link libraries:
>
> arm-linux-androideabi/bin/ld: crtbegin_so.o: No such file: No such file or directory
>
> Here the relevant linking setup:
>
> LDFLAGS="-nostdlib
>
> -Wl,-rpath-link=/usr/local/android-ndk/platforms/android-9/arch-arm/usr/lib/,-rpath-link=/home/greno/build/Android/2.3/PROJECT/libs/armeabi/,-dynamic-linker=/system/bin/linker
> -L/usr/local/android-ndk/platforms/android-9/arch-arm/usr/lib/
> -L/home/greno/build/Android/2.3/PROJECT/libs/armeabi/" LIBS="-lc"
>
> # ls -ld /usr/local/android-ndk/platforms/android-9/arch-arm/usr/lib/crtbegin_so.o
> -rwxrwxrwx 1 root root 1068 Aug 3 2011 /usr/local/android-ndk/platforms/android-9/arch-arm/usr/lib/crtbegin_so.o
>
> The android system lib path is both in rpath-link and in -L so why is android-ndk-r7c having a problem finding
> crtbegin_so.o?
>
>
>
>
> --
> You received this message because you are subscribed to the Google Groups "android-ndk" group.
> To post to this group, send email to andro...@googlegroups.com <mailto:andro...@googlegroups.com>.
> To unsubscribe from this group, send email to android-ndk...@googlegroups.com
> <mailto:android-ndk%2Bunsu...@googlegroups.com>.
./configure CC=arm-linux-androideabi-gcc
PATH=$PATH:/usr/local/android-ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin
--with-sysroot=/usr/local/android-ndk/platforms/android-9/arch-arm
...
configure:3251: checking whether the C compiler works
configure:3273: arm-linux-androideabi-gcc conftest.c >&5
/usr/local/android-ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.4.3/../../../../arm-linux-androideabi/bin/ld:
crtbegin_dynamic.o: No such file: No such file or directory
collect2: ld returned 1 exit status