Hi

I want to cross compile ltp for arm platform also my entire executable
should be statically linked:

My ARM tool chain is installed in "/usr/local/arm/arm-2009q3/"

My LTP source is in "/home/user/test_apps/ltp/arm/ltp-full-20130904/".



I followed the below steps,

------------------------------------------------------------------------------------------------------------------------------

export ARCH=arm

export CROSS_COMPILER=/usr/local/arm/arm-2009q3/bin/arm-none-linux-gnueabi

export CC=$CROSS_COMPILER-gcc

export LD=$CROSS_COMPILER-ld

export AR=$CROSS_COMPILER-ar

export STRIP=$CROSS_COMPILER-strip

export RANLIB=$CROSS_COMPILER-ranlib

./configure --host=arm-linux
--prefix=/home/user/test_apps/ltp/arm/ltp-full-20130904/install
--exec-prefix=/home/user/test_apps/ltp/arm/ltp-full-20130904/install
LDFLAGS="-static"

make

-------------------------------------------------------------------------------------------------------------------------------



My Make fails as follows,

(I get "undefined reference to" all pthread calls in
"/testcases/kernel/syscalls/mq_notify".)

/usr/local/arm/arm-2009q3/bin/arm-none-linux-gnueabi-gcc -g -O2 -g -O2
-fno-strict-aliasing -pipe -Wall -D_FORTIFY_SOURCE=2
-I/home/user/test_apps/ltp/arm/ltp-full-20130904/testcases/kernel/include
-I../../../../include -I../../../../include -static  -L../../../../lib
mq_notify01.c   -lltp -lpthread -lrt -o mq_notify01

/usr/local/arm/arm-2009q3/bin/../arm-none-linux-gnueabi/libc/usr/lib/librt.a(mq_notify.o):
In function `mq_notify':

mq_notify.c:(.text+0x68): undefined reference to `pthread_once'


I don’t get this error if I don't put LDFLAGS="-static" in configure
command,



if I go to "testcases/kernel/syscalls/mq_notify" and try to build using the
command whatever the make is trying to do as follows,

------------------------------------------------------------------------------------------------------------------

/usr/local/arm/arm-2009q3/bin/arm-none-linux-gnueabi-gcc -g -O2 -g -O2
-fno-strict-aliasing -pipe -Wall -D_FORTIFY_SOURCE=2
-I/home/user/test_apps/ltp/arm/ltp-full-20130904/testcases/kernel/include
-I../../../../include -I../../../../include -static  -L../../../../lib
mq_notify01.c   -lltp -lpthread -lrt -o mq_notify01

----------------------------------------------------------------------------------------------------------------

obviously I get the same error, but if I rearrange the pthread linker flag
at the last as follows

-----------------------------------------------------------------------------------------------------------------

/usr/local/arm/arm-2009q3/bin/arm-none-linux-gnueabi-gcc -g -O2 -g -O2
-fno-strict-aliasing -pipe -Wall -D_FORTIFY_SOURCE=2
-I/home/user/test_apps/ltp/arm/ltp-full-20130904/testcases/kernel/include
-I../../../../include -I../../../../include -static  -L../../../../lib
mq_notify01.c   -lltp -lrt -o mq_notify01 -lpthread

---------------------------------------------------------------------------------------------------------------

The compilation succeeds now

Can someone help me how to cross compile ltp for arm with statically
linking?
------------------------------------------------------------------------------
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing 
conversations that shape the rapidly evolving mobile landscape. Sign up now. 
http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to