Problem in rawhide with ld and weak symbols?
Stephan Bergmann
sbergman at redhat.com
Thu Mar 7 20:12:13 UTC 2013
On 03/07/2013 08:31 PM, Jon Ciesla wrote:
> On Thu, Mar 7, 2013 at 1:28 PM, Stephan Bergmann <sbergman at redhat.com
> <mailto:sbergman at redhat.com>> wrote:
>
> Building LibreOffice for x86_64 starting to fail in an odd way
> recently,
> <http://koji.fedoraproject.__org/koji/getfile?taskID=__5091173&name=build.log&offset=__-4000
> <http://koji.fedoraproject.org/koji/getfile?taskID=5091173&name=build.log&offset=-4000>>,
> I stripped that down to what I would assume is a newly introduced
> bug in how ld resolves weak references?
>
> Given a test.s of
>
> .text
> .globl main
> .type main, @function
> main:
> .quad x
> .weakref x,__pthread_key_create
>
>
> "gcc test.s" builds fine, while "gcc test.s -lcom_err", i.e.,
> including a reference to some .so that in turn needs libpthread,
> fails with
>
> /usr/bin/ld: /tmp/cckAPSW1.o: undefined reference to symbol
> '__pthread_key_create@@GLIBC___2.2.5'
> /usr/bin/ld: note: '__pthread_key_create@@GLIBC___2.2.5' is
> defined in DSO /lib64/libpthread.so.0 so try adding it to the
> linker command line
> /lib64/libpthread.so.0: could not read symbols: Invalid operation
> collect2: error: ld returned 1 exit status
>
>
> The same works fine in F-18. The failing ld is "GNU ld version
> 2.23.52.0.1-4.fc19 20130226."
>
>
> I ran into this with kismet, adding an '-lpthread' at the right spot
> fixed it. I think it just got stricter again.
Just see this is a known problem already,
<https://bugzilla.redhat.com/show_bug.cgi?id=918003> " New ld broke
handling of undefined weak symbols" (and "adding an '-lpthread' at the
right spot" just works around the symptoms).
Stephan
More information about the devel
mailing list