Cross compilation error using android tool chain

141 views
Skip to first unread message

தங்கமணி அருண்

unread,
May 27, 2010, 5:04:31 PM5/27/10
to android-ndk
Hi,

I am trying to cross compile one of the Linux source package.

Here is my compiler flags and variables
-------------------------------------------------------------------------------------------------------------------------------------
export PATH=$PATH:/home/arun/mydroid/prebuilt/linux-x86/toolchain/arm-
eabi-4.2.1/bin

LD=arm-eabi-ld
AR=arm-eabi-ar
STRIP=arm-eabi-strip
RANLIB=arm-eabi-ranlib
CC=arm-eabi-gcc
CXX=arm-eabi-g++
CPPFLAGS="-I/home/arun/mydroid/bionic/libstdc++/include -I/home/arun/
mydroid/bionic/libc/include -I/home/arun/mydroid/bionic/libc/arch-arm/
include/ -I/home/arun/mydroid/external/jpeg -I/home/arun/mydroid/
bionic/libc/kernel/common -I/home/arun/mydroid/bionic/libc/kernel/arch-
arm -I/home/arun/mydroid/bionic/libm/include -I/home/arun/mydroid/
bionic/libm/include/arch/arm -I/home/arun/mydroid/bionic/libm/arm -I/
home/arun/mydroid/bionic/libm"

CFLAGS="-nostdlib"

LDFLAGS=-Wl,--entry=main,--no-undefined,-rpath-link="-L/home/arun/
mydroid/out/target/product/imx51_BBG/obj/STATIC_LIBRARIES/
libjpeg_intermediates/ -L/home/arun/mydroid/development/ndk/build/
platforms/android-3/arch-arm/usr/lib/ -L/home/arun/mydroid/out/target/
product/imx51_BBG/system/lib"

LIBS="-lc -lgcc -lm -ldl -lstdc++ -L/home/arun/mydroid/out/target/
product/imx51_BBG/obj/STATIC_LIBRARIES/libjpeg_intermediates -ljpeg"
-------------------------------------------------------------------------------------------------------------------------------------
Then i execute "./configure". It went well.

But while doing "make" c and c++ souces are compiled properly.

At the linking stage i got this error

/home/arun/mydroid/prebuilt/linux-x86/toolchain/arm-eabi-4.2.1/bin/../
lib/gcc/arm-eabi/4.2.1/../../../../arm-eabi/bin/ld: crt0.o: No such
file: No such file or directory
collect2: ld returned 1 exit status

Kindly help on this. I tried using different options.I have googled
and tried some solution.but Not proper ending.


Thanks
Arun

--
அன்புடன்
அருண்
------------------------------
http://ubuntu-tam.org
http://lists.ubuntu.com/ubuntu-l10n-tam
http://lists.ubuntu.com/ubuntu-tam
------------------------------

தங்கமணி அருண்

unread,
Jun 1, 2010, 3:25:15 PM6/1/10
to android-ndk

Any suggestion on this issue,


Kindly help on this. I tried using different options.I have googled
and tried some solution.but Not proper ending.


--
அன்புடன்
அருண்
------------------------------
http://ubuntu-tam.org
http://lists.ubuntu.com/ubuntu-l10n-tam
http://lists.ubuntu.com/ubuntu-tam
------------------------------

--
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.

Angus Lees

unread,
Jun 2, 2010, 2:53:03 AM6/2/10
to andro...@googlegroups.com
The NDK prebuilt compiler is unnecessarily awkward to use directly at
the moment. You need to explicitly build up every part of the link
stage using -nostdlib and referencing the crtbegin_dynamic.o,
crtend_android.o files directly. See build/core/setup-toolchain.mk,
and look at the command lines that the NDK build files generate.

You will have difficulty using the NDK prebuilt toolchain through a
normal ./configure script due to the careful ordering requirements on
the link line. It might be easier using one of the shell toolchain
wrappers (like agcc), or alternative native toolchains (since
generating suitable command lines is really what gcc is meant to do).

 - Gus

Reply all
Reply to author
Forward
0 new messages