sigprocmask testing program failed with static linking

Peter Mazinger ps.m at gmx.net
Sat Apr 23 11:25:59 UTC 2011


I am all for removing duplicated functions in libc/libpthread, began this in future branch (cancellable functions), if we need separate implementations, I would prefer to rename functions in libpthread to 
"show us", that this is something else...

Peter

-------- Original-Nachricht --------
> Datum: Thu, 21 Apr 2011 18:23:21 -0700
> Von: Austin Foxley <austinf at cetoncorp.com>
> An: Jian Peng <jipeng at broadcom.com>
> CC: "uclibc at uclibc.org" <uclibc at uclibc.org>
> Betreff: Re: sigprocmask testing program failed with static linking

> On 03/27/2011 12:27 AM, Jian Peng wrote:
> > This is one of many potential static linking problems in uClibc. Last
> time, I reported a bug on sigaction and submitted a patch, but similar
> multiple definition error could happen to any function that was defined as GLOBAL
> in both libc.a and libpthread.a while certain runtime supporting function
> from libc, like abort(), also call it.
> >
> > For example, sigprocmask-test.c is a simple testing program and
> >
> > $ gcc sigprocmask-test.c -o sigprocmask-test -static -lpthread
> >
> > Since sigprocmask is GLOBAL in both libc.a and libpthread.a, sigprocmask
> called in main function will pull in pt-sigprocmask.os from libpthread.a,
> but later, another sigprocmask called in abort (part of libc) will pull in
> sigprocmask.os from libc.a and leads to multiple definition error.
> >
> > To fix it, sigprocmask has to be defined as weak symbol. The same
> solution could be applied to other functions in libc/sysdeps/linux/common that
> will be called in both main and runtime supporting function in libc. I will
> identify them and post patch later.
> >
> > Here is my patch to fix sigprocmask, and it was tested on gcc-4.5.2
> based toolchain on MIPS.
> 
> 
> I've also ran into this problem recently but I fixed it by simply 
> removing the libpthread version entirely and forcing the calls to go 
> through libc. The calls I had trouble with were sigaction, sigprocmask, 
> and sigfillset.
> 
> I think this is what Peter meant was his preferred solution in the reply 
> to your earlier email?
> 
> Peter can you comment? I can put together a patch of what I've been 
> using and push it to future if that is what you meant.
> 
> -Austin
> _______________________________________________
> uClibc mailing list
> uClibc at uclibc.org
> http://lists.busybox.net/mailman/listinfo/uclibc

-- 
Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de


More information about the uClibc mailing list