tech-userlevel archive

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

Re: fixing libpthread noload, another approach



On Mon, Feb 04, 2013 at 12:51:41PM +0100, Joerg Sonnenberger wrote:
> There are a number of options to take here. The first one would be to
> change glib2 itself so that pthread_create is a weak reference and it no
> longer has to link against libpthread. Alternative is to put that into a
> shared library, e.g.
> 
> pthread_create -> fake_pthread_create and the latter always just returns
> EINVAL or some other error
> 
> Weak ensures that if libpthread is actually linked in, it will be used.
> Putting it in a separate shared library makes it identifyable.

So I am still trying to understand WTF the glib design is supposed to
be. What I am guessing at the moment is that an application is supposed
to link against libglibthread if it wants to create threads. So the fix
for glib in this case would be to not use pthread_create as strong
symbol and/or link against a library just providing it as weak AND
require libglibthread to link against libpthread.

Joerg


Home | Main Index | Thread Index | Old Index