This is the mail archive of the libc-help@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: glibc build error: linking nptl static - V2.17





Carlos O'Donell wrote:
>
>>>       
>> What is the ".weak" supposed to do?
>>     
>
> Undefined references to weak symbols do not cause the static linker to
> include an object file to satisfy the undefined reference.
----
Oi! ... wish that worked for dynload as well -- i.e. just because a sym
is referenced ldd will fail if it can't find it -- even if the program
itself
doesn't seem like it would make use of such (maybe it is and I don't
know it).


>  The goal is
> to reduce the size of the static program. 
...
>  So you minimize the static application size by not including
> code you don't need.
>   
yes -- that's why i was disabling alot of things --
>   
>> note -- from below, it appears this message is taken when it is doing
>> the SHARED version
>>     
>
> Right, so either --disable-hidden-plt is breaking this code, because
> __GI_* is the "hidden global internal" name of the function that we
> expect to call via PLT, or your static build is somehow broken.
>   
----
    The only reason  I included that option was because I thought
(perhaps backwards), that not hiding symbols would allow more things
to link successfully -- but it may be just the opposite -- it may pull
more symbols in?

Also wasn't sure what the --enable-bind-now option did or if I should
leave it or not.


>   
>>> You can pretty easily see that it has no conditional for !SHARED (or
>>> static) when building within libpthread.
>>>
>>>       
>> ----
>>     .weak __pthread_unwind  = ???
>>
>>
>> I was going to just try static first, but got an error message saying it
>> would need the shared available if a program wanted to use dl_open ---
>> I would like that option...but I don't know why I need thread unwinding
>> in my static lib?  It's not like I'm going to be trying to debug with it
>> (I hope not!)...
>>     
>
> Unwinding is required to implement cancellation and unwinding is
> implemented in the compiler helper library which is dlopen'd.
>
>   
>>> Until you fix this it won't work.
>>>
>>>       
>> Hmmm...  Why is it there?... i.e. what is the purpose of unwinding and does
>> it apply to a static lib?...
>>     
>
> It does.
>
>   
>>> (b) Back off on some of the configure flags you are using.
>>>
>>>       
>> ----
>>     Yeah, maybe, but want to get all the normal options that make sense
>> -- i.e.
>> ones you might use in single-user/no-network/not running services yet.
>>
>>
>> You can still link statically without those flags, but some cases
>>     
>>> might load libraries.
>>>
>>>       
>> ???  Some cases?  link without all those flags?  which flags are you
>> referring to?
>>     
>
> Remove all of the ones not related to static linking.
>   
----
    Including the "withouts" and "disables" ???


I.e. had enable-bind-now (tried with that removed made no diff)
.. then tried weakening the Shared ref case...
... and the tests ran right up to the test where it tried to test
canceling something:
> /home/tools/glibc/glibc/Build/nptl/tst-cancel4.out
make[2]: *** [/home/tools/glibc/glibc/Build/nptl/tst-cancel4.out] Error 1
rm /home/tools/glibc/glibc/Build/nptl/libpthread.dynsym
make[2]: Leaving directory `/home/tools/glibc/glibc/nptl'
make[1]: *** [nptl/tests] Error 2
---
Imagine that! ;-)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]