0.9.29, somethings wrong with linker or threading

Jason Curl jcurlmail at arcor.de
Thu May 24 21:12:34 UTC 2007


Kevin Day wrote:
> 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, where do I find this? I had a SEGV for x86 when using 
uClibc0.9.29 with binutils 2.17, kernel 2.6.20.4 as the headers, GCC 
4.1.2. It only occurred for programs that were linked using pthreads as 
well and it would crash before entering main(). I didn't have a debug 
environment for the target.

I worked around the problem after I found I'm using the newer versions 
of threading in 'make uclibc-menuconfig'. I changed it to use the old 
version (more stable) and it worked again.

I'd like to go back and see if I can confirm what you've found as well 
(but first I'm not 100% sure if it's the same problem).

Jason.



More information about the uClibc mailing list