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 11:20:58AM +0000, Emmanuel Dreyfus wrote:
> On Mon, Feb 04, 2013 at 11:46:11AM +0100, Joerg Sonnenberger wrote:
> > This is even more messy than the last approach.
> Why is it messy? The thing gets relibale and functionnal again.

You call breaking NOLOAD in fundamental ways "reliable and

> > Seriously, changing rtld is completely out of the question.
> At some time we will have to ask core foe settlement. But I understand
> you prefer the fake libpthread approach. How are you going to do it?
> Do you adovcate the creation of two glib2 packages in pkgsrc, 
> one linked with libpthread and the other linked with fake libpthread? 

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.


Home | Main Index | Thread Index | Old Index