On Wed, Oct 7, 2015 at 8:17 PM, Samuel Thibault <samuel.thiba...@gnu.org> wrote: > David Michael, le Tue 06 Oct 2015 17:49:00 -0400, a écrit : >> This one avoids problems with a symbol that is also provided by libpthread: >> https://anonscm.debian.org/viewvc/pkg-glibc/glibc-package/trunk/debian/patches/hurd-i386/tg-libc_getspecific.diff?view=co > > What problem does it actually solve? Apparently I didn't put enough > comments to remember what this is about. AIUI, it should be working > fine already since this non-weak __libc_getspecific function calls > cthread_getspecific, which calls pthread_getspecific.
Static linking libpthread doesn't work without it. The following commands work with the patch: $ echo 'int main(){return 42;}' | i686-pc-gnu-gcc -pthread -xc - $ echo 'int main(){return 42;}' | i686-pc-gnu-gcc -static -pthread -xc - Without the patch, the second command fails: $ echo 'int main(){return 42;}' | i686-pc-gnu-gcc -pthread -xc - $ echo 'int main(){return 42;}' | i686-pc-gnu-gcc -static -pthread -xc - /usr/i686-pc-gnu/sys-root/lib/libcrt.a(cthreads.o): In function `__libc_getspecific': (.text+0x70): multiple definition of `__libc_getspecific' /usr/i686-pc-gnu/sys-root/lib/libpthread2.a(cthreads-compat.o):(.text+0xd0): first defined here collect2: error: ld returned 1 exit status There may have been other subtle issues with running X or xdm from this, but I might be thinking of an earlier bad workaround I had... I also didn't comment enough to remember the whole story. Thanks. David