Android Tablets Forum banner
1 - 3 of 3 Posts

·
Registered
Joined
·
120 Posts
Hi,

Example steps below worked for me,
This is not a tutorial about android compiling, just way to cross-compile command-line Linux software, and run it on android shell.

for my way of cross-compiling, you must have:

1. Linux PC
2. Toolchain - get it here
3. Source code

Preparing toolchain:
extract content of toolchain in some folder, let say :
/usr/src/dropad/arm-2009q3

inside there are few subdirectories:
arm-none-linux-gnueabi
bin
lib
libexec
share

before compiling, you have to include this path in your system path:

Code:
export PATH=/usr/src/dropad/arm-2009q3/bin/:$PATH
next, you have to set some environment variables:

cross.sh:
Code:
#!/bin/sh -e<br />
export CSTOOLS=/usr/src/dropad/arm-2009q3<br />
export CSTOOLS_INC=${CSTOOLS}/arm-none-linux-gnueabi/libc/usr/include<br />
export CSTOOLS_LIB=${CSTOOLS}/arm-none-linux-gnueabi/libc/usr/lib<br />
export TARGET_ARCH="-march=armv7-a" # must be at least armv5te<br />
export TARGET_TUNE="-mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -mthumb-interwork -mno-thumb" # optional<br />
<br />
export CPP="arm-none-linux-gnueabi-gcc -E"<br />
export STRIP="arm-none-linux-gnueabi-strip"<br />
export OBJCOPY="arm-none-linux-gnueabi-objcopy"<br />
export AR="arm-none-linux-gnueabi-ar"<br />
export F77="arm-none-linux-gnueabi-g77 ${TARGET_ARCH} ${TARGET_TUNE}"<br />
unset LIBC<br />
export RANLIB="arm-none-linux-gnueabi-ranlib"<br />
export LD="arm-none-linux-gnueabi-ld"<br />
export LDFLAGS="-L${CSTOOLS_LIB} -Wl,-rpath-link,${CSTOOLS_LIB} -Wl,-O1 -Wl,--hash-style=gnu"<br />
export MAKE="make"<br />
export CXXFLAGS="-isystem${CSTOOLS_INC} -fexpensive-optimizations -frename-registers -fomit-frame-pointer -O2 -ggdb3 -fpermissive -fvisibility-inlines-hidden"<br />
export LANG="en_US.UTF-8"<br />
export HOME="/home/peru"<br />
export CCLD="arm-none-linux-gnueabi-gcc ${TARGET_ARCH} ${TARGET_TUNE}"<br />
export PATH="${CSTOOLS}/bin:/opt/code-sourcery/arm-2009q1/bin/:${HOME}/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"<br />
export CFLAGS="-isystem${CSTOOLS_INC} -fexpensive-optimizations -frename-registers -fomit-frame-pointer -O2 -ggdb3"<br />
export OBJDUMP="arm-none-linux-gnueabi-objdump"<br />
export CPPFLAGS="-isystem${CSTOOLS_INC}"<br />
export CC="arm-none-linux-gnueabi-gcc ${TARGET_ARCH} ${TARGET_TUNE}"<br />
export TITOOLSDIR="/mnt/data/overo-oe/ti"<br />
export TERM="screen"<br />
export SHELL="/bin/bash"<br />
export CXX="arm-none-linux-gnueabi-g++ ${TARGET_ARCH} ${TARGET_TUNE}"<br />
export NM="arm-none-linux-gnueabi-nm"<br />
export AS="arm-none-linux-gnueabi-as"<br />
export ac_cv_func_malloc_0_nonnull=yes<br />
export ac_cv_func_realloc_0_nonnull=yes<br />
<br />
bash --norc
after this, enter in your source code directory and:
./configure --host-arm
make

if everything is ok, you will get executable, transfer it to your android and execute:)

NOTE: this way of compiling not use existing android libs. You must create manual
/lib in your device, and put what your software needs

in my case, i need these libs
all other libs you can get from your toolchain: /usr/src/dropad/arm-2009q3/arm-none-linux-gnueabi/libc/lib

Hope this will be helpful, and we soon will have a lot of software running on our tablet
 
G

·
Hello! Thanks for your help! I have tried successfully to cross compiling the tool "nanddump" to run on Android with adbbut the result is "#./nanddump: not found".
It will certainly be a problem library (libc.so.6) .. how do I?
thanks
 

·
Registered
Joined
·
120 Posts
Discussion Starter · #3 ·
Hello! Thanks for your help! I have tried successfully to cross compiling the tool "nanddump" to run on Android with adbbut the result is "#./nanddump: not found".
It will certainly be a problem library (libc.so.6) .. how do I?
thanks
Did you create in your android device, this directory:
/lib ?

and did you put lib files inside it? (read NOTE in my first post)
 
1 - 3 of 3 Posts
This is an older thread, you may not receive a response, and could be reviving an old thread. Please consider creating a new thread.
Top