[PATCH]cyclictest: CFLAGS to support static compiliation with ARM Crosscompiler

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dear williams,

This patch is for support static building using cross-compiler for
embedded targetboard like ARM. 
When we use -static option for static binary on embedded board after
patch.
I tested various toolchain.(e.g: codesourcery toolchain , my self
toolchain , cross-tool project's toolchain)
Ref) Don't forget "-static" configuration(CFLAGS  += -O2 -static) in
Makefile When you need static linking.  

Before patch) 
/usr/local/arm_v7_vfp_le/bin/../target/usr/lib/librt.a(timer_create.o):
In function `timer_create':
/home/build/BUILD/glibc-2.5.90/rt/../nptl/sysdeps/unix/sysv/linux/timer_create.c:174: undefined reference to `pthread_attr_init'
/home/build/BUILD/glibc-2.5.90/rt/../nptl/sysdeps/unix/sysv/linux/timer_create.c:192: undefined reference to `pthread_attr_setdetachstate'
/usr/local/arm_v7_vfp_le/bin/../target/usr/lib/librt.a(timer_routines.o): In function `__start_helper_thread':
/home/build/BUILD/glibc-2.5.90/rt/../nptl/sysdeps/unix/sysv/linux/timer_routines.c:144: undefined reference to `pthread_attr_init'
/home/build/BUILD/glibc-2.5.90/rt/../nptl/sysdeps/unix/sysv/linux/timer_routines.c:145: undefined reference to `pthread_attr_setstacksize'
/home/build/BUILD/glibc-2.5.90/rt/../nptl/sysdeps/unix/sysv/linux/timer_routines.c:171: undefined reference to `pthread_attr_destroy'
/home/build/BUILD/glibc-2.5.90/rt/../nptl/sysdeps/unix/sysv/linux/timer_routines.c:175: undefined reference to `pthread_atfork'
/usr/local/arm_v7_vfp_le/bin/../target/usr/lib/librt.a(timer_routines.o): In function `timer_helper_thread':
/home/build/BUILD/glibc-2.5.90/rt/../nptl/sysdeps/unix/sysv/linux/timer_routines.c:114: undefined reference to `pthread_exit'
collect2: ld returned 1 exit status
make: *** [cyclictest] Error 1


After patch) Success...
Fedora11$> file ./cyclictest
./cyclictest: ELF 32-bit LSB executable, ARM, version 1 (SYSV),
statically linked, for GNU/Linux 2.6.18, not stripped

====================================================================

>From 45e4dbeb8e7723cefa9117736b0ece5ea188ce6a Mon Sep 17 00:00:00 2001
From: Geunsik Lim <geunsik.lim@xxxxxxxxxxx>
Date: Thu, 21 Jan 2010 09:00:24 +0900
Subject: [PATCH 2/2] bugfix: Support static linking(-static) with
Crosscompiler on ARM targetboard.

This patch is for support static building using cross-compiler for
embedded targetboard like ARM.
When we use -static option for static binary on embedded board after
patch.
I tested various toolchain.(e.g: codesourcery toolchain , my self
toolchain , cross-tool project's toolchain)
Ref) Don't forget "-static" configuration(CFLAGS  += -O2 -static) in
Makefile When you need static linking.

Signed-off-by: Geunsik Lim <geunsik.lim@xxxxxxxxxxx>
---
 Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Makefile b/Makefile
index e14d957..65f506a 100644
--- a/Makefile
+++ b/Makefile
@@ -3,7 +3,7 @@ VERSION_STRING = 0.61
 TARGETS	= cyclictest signaltest pi_stress \
 	  hwlatdetect rt-migrate-test ptsematest sigwaittest svsematest \
 	  sendme pip
-LIBS 	= -lpthread -lrt
+LIBS 	= -lrt -lpthread
 EXTRA_LIBS ?= -ldl	# for get_cpu
 DESTDIR	?=
 prefix  ?= /usr/local
-- 
1.6.2.5


-- 
-----------------------------------------------
To unsubscribe from this list: send the line "unsubscribe linux-***" 
in the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

GeunSik Lim ( Samsung Electronics )
e-Mail  :1) geunsik.lim@xxxxxxxxxxx
         2) leemgs@xxxxxxxxx , leemgs1@xxxxxxxxx
HomePage: http://blog.naver.com/invain/
-----------------------------------------------

--
To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [RT Stable]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux