Linking problems with pthread

Peter S. Mazinger ps.m at gmx.net
Wed Feb 1 14:48:38 UTC 2006


On Wed, 1 Feb 2006, Thomas Ritter wrote:

> Hi,
> 
> I tried to use the latest version of uClibc (from svn) and ran into a
> linking problem.
> I have an application (C++) linked with pthread lib - and get "multiple
> definition" errors:
>  sigaction, nanosleep, waitpid, __errno_location, __h_errno_location
> 
> Gcc is 3.4.5 built form buildroot, and uClibc is build with "old" pthread.
> With uClibc 0.9.27 the app links fine.
> 
> Any hints what I can fix ?
> 
> Regards,
> Thomas 

update uClibc to current svn, if it fails, then we/me are in great trouble 
;-(

have you tried linking dynamically as well?

Peter
> 
> 
> armv5b-linux-uclibc-g++ -march=armv5 -Dlinux -D__linux__ -D__uClinux__
> -Dunix -D__PIC__ -fpic -msingle-pic-base -static -nostdlib -L.../devel/lib
> -L.../devel/lib/armnommu
> -L/opt/armgcc-3.4.5/bin/../lib/gcc/armv5b-linux-uclibc/3.4.5/
> .../devel/lib/crt1.o -Wl,-elf2flt= -o skybox -Wl,--start-group armnommu/at.o
> armnommu/sysparam.o armnommu/timesync.o armnommu/verify.o armnommu/skycmd.o
> armnommu/sysmon.o armnommu/version.o armnommu/generate-pem.o
> armnommu/skynat.o armnommu/logger.o armnommu/ipcalc.o armnommu/udprand.o
> armnommu/mii_info.o armnommu/skybox.o -lskydata -lsky -Wl,--end-group
> -lcrypt -lpthread -luClibc++ .../devel/lib/crti.o .../devel/lib/crtn.o -lc
> -lgcc
> 
> 
> .../devel/lib/libc.a(sigaction.os): In function `sigaction':
> sigaction.c:(.text+0x0): multiple definition of `sigaction'
> .../devel/lib/libpthread.a(signals.os):signals.c:(.text+0x360): first
> defined here
> /opt/armgcc-3.4.5/bin/../lib/gcc/armv5b-linux-uclibc/3.4.5/../../../../armv5
> b-linux-uclibc/bin/ld.real: Warning: size of symbol `sigaction' changed from
> 308 in .../devel/lib/libpthread.a(signals.os) to 224 in
> .../devel/lib/libc.a(sigaction.os)
> 
> .../devel/lib/libc.a(nanosleep.os): In function `nanosleep':
> nanosleep.c:(.text+0x0): multiple definition of `nanosleep'
> .../devel/lib/libpthread.a(wrapsyscall.os):wrapsyscall.c:(.text+0x160):
> first defined here
> /opt/armgcc-3.4.5/bin/../lib/gcc/armv5b-linux-uclibc/3.4.5/../../../../armv5
> b-linux-uclibc/bin/ld.real: Warning: size of symbol `nanosleep' changed from
> 68 in .../devel/lib/libpthread.a(wrapsyscall.os) to 44 in
> .../devel/lib/libc.a(nanosleep.os)
> 
> .../devel/lib/libc.a(waitpid.os): In function `waitpid':
> waitpid.c:(.text+0x0): multiple definition of `waitpid'
> .../devel/lib/libpthread.a(wrapsyscall.os):wrapsyscall.c:(.text+0x3d0):
> first defined here
> /opt/armgcc-3.4.5/bin/../lib/gcc/armv5b-linux-uclibc/3.4.5/../../../../armv5
> b-linux-uclibc/bin/ld.real: Warning: size of symbol `waitpid'
> .../devel/lib/libpthread.a(wrapsyscall.os) to 8 in
> ./../devel/lib/libc.a(waitpid.os)
> 
> .../devel/lib/libc.a(__errno_location.os): In function
> `__GI___errno_location':
> __errno_location.c:(.text+0x0): multiple definition of `__errno_location'
> .../devel/lib/libpthread.a(errno.os):errno.c:(.text+0x0): first defined here
> /opt/armgcc-3.4.5/bin/../lib/gcc/armv5b-linux-uclibc/3.4.5/../../../../armv5
> b-linux-uclibc/bin/ld.real: Warning: size of symbol `__errno_location'
> changed from 152 in .../devel/lib/libpthread.a(errno.os) to 16 in
> .../devel/lib/libc.a(__errno_location.os)
> 
> .../devel/lib/libc.a(__h_errno_location.os): In function
> `__GI___h_errno_location':
> __h_errno_location.c:(.text+0x0): multiple definition of
> `__h_errno_location'
> .../devel/lib/libpthread.a(errno.os):errno.c:(.text+0x98): first defined
> here
> /opt/armgcc-3.4.5/bin/../lib/gcc/armv5b-linux-uclibc/3.4.5/../../../../armv5
> b-linux-uclibc/bin/ld.real: Warning: size of symbol `__h_errno_location'
> changed from 152 in .../devel/lib/libpthread.a(errno.os) to 16 in
> .../devel/lib/libc.a(__h_errno_location.os)
> collect2: ld returned 1 exit status
> make: *** [skybox] Error 1
> 
>  
> 
> 
> 

-- 
Peter S. Mazinger <ps dot m at gmx dot net>           ID: 0xA5F059F2
Key fingerprint = 92A4 31E1 56BC 3D5A 2D08  BB6E C389 975E A5F0 59F2




More information about the uClibc mailing list