0.9.29, somethings wrong with linker or threading

Kevin Day thekevinday at gmail.com
Thu May 24 20:07:20 UTC 2007


On 5/19/07, Rob Landley <rob at landley.net> wrote:
> On Saturday 19 May 2007 6:27 pm, Kevin Day wrote:
> > I never noticed the problem myself after having almost an entire
> > system compiled, until a configure script test failed to find a
> > library (libao) that was installed.
>
> So it's reproducible, then?  (I haven't seen it yet, but I'm not doing much
> with threading.)
>

Reproducable indeed!  I have finally found the problem.

First, in order to rule out gcc (at least the specific gcc-4.1
version) I made the effort and got gcc-4.2 working (thus the long
delay).

Now here is the problem.  The problem only occurs when applications
use '-pthread' instead of directly calling "-lpthread".  I know there
is a reason for this, but I cannot remember.  However, after removing
the -pthread from the fuse project the linker is now able to properly
identify that the threaded libraries are missing at link time.

This means that my test.c program will now generate the correct errors
for when threading is used but not linked to.

I suspect a solution might be to edit the startfile_specs and add
something like the following "%{-pthread: -lpthread}" in gcc.  Please
correct my syntax if necessary as I am very inexperienced with the
specsfile syntax.

Although I am not certain why this problem didnt show up in 0.9.28,
but perhaps it did but was not as obvious.

I am about to start the process of testing this startfile spec test of
having -pthread replaced with -lpthread when called. Please let me
know if there are more steps needed to do this correctly.
-- 
Kevin Day



More information about the uClibc mailing list