Need help in cross compiling LTP for android
Hi,
I need to cross compile LTP (tp-full-20120104) for android. I am using android NDK tool chain (android-ndk-r5b-linux-x86) for cross compiling.
I am using the below environmental variables for configuring LTP:
export ARCH=arm:export CROSS_COMPILE=arm-eabi-
export NDK_ROOT=/u/android-ndk-r5b
export PATH=$PATH:$NDK_ROOT/toolchains/arm-eabi-4.4.0/prebuilt/linux-x86/arm-eabi/bin
./configure --host=arm-eabi --target=emulator-5554 --build=x86_64-linux-gnu --prefix=/u/android-ndk-r5b/make_2802_02_2012
export CC=/u/android-ndk-r5b/toolchains/arm-eabi-4.4.0/ prebuilt/linux-x86/bin/arm-eabi-gcc
export LD=/u/android-ndk-r5b/toolchains/arm-eabi-4.4.0/ prebuilt/linux-x86/bin/arm-eabi-ld
export AR=/u/android-ndk-r5b/toolchains/arm-eabi-4.4.0/ prebuilt/linux-x86/bin/arm-eabi-ar
export STRIP=/u/android-ndk-r5b/toolchains/arm-eabi-4.4.0/ prebuilt/linux-x86/bin/arm-eabi-strip
export RANLIB=/u/android-ndk-r5b/toolchains/arm-eabi-4.4.0/ prebuilt/linux-x86/bin/arm-eabi-ranlib
export CXX=/u/android-ndk-r5b/toolchains/arm-eabi-4.4.0/ prebuilt/linux-x86/bin/arm-eabi-c++
export AS=/u/android-ndk-r5b/toolchains/arm-eabi-4.4.0/ prebuilt/linux-x86/bin/arm-eabi-as
export GXX=/u/android-ndk-r5b/toolchains/arm-eabi-4.4.0/ prebuilt/linux-x86/bin/arm-eabi-g++
export
GCC=/u/android-ndk-r5b/toolchains/arm-eabi-4.4.0/
prebuilt/linux-x86/bin/arm-eabi-gcc
export
NM=/u/android-ndk-r5b/toolchains/arm-eabi-4.4.0/
prebuilt/linux-x86/bin/arm-eabi-nm
export CPPFLAGS=”-I/u/android-ndk-r5b/platforms/android-3/ arch-arm/usr/include/”
export CFLAGS=”-nostdlib”
export LDFLAGS=-Wl,–entry=main,–no-undefined,-rpath-link=/u/android-ndk-r5b/ platforms/android-3/arch-arm/usr/lib/-L/u/android-ndk-r5b/platforms/ android-3/arch-arm/usr/lib/
export LIBS=-lc
With the above variables am able to cross compile LTP.
But after pushing the cross compiled make file, cross compiled busybox and cross compiled bash4.1 to target, am not able to execute runltp.
I am getting the below error :
Running tests....... /data/ltp/make_2802_02_2012/bin/ltp-pan: Illegal number:
Please guide me where I am going wrong or what is the solution for this error.
Thanks in advance .
Regards,
Rejish
------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
Hi!
Quoted 8 lines
With the above variables am able to cross compile LTP.
But after pushing the cross compiled make file, cross compiled busybox and cross compiled bash4.1 to target, am not able to execute runltp.
I am getting the below error :
Running tests....... /data/ltp/make_2802_02_2012/bin/ltp-pan: Illegal number:
That is strange error indeed and frankly I have no idea where it came from. There is no 'Illegal number' substring in LTP source code itself, so it's possible this message came either from bash or libc.
What about adding -x into runltp shebang, the trace could help to identify what wen't wrong.
Signature · 12 lines
Cyril Hrubis [email protected] ------------------------------------------------------------------------------ Virtualization & Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/ _______________________________________________ Ltp-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ltp-list
A message that is not in the archive (sent off-list or not yet received): [email protected]
Hi!
Quoted 14 lines
+ LOGFILE_NAME=2012_Mar_02-14h_25m_52s
+ LOGFILE=-l /data/ltp/make_2802_02_2012/results/LTP_RUN_ON-2012_Mar_02-14h_25m_52s.log
+ ALT_DIR_RES=1
+ PRETTY_PRT= -p
+ [ ! ]
+ ALT_DIR_OUT=1
+ [ ! ]
+ [ ! -l /data/ltp/make_2802_02_2012/results/LTP_RUN_ON-2012_Mar_02-14h_25m_52s.log ]
+ basename 2012_Mar_02-14h_25m_52s
+ FAILED_FILE_NAME=2012_Mar_02-14h_25m_52s
+ FAILCMDFILE=-C /data/ltp/make_2802_02_2012/output/LTP_RUN_ON-2012_Mar_02-14h_25m_52s.failed
+ [ 0 -eq 1 ]
+ [ 1 -eq 1 ]
+ [ ! -d /data/ltp/make_2802_02_2012/output ]
Quoted 8 lines
+ [ 1 -eq 1 ]
+ echo INFO: creating /data/ltp/make_2802_02_2012/results directory
INFO: creating /data/ltp/make_2802_02_2012/results directory
+ [ ! -d /data/ltp/make_2802_02_2012/results ]
+ mkdir -m 777 -p /data/ltp/make_2802_02_2012/tmp
mkdir failed for -m, File exists
+ echo FATAL: Unable to make temporary directory /data/ltp/make_2802_02_2012/tmp
FATAL: Unable to make temporary directory /data/ltp/make_2802_02_2012/tmp
Hmm, this is strange, mkdir -p must not fail with 'File exists'.
Quoted 14 lines
+ export TMPTEMPLATE=/data/ltp/make_2802_02_2012/tmp/ltp-XXXXXXXXXX
+ mktemp -d /data/ltp/make_2802_02_2012/tmp/ltp-XXXXXXXXXX
+ TMP=/data/ltp/make_2802_02_2012/tmp/ltp-hYXbVD3460
+ export TMP
+ export TMPDIR=/data/ltp/make_2802_02_2012/tmp/ltp-hYXbVD3460
+ chmod 777 /data/ltp/make_2802_02_2012/tmp/ltp-hYXbVD3460
+ cd /data/ltp/make_2802_02_2012/tmp/ltp-hYXbVD3460
+ [ -n ]
+ [ 0 -eq 1 ]
+ [ -z ]
+ [ -z ]
+ cat
+ + cat /data/ltp/make_2802_02_2012/scenario_groups/default tr \012
...
Quoted 2 lines
+ rm -f /data/ltp/make_2802_02_2012/tmp/ltp-hYXbVD3460/cat_ok.3443 rm failed for -f, No such file or directory
And this is even much more wrong.
I'm not familiar with android but this sugests that you have very crippled busybox or whatever is installed there to provide basic commands like rm, mkdir and so.
Signature · 12 lines
Cyril Hrubis [email protected] ------------------------------------------------------------------------------ Virtualization & Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/ _______________________________________________ Ltp-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ltp-list
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): CAMhs6YzaQ_1gKqCskOX1F8db-nKg=P_Zsy-FgHYnhczDvm9UhQ@mail.gmail.com
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): CAMhs6Yyv_-v_TWKpVxv6tVeyg=jnH_VDZpaOQYnkZxF5C-O2fQ@mail.gmail.com
A message that is not in the archive (sent off-list or not yet received): [email protected]
Not enough context was provided to determine why linking failed.
Quoted 195 lines · Rejish Rajagopala
Hi Maxin,
I could resolve the configuration issue and I could cross compile on of the LTP modules (pty) for Android. Now I am trying to cross compile another module (timers) for Andorid using the tool chain NDK r-7. I am facing the below error:
collect2: ld returned 1 exit status
make[2]: *** [clock_gettime02] Error 1
make[2]: Leaving directory `/u/ltp/ltp-full-20120104/testcases/kernel/timers/clock_gettime' make[1]: *** [all] Error 2
make[1]: Leaving directory `/u/ltp/ltp-full-20120104/testcases/kernel/timers'
make: *** [testcases/kernel/timers-all] Error 2Please let me know why this is coming and what should I do to overcome this issue.
Thanks & Regards,
Rejish
________________________________________
From: Maxin B John [[email protected]]
Sent: Thursday, March 08, 2012 2:27 PM
To: Rejish Rajagopala
Cc: Cyril Hrubis; [email protected]
Subject: Re: [LTP] Need help in cross compiling LTP for androidHi,
Quoted 5 lines · Rejish Rajagopala
Hi Maxin,
Thanks for your reply.
I downloaded busybox and super user apk from android market, But its not working.
It's a bit difficult to believe as you are doubting the integrity of "Android Market" here :)
Quoted 1 line
Even I tried cross compiling busybox with Android tool chain. I used the following script to cross compile it.
IMHO, cross compiling LTP for any platform isn't really a nice topic of discussion in a mailing-list like this.
Your life will be a lot simpler if you try to use the available "busybox" package in Android Market itself.Quoted 30 lines
#!/bin/sh
# Build Busybox against Android's bionic
# Originally by Dan Fandrich
#
# Configure withandroid_defconfig
# This file has been tested on Android Froyo (the lack ofttyname_rin# the must be patched around) and Gingerbread.# Point this to the Android root directory; it's used in the defconfig CFLAGS export A="/u/android-ndk-r5b"
# Android product being built
P=android-3# Toolchain version in use by this version of Android GCCVER=4.4.0
export PATH="$A/toolchains/arm-eabi-4.4.0/prebuilt/linux-x86/bin/arm-eabi-$GCCVER:$PATH"
# Set the linker flags; compiler flags are in the defconfig file
if grep "^CONFIG_STATIC=y" .config >/dev/null ; then
# Static linking
LDFLAGS="-static -Xlinker -z -Xlinker muldefs -nostdlib$A/platforms/$P/arch-arm/usr/lib/crtbegin_static.o$A/platforms/$P/arch-arm/usr/lib/crtend_android.o-L$A/platforms/$P/arch-arm/usr/lib -L$A/platforms/$P/arch-arm/usr/lib/libm.so -L$A/platforms/$P/arch-arm/usr/lib/libc.so" LDLIBS="m c gcc"
else
# Dynamic linking
LDFLAGS="-Xlinker -z -Xlinker muldefs -nostdlib -Bdynamic -Xlinker -Xlinker -dynamic-linker -Xlinker /system/bin/linker -Xlinker -z -Xlinker nocopyreloc -#Xlinker --no-undefined$A/platforms/$P/arch-arm/usr/lib/crtbegin_dynamic.o$A/platforms/$P/arch-arm/usr/lib/crtend_android.o-L$A/platforms/$P/arch-arm/usr/lib/" LDLIBS="dl m c gcc"
fiQuoted 6 lines
make EXTRA_LDFLAGS="$LDFLAGS" LDLIBS="$LDLIBS" "$@"
In the above script am facing some issue with linkers
[ LDFLAGS="-Xlinker -z -Xlinker muldefs -nostdlib -Bdynamic -Xlinker -T$A/build/core/armelf.x -Xlinker -dynamic-linker -Xlinker /system/bin/linker -Xlinker -z -Xlinker nocopyreloc -Xlinker --no-undefined$A/out/target/product/$P/obj/lib/crtbegin_dynamic.o$A/out/target/product/$P/obj/lib/crtend_android.o-L$A/out/target/product/$P/obj/lib" ]That is am not able to set linker properly and so system is failing to recognize it. Can you please look into and suggest me what to do.
Hmm.. The Android toolchain (Android NDK) wasn't really a "developer friendly" one and it still keep that status. The procedure and helper scripts doesn't work nice with every NDK releases. Just start with a simple hello world program and then proceed to something complex like LTP.
Quoted 2 lines
Thanks & Regards,
RejishWarm Regards,
Maxin B. John
________________________________________Quoted 21 lines
From: Maxin B John [[email protected]]
Sent: Tuesday, March 06, 2012 5:27 PM
To: Rejish Rajagopala
Cc: Cyril Hrubis; [email protected]
Subject: Re: [LTP] Need help in cross compiling LTP for androidHi,
Quoted 3 lines · Rejish Rajagopala
Hi Cyril,
Thanks for your input.
I have one more doubt that is if I want to check whether my LTP has been cross compiled properly then how can I confirm that without running the LTP in android phone.You can copy any one of the cross compiled binaries in LTP (eg:
testcases/kernel/syscalls/open/open01) to Android device and execute it there.
It is better to have "busybox" ready in your Android device to run LTP properly. If you finds it difficult to cross-compile "Busybox", it is available in Android Market also.Quoted 81 lines
Quoted 2 lines
Thanks & Regards,
RejishWarm Regards,
Maxin B. John
________________________________________Quoted 75 lines
From: Cyril Hrubis [[email protected]]
Sent: Friday, March 02, 2012 6:28 PM
To: Rejish Rajagopala
Cc: [email protected]
Subject: Re: [LTP] Need help in cross compiling LTP for androidHi!
Quoted 14 lines
+ LOGFILE_NAME=2012_Mar_02-14h_25m_52s
+ LOGFILE=-l /data/ltp/make_2802_02_2012/results/LTP_RUN_ON-2012_Mar_02-14h_25m_52s.log
+ ALT_DIR_RES=1
+ PRETTY_PRT= -p
+ [ ! ]
+ ALT_DIR_OUT=1
+ [ ! ]
+ [ ! -l /data/ltp/make_2802_02_2012/results/LTP_RUN_ON-2012_Mar_02-14h_25m_52s.log ]
+ basename 2012_Mar_02-14h_25m_52s
+ FAILED_FILE_NAME=2012_Mar_02-14h_25m_52s
+ FAILCMDFILE=-C /data/ltp/make_2802_02_2012/output/LTP_RUN_ON-2012_Mar_02-14h_25m_52s.failed
+ [ 0 -eq 1 ]
+ [ 1 -eq 1 ]
+ [ ! -d /data/ltp/make_2802_02_2012/output ]Quoted 8 lines
+ [ 1 -eq 1 ]
+ echo INFO: creating /data/ltp/make_2802_02_2012/results directory
INFO: creating /data/ltp/make_2802_02_2012/results directory
+ [ ! -d /data/ltp/make_2802_02_2012/results ]
+ mkdir -m 777 -p /data/ltp/make_2802_02_2012/tmp
mkdir failed for -m, File exists
+ echo FATAL: Unable to make temporary directory /data/ltp/make_2802_02_2012/tmp
FATAL: Unable to make temporary directory /data/ltp/make_2802_02_2012/tmpHmm, this is strange, mkdir -p must not fail with 'File exists'.
Quoted 14 lines
+ export TMPTEMPLATE=/data/ltp/make_2802_02_2012/tmp/ltp-XXXXXXXXXX
+ mktemp -d /data/ltp/make_2802_02_2012/tmp/ltp-XXXXXXXXXX
+ TMP=/data/ltp/make_2802_02_2012/tmp/ltp-hYXbVD3460
+ export TMP
+ export TMPDIR=/data/ltp/make_2802_02_2012/tmp/ltp-hYXbVD3460
+ chmod 777 /data/ltp/make_2802_02_2012/tmp/ltp-hYXbVD3460
+ cd /data/ltp/make_2802_02_2012/tmp/ltp-hYXbVD3460
+ [ -n ]
+ [ 0 -eq 1 ]
+ [ -z ]
+ [ -z ]
+ cat
+ + cat /data/ltp/make_2802_02_2012/scenario_groups/default tr \012...
Quoted 2 lines
+ rm -f /data/ltp/make_2802_02_2012/tmp/ltp-hYXbVD3460/cat_ok.3443 rm failed for -f, No such file or directory
And this is even much more wrong.
I'm not familiar with android but this sugests that you have very crippled busybox or whatever is installed there to provide basic commands like rm, mkdir and so.
--
Cyril Hrubis
[email protected]SASKEN BUSINESS DISCLAIMER: This message may contain confidential, proprietary or legally privileged information. In case you are not the original intended Recipient of the message, you must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message and you are requested to delete it and inform the sender. Any views expressed in this message are those of the individual sender unless otherwise stated. Nothing contained in this message shall be construed as an offer or acceptance of any offer by Sasken Communication Technologies Limited ("Sasken") unless sent with that express intent and with due authority of Sasken. Sasken has taken enough precautions to prevent the spread of viruses. However the company accepts no liability for any damage caused by any virus transmitted by this email. Read Disclaimer at http://www.sasken.com/extras/mail_disclaimer.html
------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
Quoted 9 lines
------------------------------------------------------------------------------
Better than sec? Nothing is better than sec when it comes to monitoring Big Data applications. Try Boundary one-second resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
_______________________________________________
Ltp-list mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
------------------------------------------------------------------------------
Better than sec? Nothing is better than sec when it comes to monitoring Big Data applications. Try Boundary one-second resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
_______________________________________________
Ltp-list mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
Hi,
Please find more details about the error.
+ /u/ltp/android-ndk-r7b/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc -march=armv7-a -mtune=xscale -msoft-float -fpic -mthumb-interwork -ffunction-sections -funwind-tables -fstack-protector -fno-short-enums -O2 -fomit-frame-pointer -funswitch-loops -finline-limit=300 -g -O2 -fno-strict-aliasing -pipe -Wall -I/u/ltp/android-ndk-r7b/platforms/android-14/arch-arm/usr/include -D__ARM_ARCH_7__ -D__ARM_ARCH_7A__ -D__ARM_ARCH_7R__ -D__ARM_ARCH_7M__ -DANDROID -D__linux__ -DDEV_BSIZE=512 -DSIGCLD=SIGCHLD -D_FILE_OFFSET_BITS=64 -I/u/ltp/ltp-full-20120104/testcases/kernel/include -D_GNU_SOURCE -I/u/ltp/ltp-full-20120104/testcases/kernel/timers/clock_gettime/../include -I../../../../include -I../../../../include -nostdlib -Bdynamic -Wl,-dynamic-linker,/system/bin/linker -Wl,--gc-sections -Wl,-z,nocopyreloc -L/u/ltp/android-ndk-r7b/platforms/android-14/arch-arm/usr/lib -L../../../../lib clock_gettime02.c /u/ltp/android-ndk-r7b/platforms/android-1 4/arch-arm/usr/lib/crtbegin_dynamic.o -Wl,-rpath-link=/u/ltp/android-ndk-r7b/platforms/android-14/arch-arm/usr/lib /u/ltp/android-ndk-r7b/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.4.3/libgcc.a -lc /u/ltp/android-ndk-r7b/platforms/android-14/arch-arm/usr/lib/crtend_android.o -L/u/ltp/android-ndk-r7b/platforms/android-14/arch-arm/usr/lib -lltp -o clock_gettime02
../../../../lib/libltp.a(parse_opts.o): In function `usc_test_looping':
/u/ltp/ltp-full-20120104/lib/parse_opts.c:716: undefined reference to `__aeabi_fcmpeq'
/u/ltp/ltp-full-20120104/lib/parse_opts.c:725: undefined reference to `__aeabi_fcmpeq'
/u/ltp/ltp-full-20120104/lib/parse_opts.c:734: undefined reference to `__aeabi_fcmpeq'
/u/ltp/ltp-full-20120104/lib/parse_opts.c:735: undefined reference to `__aeabi_i2f'
/u/ltp/ltp-full-20120104/lib/parse_opts.c:735: undefined reference to `__aeabi_fmul'
/u/ltp/ltp-full-20120104/lib/parse_opts.c:735: undefined reference to `__aeabi_f2iz'
/u/ltp/ltp-full-20120104/lib/parse_opts.c:746: undefined reference to `__aeabi_fcmpeq'
/u/ltp/ltp-full-20120104/lib/parse_opts.c:772: undefined reference to `__aeabi_fcmpeq'
/u/ltp/ltp-full-20120104/lib/parse_opts.c:716: undefined reference to `__aeabi_fcmpeq'
/u/ltp/ltp-full-20120104/lib/parse_opts.c:727: undefined reference to `__aeabi_fmul'
/u/ltp/ltp-full-20120104/lib/parse_opts.c:727: undefined reference to `__aeabi_f2iz'
../../../../lib/libltp.a(parse_opts.o): In function `parse_opts':
/u/ltp/ltp-full-20120104/lib/parse_opts.c:289: undefined reference to `__aeabi_d2f'
/u/ltp/ltp-full-20120104/lib/parse_opts.c:293: undefined reference to `__aeabi_d2f'
/u/ltp/ltp-full-20120104/lib/parse_opts.c:294: undefined reference to `__aeabi_fcmpeq'
/u/ltp/ltp-full-20120104/lib/parse_opts.c:438: undefined reference to `__aeabi_fcmpge'
/u/ltp/ltp-full-20120104/lib/parse_opts.c:441: undefined reference to `__aeabi_f2d'
/u/ltp/ltp-full-20120104/lib/parse_opts.c:421: undefined reference to `__aeabi_fcmpge'
/u/ltp/ltp-full-20120104/lib/parse_opts.c:425: undefined reference to `__aeabi_fcmpeq'
/u/ltp/ltp-full-20120104/lib/parse_opts.c:408: undefined reference to `__aeabi_fcmpge'
/u/ltp/ltp-full-20120104/lib/parse_opts.c:413: undefined reference to `__aeabi_fcmpeq'
/u/ltp/ltp-full-20120104/lib/parse_opts.c:424: undefined reference to `__aeabi_f2d'
/u/ltp/ltp-full-20120104/lib/parse_opts.c:411: undefined reference to `__aeabi_f2d'
collect2: ld returned 1 exit status
Thanks & Regards,
Rejish
________________________________________
From: Garrett Cooper [[email protected]]
Sent: Wednesday, April 11, 2012 2:53 PM
To: Rejish Rajagopala
Cc: Maxin B John; [email protected]
Subject: Re: [LTP] Need help in cross compiling LTP for android
Not enough context was provided to determine why linking failed.
Quoted 195 lines · Rejish Rajagopala
Hi Maxin,
I could resolve the configuration issue and I could cross compile on of the LTP modules (pty) for Android. Now I am trying to cross compile another module (timers) for Andorid using the tool chain NDK r-7. I am facing the below error:
collect2: ld returned 1 exit status
make[2]: *** [clock_gettime02] Error 1
make[2]: Leaving directory `/u/ltp/ltp-full-20120104/testcases/kernel/timers/clock_gettime' make[1]: *** [all] Error 2
make[1]: Leaving directory `/u/ltp/ltp-full-20120104/testcases/kernel/timers'
make: *** [testcases/kernel/timers-all] Error 2Please let me know why this is coming and what should I do to overcome this issue.
Thanks & Regards,
Rejish
________________________________________
From: Maxin B John [[email protected]]
Sent: Thursday, March 08, 2012 2:27 PM
To: Rejish Rajagopala
Cc: Cyril Hrubis; [email protected]
Subject: Re: [LTP] Need help in cross compiling LTP for androidHi,
Quoted 5 lines · Rejish Rajagopala
Hi Maxin,
Thanks for your reply.
I downloaded busybox and super user apk from android market, But its not working.
It's a bit difficult to believe as you are doubting the integrity of "Android Market" here :)
Quoted 1 line
Even I tried cross compiling busybox with Android tool chain. I used the following script to cross compile it.
IMHO, cross compiling LTP for any platform isn't really a nice topic of discussion in a mailing-list like this.
Your life will be a lot simpler if you try to use the available "busybox" package in Android Market itself.Quoted 30 lines
#!/bin/sh
# Build Busybox against Android's bionic
# Originally by Dan Fandrich
#
# Configure withandroid_defconfig
# This file has been tested on Android Froyo (the lack ofttyname_rin# the must be patched around) and Gingerbread.# Point this to the Android root directory; it's used in the defconfig CFLAGS export A="/u/android-ndk-r5b"
# Android product being built
P=android-3# Toolchain version in use by this version of Android GCCVER=4.4.0
export PATH="$A/toolchains/arm-eabi-4.4.0/prebuilt/linux-x86/bin/arm-eabi-$GCCVER:$PATH"
# Set the linker flags; compiler flags are in the defconfig file
if grep "^CONFIG_STATIC=y" .config >/dev/null ; then
# Static linking
LDFLAGS="-static -Xlinker -z -Xlinker muldefs -nostdlib$A/platforms/$P/arch-arm/usr/lib/crtbegin_static.o$A/platforms/$P/arch-arm/usr/lib/crtend_android.o-L$A/platforms/$P/arch-arm/usr/lib -L$A/platforms/$P/arch-arm/usr/lib/libm.so -L$A/platforms/$P/arch-arm/usr/lib/libc.so" LDLIBS="m c gcc"
else
# Dynamic linking
LDFLAGS="-Xlinker -z -Xlinker muldefs -nostdlib -Bdynamic -Xlinker -Xlinker -dynamic-linker -Xlinker /system/bin/linker -Xlinker -z -Xlinker nocopyreloc -#Xlinker --no-undefined$A/platforms/$P/arch-arm/usr/lib/crtbegin_dynamic.o$A/platforms/$P/arch-arm/usr/lib/crtend_android.o-L$A/platforms/$P/arch-arm/usr/lib/" LDLIBS="dl m c gcc"
fiQuoted 6 lines
make EXTRA_LDFLAGS="$LDFLAGS" LDLIBS="$LDLIBS" "$@"
In the above script am facing some issue with linkers
[ LDFLAGS="-Xlinker -z -Xlinker muldefs -nostdlib -Bdynamic -Xlinker -T$A/build/core/armelf.x -Xlinker -dynamic-linker -Xlinker /system/bin/linker -Xlinker -z -Xlinker nocopyreloc -Xlinker --no-undefined$A/out/target/product/$P/obj/lib/crtbegin_dynamic.o$A/out/target/product/$P/obj/lib/crtend_android.o-L$A/out/target/product/$P/obj/lib" ]That is am not able to set linker properly and so system is failing to recognize it. Can you please look into and suggest me what to do.
Hmm.. The Android toolchain (Android NDK) wasn't really a "developer friendly" one and it still keep that status. The procedure and helper scripts doesn't work nice with every NDK releases. Just start with a simple hello world program and then proceed to something complex like LTP.
Quoted 2 lines
Thanks & Regards,
RejishWarm Regards,
Maxin B. John
________________________________________Quoted 21 lines
From: Maxin B John [[email protected]]
Sent: Tuesday, March 06, 2012 5:27 PM
To: Rejish Rajagopala
Cc: Cyril Hrubis; [email protected]
Subject: Re: [LTP] Need help in cross compiling LTP for androidHi,
Quoted 3 lines · Rejish Rajagopala
Hi Cyril,
Thanks for your input.
I have one more doubt that is if I want to check whether my LTP has been cross compiled properly then how can I confirm that without running the LTP in android phone.You can copy any one of the cross compiled binaries in LTP (eg:
testcases/kernel/syscalls/open/open01) to Android device and execute it there.
It is better to have "busybox" ready in your Android device to run LTP properly. If you finds it difficult to cross-compile "Busybox", it is available in Android Market also.Quoted 81 lines
Quoted 2 lines
Thanks & Regards,
RejishWarm Regards,
Maxin B. John
________________________________________Quoted 75 lines
From: Cyril Hrubis [[email protected]]
Sent: Friday, March 02, 2012 6:28 PM
To: Rejish Rajagopala
Cc: [email protected]
Subject: Re: [LTP] Need help in cross compiling LTP for androidHi!
Quoted 14 lines
+ LOGFILE_NAME=2012_Mar_02-14h_25m_52s
+ LOGFILE=-l /data/ltp/make_2802_02_2012/results/LTP_RUN_ON-2012_Mar_02-14h_25m_52s.log
+ ALT_DIR_RES=1
+ PRETTY_PRT= -p
+ [ ! ]
+ ALT_DIR_OUT=1
+ [ ! ]
+ [ ! -l /data/ltp/make_2802_02_2012/results/LTP_RUN_ON-2012_Mar_02-14h_25m_52s.log ]
+ basename 2012_Mar_02-14h_25m_52s
+ FAILED_FILE_NAME=2012_Mar_02-14h_25m_52s
+ FAILCMDFILE=-C /data/ltp/make_2802_02_2012/output/LTP_RUN_ON-2012_Mar_02-14h_25m_52s.failed
+ [ 0 -eq 1 ]
+ [ 1 -eq 1 ]
+ [ ! -d /data/ltp/make_2802_02_2012/output ]Quoted 8 lines
+ [ 1 -eq 1 ]
+ echo INFO: creating /data/ltp/make_2802_02_2012/results directory
INFO: creating /data/ltp/make_2802_02_2012/results directory
+ [ ! -d /data/ltp/make_2802_02_2012/results ]
+ mkdir -m 777 -p /data/ltp/make_2802_02_2012/tmp
mkdir failed for -m, File exists
+ echo FATAL: Unable to make temporary directory /data/ltp/make_2802_02_2012/tmp
FATAL: Unable to make temporary directory /data/ltp/make_2802_02_2012/tmpHmm, this is strange, mkdir -p must not fail with 'File exists'.
Quoted 14 lines
+ export TMPTEMPLATE=/data/ltp/make_2802_02_2012/tmp/ltp-XXXXXXXXXX
+ mktemp -d /data/ltp/make_2802_02_2012/tmp/ltp-XXXXXXXXXX
+ TMP=/data/ltp/make_2802_02_2012/tmp/ltp-hYXbVD3460
+ export TMP
+ export TMPDIR=/data/ltp/make_2802_02_2012/tmp/ltp-hYXbVD3460
+ chmod 777 /data/ltp/make_2802_02_2012/tmp/ltp-hYXbVD3460
+ cd /data/ltp/make_2802_02_2012/tmp/ltp-hYXbVD3460
+ [ -n ]
+ [ 0 -eq 1 ]
+ [ -z ]
+ [ -z ]
+ cat
+ + cat /data/ltp/make_2802_02_2012/scenario_groups/default tr \012...
Quoted 2 lines
+ rm -f /data/ltp/make_2802_02_2012/tmp/ltp-hYXbVD3460/cat_ok.3443 rm failed for -f, No such file or directory
And this is even much more wrong.
I'm not familiar with android but this sugests that you have very crippled busybox or whatever is installed there to provide basic commands like rm, mkdir and so.
--
Cyril Hrubis
[email protected]SASKEN BUSINESS DISCLAIMER: This message may contain confidential, proprietary or legally privileged information. In case you are not the original intended Recipient of the message, you must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message and you are requested to delete it and inform the sender. Any views expressed in this message are those of the individual sender unless otherwise stated. Nothing contained in this message shall be construed as an offer or acceptance of any offer by Sasken Communication Technologies Limited ("Sasken") unless sent with that express intent and with due authority of Sasken. Sasken has taken enough precautions to prevent the spread of viruses. However the company accepts no liability for any damage caused by any virus transmitted by this email. Read Disclaimer at http://www.sasken.com/extras/mail_disclaimer.html
------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
Quoted 9 lines
------------------------------------------------------------------------------
Better than sec? Nothing is better than sec when it comes to monitoring Big Data applications. Try Boundary one-second resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
_______________________________________________
Ltp-list mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
------------------------------------------------------------------------------
Better than sec? Nothing is better than sec when it comes to monitoring Big Data applications. Try Boundary one-second resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
_______________________________________________
Ltp-list mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
Hi!
Quoted 1 line
+ /u/ltp/android-ndk-r7b/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc -march=armv7-a -mtune=xscale -msoft-float -fpic -mthumb-interwork -ffunction-sections -funwind-tables -fstack-protector -fno-short-enums -O2 -fomit-frame-pointer -funswitch-loops -finline-limit=300 -g -O2 -fno-strict-aliasing -pipe -Wall -I/u/ltp/android-ndk-r7b/platforms/android-14/arch-arm/usr/include -D__ARM_ARCH_7__ -D__ARM_ARCH_7A__ -D__ARM_ARCH_7R__ -D__ARM_ARCH_7M__ -DANDROID -D__linux__ -DDEV_BSIZE=512 -DSIGCLD=SIGCHLD -D_FILE_OFFSET_BITS=64 -I/u/ltp/ltp-full-20120104/testcases/kernel/include -D_GNU_SOURCE -I/u/ltp/ltp-full-20120104/testcases/kernel/timers/clock_gettime/../include -I../../../../include -I../../../../include -nostdlib -Bdynamic -Wl,-dynamic-linker,/system/bin/linker -Wl,--gc-sections -Wl,-z,nocopyreloc -L/u/ltp/android-ndk-r7b/platforms/android-14/arch-arm/usr/lib -L../../../../lib
clock_gettime02.c/u/ltp/android-ndk-r7b/platforms/android
-1
Quoted 18 lines
4/arch-arm/usr/lib/crtbegin_dynamic.o-Wl,-rpath-link=/u/ltp/android-ndk-r7b/platforms/android-14/arch-arm/usr/lib /u/ltp/android-ndk-r7b/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.4.3/libgcc.a -lc /u/ltp/android-ndk-r7b/platforms/android-14/arch-arm/usr/lib/crtend_android.o -L/u/ltp/android-ndk-r7b/platforms/android-14/arch-arm/usr/lib -lltp -oclock_gettime02
../../../../lib/libltp.a(parse_opts.o): In function `usc_test_looping':
/u/ltp/ltp-full-20120104/lib/parse_opts.c:716: undefined reference to `__aeabi_fcmpeq'
/u/ltp/ltp-full-20120104/lib/parse_opts.c:725: undefined reference to `__aeabi_fcmpeq'
/u/ltp/ltp-full-20120104/lib/parse_opts.c:734: undefined reference to `__aeabi_fcmpeq'
/u/ltp/ltp-full-20120104/lib/parse_opts.c:735: undefined reference to `__aeabi_i2f'
/u/ltp/ltp-full-20120104/lib/parse_opts.c:735: undefined reference to `__aeabi_fmul'
/u/ltp/ltp-full-20120104/lib/parse_opts.c:735: undefined reference to `__aeabi_f2iz'
/u/ltp/ltp-full-20120104/lib/parse_opts.c:746: undefined reference to `__aeabi_fcmpeq'
/u/ltp/ltp-full-20120104/lib/parse_opts.c:772: undefined reference to `__aeabi_fcmpeq'
/u/ltp/ltp-full-20120104/lib/parse_opts.c:716: undefined reference to `__aeabi_fcmpeq'
/u/ltp/ltp-full-20120104/lib/parse_opts.c:727: undefined reference to `__aeabi_fmul'
/u/ltp/ltp-full-20120104/lib/parse_opts.c:727: undefined reference to `__aeabi_f2iz'
../../../../lib/libltp.a(parse_opts.o): In function `parse_opts':
/u/ltp/ltp-full-20120104/lib/parse_opts.c:289: undefined reference to `__aeabi_d2f'
/u/ltp/ltp-full-20120104/lib/parse_opts.c:293: undefined reference to `__aeabi_d2f'
/u/ltp/ltp-full-20120104/lib/parse_opts.c:294: undefined reference to `__aeabi_fcmpeq'
/u/ltp/ltp-full-20120104/lib/parse_opts.c:438: undefined reference to `__aeabi_fcmpge'
Quoted 8 lines
/u/ltp/ltp-full-20120104/lib/parse_opts.c:441: undefined reference to
__aeabi_f2d' /u/ltp/ltp-full-20120104/lib/parse_opts.c:421: undefined reference to__aeabi_fcmpge' /u/ltp/ltp-full-20120104/lib/parse_opts.c:425: undefined reference to__aeabi_fcmpeq' /u/ltp/ltp-full-20120104/lib/parse_opts.c:408: undefined reference to__aeabi_fcmpge' /u/ltp/ltp-full-20120104/lib/parse_opts.c:413: undefined reference to__aeabi_fcmpeq' /u/ltp/ltp-full-20120104/lib/parse_opts.c:424: undefined reference to__aeabi_f2d' /u/ltp/ltp-full-20120104/lib/parse_opts.c:411: undefined reference to `__aeabi_f2d'
collect2: ld returned 1 exit status
That suggets that the linker wasn't been able to pick up symbols from libgcc.a, possibly because linker flags and static libraries are passed to it in the wrong order.
Signature · 13 lines
Cyril Hrubis [email protected] ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Ltp-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ltp-list
Thanks,
Quoted 4 lines · Cyril Hrubis
Hi!
Quoted 1 line
+
/u/ltp/android-ndk-r7b/toolchains/arm-linux-androideabi-
4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc
Quoted 1 line
-march=armv7-a -mtune=xscale -msoft-float -fpic -mthumb-interwork -
ffunction-sections
Quoted 1 line
-funwind-tables -fstack-protector -fno-short-enums -O2 -fomit-frame-
pointer -funswitch-loops
Review
Quoted 2 lines
(quoted diff) +0
-2-finline-limit=300 -g -O2 -fno-strict-aliasing -pipe -Wall -I/u/ltp/android-ndk-r7b/platforms/android-14/arch-arm/usr/include -
D__ARM_ARCH_7__
Quoted 1 line
-D__ARM_ARCH_7A__ -D__ARM_ARCH_7R__ -D__ARM_ARCH_7M__ -DANDROID -
D__linux__ -DDEV_BSIZE=512
Quoted 1 line
-DSIGCLD=SIGCHLD -D_FILE_OFFSET_BITS=64 -I/u/ltp/ltp-full-
20120104/testcases/kernel/include
Quoted 1 line
-D_GNU_SOURCE -I/u/ltp/ltp-full-
20120104/testcases/kernel/timers/clock_gettime/../include
Quoted 1 line
-I../../../../include -I../../../../include -nostdlib -Bdynamic -Wl,-
dynamic-linker,/syst
Quoted 2 lines
em/bin/linker -Wl,--gc-sections -Wl,-z,nocopyreloc
-L/u/ltp/android-ndk-r7b/platforms/android-14/arch-arm/usr/lib -
L../../../../lib
Quoted 3 lines
clock_gettime02.c/u/ltp/android-ndk-r7b/platforms/android-1Quoted 1 line
4/arch-arm/usr/lib/crtbegin_dynamic.o-Wl,-rpath-link=/u/ltp/android-ndk-r7b/platforms/android-14/arch-
arm/usr/lib
Quoted 1 line
/u/ltp/android-ndk-r7b/toolchains/arm-linux-androideabi-
4.4.3/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.4.3/libgcc.a
Quoted 1 line
-lc /u/ltp/android-ndk-r7b/platforms/android-14/arch-
arm/usr/lib/crtend_android.o
Quoted 1 line
-L/u/ltp/android-ndk-r7b/platforms/android-14/arch-arm/usr/lib -lltp -o
clock_gettime02
Quoted 2 lines
Quoted 2 lines
../../../../lib/libltp.a(parse_opts.o): In function `usc_test_looping':
/u/ltp/ltp-full-20120104/lib/parse_opts.c:716: undefined reference to
`__aeabi_fcmpeq'
Quoted 1 line
Quoted 1 line
/u/ltp/ltp-full-20120104/lib/parse_opts.c:725: undefined reference to
`__aeabi_fcmpeq'
Quoted 1 line
Quoted 1 line
/u/ltp/ltp-full-20120104/lib/parse_opts.c:734: undefined reference to
`__aeabi_fcmpeq'
Quoted 1 line
Quoted 1 line
/u/ltp/ltp-full-20120104/lib/parse_opts.c:735: undefined reference to
`__aeabi_i2f'
Quoted 1 line
Quoted 1 line
/u/ltp/ltp-full-20120104/lib/parse_opts.c:735: undefined reference to
`__aeabi_fmul'
Quoted 1 line
Quoted 1 line
/u/ltp/ltp-full-20120104/lib/parse_opts.c:735: undefined reference to
`__aeabi_f2iz'
Quoted 1 line
Quoted 1 line
/u/ltp/ltp-full-20120104/lib/parse_opts.c:746: undefined reference to
`__aeabi_fcmpeq'
Quoted 1 line
Quoted 1 line
/u/ltp/ltp-full-20120104/lib/parse_opts.c:772: undefined reference to
`__aeabi_fcmpeq'
Quoted 1 line
Quoted 1 line
/u/ltp/ltp-full-20120104/lib/parse_opts.c:716: undefined reference to
`__aeabi_fcmpeq'
Quoted 1 line
Quoted 1 line
/u/ltp/ltp-full-20120104/lib/parse_opts.c:727: undefined reference to
`__aeabi_fmul'
Quoted 1 line
Quoted 1 line
/u/ltp/ltp-full-20120104/lib/parse_opts.c:727: undefined reference to
`__aeabi_f2iz'
Quoted 2 lines
Quoted 2 lines
../../../../lib/libltp.a(parse_opts.o): In function `parse_opts':
/u/ltp/ltp-full-20120104/lib/parse_opts.c:289: undefined reference to
`__aeabi_d2f'
Quoted 1 line
Quoted 1 line
/u/ltp/ltp-full-20120104/lib/parse_opts.c:293: undefined reference to
`__aeabi_d2f'
Quoted 1 line
Quoted 1 line
/u/ltp/ltp-full-20120104/lib/parse_opts.c:294: undefined reference to
`__aeabi_fcmpeq'
Quoted 1 line
Quoted 1 line
/u/ltp/ltp-full-20120104/lib/parse_opts.c:438: undefined reference to
`__aeabi_fcmpge'
Quoted 1 line
Quoted 1 line
/u/ltp/ltp-full-20120104/lib/parse_opts.c:441: undefined reference to
`__aeabi_f2d'
Quoted 1 line
Quoted 1 line
/u/ltp/ltp-full-20120104/lib/parse_opts.c:421: undefined reference to
`__aeabi_fcmpge'
Quoted 1 line
Quoted 1 line
/u/ltp/ltp-full-20120104/lib/parse_opts.c:425: undefined reference to
`__aeabi_fcmpeq'
Quoted 1 line
Quoted 1 line
/u/ltp/ltp-full-20120104/lib/parse_opts.c:408: undefined reference to
`__aeabi_fcmpge'
Quoted 1 line
Quoted 1 line
/u/ltp/ltp-full-20120104/lib/parse_opts.c:413: undefined reference to
`__aeabi_fcmpeq'
Quoted 1 line
Quoted 1 line
/u/ltp/ltp-full-20120104/lib/parse_opts.c:424: undefined reference to
`__aeabi_f2d'
Quoted 1 line
Quoted 1 line
/u/ltp/ltp-full-20120104/lib/parse_opts.c:411: undefined reference to
`__aeabi_f2d'
Quoted 6 lines
Quoted 1 line
collect2: ld returned 1 exit status
That suggets that the linker wasn't been able to pick up symbols from libgcc.a, possibly because linker flags and static libraries are passed to it in the wrong order.
Hi,
I am able to cross compile for android but not able to execute it on android platform.
I if execute any of the binaries i am getting " no such file or directory" I checked that the issue with dynamic linker :
readelf --program
Elf file type is EXEC (Executable file) Entry point 0x87e8
There are 8 program headers, starting at offset 52
Program Headers:
Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
EXIDX 0x000a7c 0x00008a7c 0x00008a7c 0x00048 0x00048 R 0x4
PHDR 0x000034 0x00008034 0x00008034 0x00100 0x00100 R E 0x4
INTERP 0x000134 0x00008134 0x00008134 0x00013 0x00013 R 0x1
[Requesting program interpreter: /lib/ld-linux.so.3]
LOAD 0x000000 0x00008000 0x00008000 0x00ac8 0x00ac8 R E 0x8000
LOAD 0x000ac8 0x00010ac8 0x00010ac8 0x00148 0x00158 RW 0x8000
DYNAMIC 0x000ad4 0x00010ad4 0x00010ad4 0x000f0 0x000f0 RW 0x4
NOTE 0x000148 0x00008148 0x00008148 0x00020 0x00020 R 0x4
GNU_STACK 0x000000 0x00000000 0x00000000 0x00000 0x00000 RW 0x10Its taking default linker file as /lib/ld-linux, it should be /system/bin/linker for android i guess.
Can someone suggest me hoe to change this.
------------------------------------------------------------------------------
Time is money. Stop wasting it! Get your web API in 5 minutes. www.restlet.com/download
http://p.sf.net/sfu/restlet
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list