]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libgcc: Do use weakrefs for glibc 2.34 on GNU Hurd
authorJakub Jelinek <jakub@redhat.com>
Tue, 30 Apr 2024 07:00:07 +0000 (09:00 +0200)
committerJakub Jelinek <jakub@redhat.com>
Tue, 30 Apr 2024 07:00:07 +0000 (09:00 +0200)
On Mon, Apr 29, 2024 at 01:44:24PM +0000, Joseph Myers wrote:
> > glibc 2.34 and later doesn't have separate libpthread (libpthread.so.0 is a
> > dummy shared library with just some symbol versions for compatibility, but
> > all the pthread_* APIs are in libc.so.6).
>
> I suspect this has caused link failures in the glibc testsuite for Hurd,
> which still has separate libpthread.
>
> https://sourceware.org/pipermail/libc-testresults/2024q2/012556.html

So like this then?

2024-04-30  Jakub Jelinek  <jakub@redhat.com>

* gthr.h (GTHREAD_USE_WEAK): Don't redefine to 0 for glibc 2.34+
on GNU Hurd.

libgcc/gthr.h

index 53a5f0f7458a115723cf123b4f746ab1c4bc2e4d..33c2d8ff63062a118cddcfeb3d0bd3db0ae61242 100644 (file)
@@ -142,7 +142,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #endif
 
 #ifdef __GLIBC_PREREQ
-#if __GLIBC_PREREQ(2, 34)
+#if __GLIBC_PREREQ(2, 34) && !defined(__gnu_hurd__)
 /* glibc 2.34 and later has all pthread_* APIs inside of libc,
    no need to link separately with -lpthread.  */
 #undef GTHREAD_USE_WEAK