How to use toolchain

328 views
Skip to first unread message

linxiaobo

unread,
Mar 5, 2012, 9:36:22 PM3/5/12
to Android-x86
Hi,
I am trying to cross-compile a linux software to Android-x86 platform.
I know that there is a toolchain under android/prebuilt/linux-x86/
toolchain/.arm-eabi-4.4.0,

I am so confused how to use this toolchain. Could you give an
instruction?

Thanks

Lap Ngo Doan

unread,
Mar 5, 2012, 11:39:11 PM3/5/12
to andro...@googlegroups.com
Hi,
Please do not use arm-eabi-4.4.0, it is for ARM architecture
Use x86 for Android-x86
There are several ways to do that
You can use NDK to build your software : http://www.android-x86.org/documents/ndk-how-to
Or you can cross compile directly, here is an example

#!/bin/bash
#[0] Point to NDK directory
export NDK=/media/DATA/Android/NDK/ndk

PREBUILT=$NDK/build/prebuilt/linux-x86/i686-unknown-linux-gnu-4.2.1
PLATFORM=$NDK/build/platforms/android-4/arch-x86
GCC=i686-unknown-linux-gnu-gcc
CROSPREFIX=i686-unknown-linux-gnu
NM=i686-unknown-linux-gnu-nm
ELF=$PREBUILT/i686-unknown-linux-gnu/lib/ldscripts/elf_i386.x
ARCH=x86
CRTBEGIN=$PREBUILT/lib/gcc/i686-unknown-linux-gnu/4.2.1/crtbegin.o
CRTEND=$PREBUILT/lib/gcc/i686-unknown-linux-gnu/4.2.1/crtend.o

#[1] Do config
export configOption=--target-os=linux --arch=$ARCH --cc=$PREBUILT/bin/$GCC --cross-prefix=$PREBUILT/bin/$CROSPREFIX- --nm=$PREBUILT/bin/$NM --extra-cflags="-fPIC -DANDROID"  --extra-ldflags="-Wl,-T,$ELF -Wl,-rpath-link=$PLATFORM/usr/lib -L$PLATFORM/usr/lib -nostdlib $CRTBEGIN $CRTEND -lc -lm -ldl" --prefix=$PLATFORM/usr
./configure $configOption



--
You received this message because you are subscribed to the Google Groups "Android-x86" group.
To post to this group, send email to andro...@googlegroups.com.
To unsubscribe from this group, send email to android-x86...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-x86?hl=en.




--
 
Thanks and Best Regards,

Ngo Doan Lap
Techburg JSC
Email : la...@techburgcorp.com
Mobile: 0977.833.757
"The information in this e-mail (including attachments) is confidential and is only intended for use by the addressee. If you are not the intended recipient or addressee, please notify us immediately. Any unauthorized disclosure, use or dissemination either in whole or in part is prohibited. Opinions, conclusions and other information contained in this message are personal opinions of the sender and do not necessarily represent the views of the Techburg JSC."

Reply all
Reply to author
Forward
0 new messages