pixman / tls link time issue

Dagobert Michelsen dam at opencsw.org
Mon Jul 11 19:42:13 CEST 2016


Hi Riccardo,

Am 11.07.2016 um 14:20 schrieb Dagobert Michelsen <dam at opencsw.org>:
>>> What happens?
>> 
>> On solaris9 sparc, after the succesful build,  to an ldd:
>> 
>> ldd -r work/solaris9-sparc/build-isa-sparcv9/pixman-0.22.2/pixman/.libs/libpixman-1.so
>>       /usr/lib/secure/64/s9_preload.so.1
>>       libm.so.1 =>     /usr/lib/64/libm.so.1
>>       libc.so.1 =>     /usr/lib/64/libc.so.1
>>       libdl.so.1 =>    /usr/lib/64/libdl.so.1
>>       /usr/platform/SUNW,SPARC-Enterprise-T5220/lib/sparcv9/libc_psr.so.1
>>       symbol not found: __tls_get_addr (work/solaris9-sparc/build-isa-sparcv9/pixman-0.22.2/pixman/.libs/libpixman-1.so)
>> 
>> ldd -r work/solaris9-sparc/build-isa-sparcv8/pixman-0.22.2/pixman/.libs/libpixman-1.so
>>       /usr/lib/secure/s9_preload.so.1
>>       libm.so.1 =>     /usr/lib/libm.so.1
>>       libc.so.1 =>     /usr/lib/libc.so.1
>>       libdl.so.1 =>    /usr/lib/libdl.so.1
>>       /usr/platform/SUNW,SPARC-Enterprise-T5220/lib/libc_psr.so.1
>>       symbol not found: __tls_get_addr (work/solaris9-sparc/build-isa-sparcv8/pixman-0.22.2/pixman/.libs/libpixman-1.so)
>> 
>> 
>> On the partial build on solaris9x, where i386 built, it is consistent:
>> ldd -r work/solaris9-i386/build-isa-i386/pixman-0.22.2/pixman/.libs/libpixman-1.so
>>       libm.so.1 =>     /usr/lib/libm.so.1
>>       libc.so.1 =>     /usr/lib/libc.so.1
>>       libdl.so.1 =>    /usr/lib/libdl.so.1
>>       symbol not found: ___tls_get_addr (work/solaris9-i386/build-isa-i386/pixman-0.22.2/pixman/.libs/libpixman-1.so)
>> 
>> As a test, I compiled everything with GCC - but I get the same error.
>> Perhaps we are missing some linker flag? I tried to look on the internet, other had this problem also on non-solaris, but found no solutions.
>> 
>> I'm weary to update pixman: I don't want to enter a dependency hell updating stuff on solaris9. First rebuilding this package "fixed" would be preferrable!
>> 
>> A "fresh" rebuild on solaris10s is perfectly fine...
>> 
>> ldd -r work/solaris10-sparc/build-isa-sparcv9/pixman-0.22.2/pixman/.libs/libpixman-1.so
>>       libm.so.2 =>     /lib/64/libm.so.2
>>       libc.so.1 =>     /lib/64/libc.so.1
>>       /platform/SUNW,SPARC-Enterprise-T5220/lib/sparcv9/libc_psr.so.1
> 
> You need to get deeper in multithreading on Solaris 9, I haven’t looked into it
> in more detail, feel free to do more investigation.

The symbol is defined in
  /usr/lib/lwp/libthread.so.1

> dam at unstable9x :/home/dam/mgar/pkg/pixman/trunk > nm -D /usr/lib/lwp/libthread.so.1  | grep __tls_get_addr
> [391]   |     84304|      45|FUNC |GLOB |0    |10     |___tls_get_addr
> [364]   |     84288|      61|FUNC |GLOB |0    |10     |__tls_get_addr

Please see also threads(3thr) and the documentation from the
Multithreading Programming Guide at
  https://docs.oracle.com/cd/E19455-01/806-5257/6je9h033l/index.html

We had a wrapper around pigz, please see the comments:

> dam at unstable9x :/home/dam/mgar/pkg > more pigz/trunk/files/pigz-wrapper
> #!/bin/sh
> 
> # Needed on native Solaris 8
> # See http://www.opencsw.org/bugtrack/view.php?id=3879
> # and http://developers.sun.com/solaris/articles/alt_thread_lib.html
> # Unfortunately the path can not be compiled an as libthread.so.1
> # gets pulled in from the pthread library which brings in his own
> # ideas of link path ordering.
> LD_LIBRARY_PATH=/usr/lib/lwp
> export LD_LIBRARY_PATH
> exec /opt/csw/libexec/pigz "$@„

Adding this explicitly to the testsuite works:

> dam at unstable9x :/home/dam/mgar/pkg/pixman/trunk/work/solaris9-i386/build-isa-i386/pixman-0.22.2/test > LD_PRELOAD_32=/usr/lib/lwp/libthread.so.1 ./a1-trap-test
> dam at unstable9x :/home/dam/mgar/pkg/pixman/trunk/work/solaris9-i386/build-isa-i386/pixman-0.22.2/test >
>      ^——— No error!

Howver, neither adding -R/usr/lib/lwp as suggested from the docs works nor using
POSIX threads by adding an extra -lpthread.

Feel free to continue from here.


Best regards

  — Dago

--
"You don't become great by trying to be great, you become great by wanting to do something,
and then doing it so hard that you become great in the process." - xkcd #896

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 841 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.opencsw.org/pipermail/users/attachments/20160711/eb865ef6/attachment-0001.asc>


More information about the users mailing list