Problem in rawhide with ld and weak symbols?

Stephan Bergmann sbergman at redhat.com
Thu Mar 7 19:28:02 UTC 2013


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>, 
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."

Stephan


More information about the devel mailing list