problem when pthread_* functions are invoked from dynamiclibrary

Peter S. Mazinger ps.m at gmx.net
Mon Dec 5 14:11:39 UTC 2005


On Mon, 5 Dec 2005, Kishore K wrote:

> On 12/5/05, Mike Frysinger <vapier at gentoo.org> wrote:
> >
> > ok, we chatted some more, and it turns out that glibc also updated
> > their libpthread forward.c file to accommodate the new weak behavior
> >
> > find attached an untested patch against current svn which updates our
> > weaks.c in the same manner ... the good news is that this should fix
> > the bugs people are seeing, the bad news is that it makes the weaks
> > file a bit bigger :( ... although, if i declare the extern weak pthread
> > function as attribute_hidden, it shrinks it considerably, i'm just not
> > sure if this is correct
> >
> > also, this will require us to change all the __pthread_X calls in libc
> > to __libc_pthread_X ... basically, the way this patch works is:
> > extern int weak __pthread_mutex_init();
> > int hidden __libc_pthread_mutex_init() {
> >         if (__pthread_mutex_init == NULL)
> >                 return 0;
> >         __pthread_mutex_init();
> > }
> > and then rinse/repeat for the other functions
> > -mike
> 
> 
> Thank you very much for the suggestions. I applied this patch to the source
> and tried to bring up the system with updated C library. The kernel (linux
> 2.4.31) stops after printing the message "Freeing unused kernel memory".  It
> seems that there is some problem in starting init process.

that was not meant for consumption yet ;-(
> 
> thanks,
> --kishore
> 

-- 
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