All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai-help] Errors while static linking of Xenomai
@ 2008-07-23  9:17 Christian Volk
  2008-07-23 17:15 ` Philippe Gerum
  0 siblings, 1 reply; 5+ messages in thread
From: Christian Volk @ 2008-07-23  9:17 UTC (permalink / raw)
  To: xenomai

Hi,

when I try to compile Xenomai and link it satically i get some 'undefined reference' errors while compiling the cyclictest programm from the testsuite.
I'm using Xenomai 2.4.4 with uclibc and try to compile for a ppc-arch board (Freescale MPC8343 processor).

Heres the line which I use to configure Xenomai:
./configure --host=powerpc-generic-linux-uclibc CC=/opt/powerpc-linux-uclibc/bin/powerpc-generic-linux-uclibc-gcc CXX=/opt/powerpc-linux-uclibc/bin/powerpc-generic-linux-uclibc-g++ LD=/opt/powerpc-linux-uclibc/bin/powerpc-generic-linux-uclibc-ld --enable-shared=no LDFLAGS=--static 

And thats the output I get when compiling cyclictest:

Making install in cyclic
make[3]: Entering directory `/home/develop/Download/xenomai-2.4.4/src/testsuite/cyclic'
/opt/powerpc-linux-uclibc/bin/powerpc-generic-linux-uclibc-gcc -DHAVE_CONFIG_H -I. -I../../../src/include  -I../../../include/posix -O2 -D_GNU_SOURCE -D_REENTRANT -Wall -pipe -D__XENO__ -D__IN_XENO__ -Wstrict-prototypes -DIPIPE_TRACE=1 -I../../../include    -MT cyclictest-cyclictest.o -MD -MP -MF .deps/cyclictest-cyclictest.Tpo -c -o cyclictest-cyclictest.o `test -f 'cyclictest.c' || echo './'`cyclictest.c
mv -f .deps/cyclictest-cyclictest.Tpo .deps/cyclictest-cyclictest.Po
/bin/sh ../../../libtool --tag=CC   --mode=link /opt/powerpc-linux-uclibc/bin/powerpc-generic-linux-uclibc-gcc   -Wl,@/home/develop/Download/xenomai-2.4.4/src/skins/posix/posix.wrappers  --static -o cyclictest cyclictest-cyclictest.o ../../skins/posix/libpthread_rt.la -lpthread -lrt
mkdir .libs
/opt/powerpc-linux-uclibc/bin/powerpc-generic-linux-uclibc-gcc -Wl,@/home/develop/Download/xenomai-2.4.4/src/skins/posix/posix.wrappers --static -o cyclictest cyclictest-cyclictest.o  ../../skins/posix/.libs/libpthread_rt.a -lpthread -lrt
/opt/powerpc-linux-uclibc/powerpc-generic-linux-uclibc/sys-root/usr/lib/libpthread.a(pthread.os):(.data.rel+0x3f4): undefined reference to `__wrap_pthread_condattr_destroy'
/opt/powerpc-linux-uclibc/powerpc-generic-linux-uclibc/sys-root/usr/lib/libpthread.a(pthread.os):(.data.rel+0x3f8): undefined reference to `__wrap_pthread_condattr_init'
/opt/powerpc-linux-uclibc/powerpc-generic-linux-uclibc/sys-root/usr/lib/libpthread.a(pthread.os):(.data.rel+0x3fc): undefined reference to `__wrap_pthread_cond_broadcast'
/opt/powerpc-linux-uclibc/powerpc-generic-linux-uclibc/sys-root/usr/lib/libpthread.a(pthread.os):(.data.rel+0x400): undefined reference to `__wrap_pthread_cond_destroy'
/opt/powerpc-linux-uclibc/powerpc-generic-linux-uclibc/sys-root/usr/lib/libpthread.a(pthread.os):(.data.rel+0x404): undefined reference to `__wrap_pthread_cond_init'
/opt/powerpc-linux-uclibc/powerpc-generic-linux-uclibc/sys-root/usr/lib/libpthread.a(pthread.os):(.data.rel+0x408): undefined reference to `__wrap_pthread_cond_signal'
/opt/powerpc-linux-uclibc/powerpc-generic-linux-uclibc/sys-root/usr/lib/libpthread.a(pthread.os):(.data.rel+0x40c): undefined reference to `__wrap_pthread_cond_wait'
/opt/powerpc-linux-uclibc/powerpc-generic-linux-uclibc/sys-root/usr/lib/libpthread.a(pthread.os):(.data.rel+0x464): undefined reference to `__wrap_pthread_cond_timedwait'
/opt/powerpc-linux-uclibc/powerpc-generic-linux-uclibc/sys-root/usr/lib/libpthread.a(mutex.os): In function `__pthread_once_fork_child':
mutex.c:(.text+0x1fc): undefined reference to `__wrap_pthread_cond_init'
/opt/powerpc-linux-uclibc/powerpc-generic-linux-uclibc/sys-root/usr/lib/libpthread.a(mutex.os): In function `pthread_once':
mutex.c:(.text+0x490): undefined reference to `__wrap_pthread_cond_wait'
mutex.c:(.text+0x534): undefined reference to `__wrap_pthread_cond_broadcast'
/opt/powerpc-linux-uclibc/powerpc-generic-linux-uclibc/sys-root/usr/lib/libpthread.a(mutex.os): In function `pthread_once_cancelhandler':
mutex.c:(.text+0x58c): undefined reference to `__wrap_pthread_cond_broadcast'
collect2: ld returned 1 exit status
make[3]: *** [cyclictest] Fehler 1


Any hints and/or help to solve this problem is appreciated.

Thanks in advance.

regards,
Christian


^ permalink raw reply	[flat|nested] 5+ messages in thread
* Re: [Xenomai-help] Errors while static linking of Xenomai
@ 2008-07-28 14:39 Christian Volk
  0 siblings, 0 replies; 5+ messages in thread
From: Christian Volk @ 2008-07-28 14:39 UTC (permalink / raw)
  To: Gilles Chanteperdrix; +Cc: xenomai

Hi all,

sry for my delayed answer.
So what We've actually done was to rewrite the gcc commands for compiling the posix stuff in the testsuite:
Original:
powerpc-generic-linux-uclibc-gcc -Wl,@/home/develop/Download/xenomai-2.4.4/src/skins/posix/posix.wrappers --static -o switchtest switchtest-switchtest.o  ../../skins/posix/.libs/libpthread_rt.a -lpthread -lrt 

Our fix:
powerpc-generic-linux-uclibc-gcc -Wl,@/home/develop/Download/xenomai-2.4.4/src/skins/posix/posix.wrappers --static -o switchtest -Wl,"-(" switchtest-switchtest.o  ../../skins/posix/.libs/libpthread_rt.a -lpthread -lrt -Wl,"-)"

We inserted the  -Wl,"-(" ... -Wl,"-)" construct around the linker stuff, so it trys to solve all dependencies in all directions.
The errors only occur while compiling the testsuite.
 

regards,

Christian

----- original Nachricht --------

Betreff: Re: [Xenomai-help] Errors while static linking of Xenomai
Gesendet: Mo, 28. Jul 2008
Von: Gilles Chanteperdrix<gilles.chanteperdrix@xenomai.org>

> Christian Volk wrote:
> > During the day we found a "workaround" or maybe a fix.
> > I will post details tomorrow from work.
> > We used -Wl,"-(" archives -Wl,"-)" so we built a start-group - end-group
> > Construct which fixed all issues.
> > 
> > Thanks for your answer Philippe, this will help me while creating my own
> > apps.
> 
> It would be interesting if we could apply your fix to Xenomai makefiles.
> Could you give us a little bit more details ?
> 
> -- 
>                                                  Gilles.
> 

--- original Nachricht Ende ----



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-07-28 14:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-23  9:17 [Xenomai-help] Errors while static linking of Xenomai Christian Volk
2008-07-23 17:15 ` Philippe Gerum
2008-07-23 17:40   ` Christian Volk
2008-07-28  9:56     ` Gilles Chanteperdrix
  -- strict thread matches above, loose matches on Subject: below --
2008-07-28 14:39 Christian Volk

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.