]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD: thread: limit the libgcc_s workaround to glibc only
authorWilly Tarreau <w@1wt.eu>
Wed, 2 Sep 2020 07:53:47 +0000 (09:53 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 2 Sep 2020 07:53:47 +0000 (09:53 +0200)
Previous commit 77b98220e ("BUG/MINOR: threads: work around a libgcc_s
issue with chrooting") broke the build on cygwin. I didn't even know we
supported threads on cygwin. But the point is that it's actually the
glibc-based libpthread which requires libgcc_s, so in absence of other
reports we should not apply the workaround on other libraries.

This should be backported along with the aforementioned patch.

src/thread.c

index b902aa38ca99fb6362dc49ae75d09275ba985364..5eb68e33ad91b82dcb3206a8d41021616a4e8720 100644 (file)
@@ -201,7 +201,7 @@ static void __thread_init(void)
                exit(1);
        }
 
-#if defined(__GNUC__) && (__GNUC__ >= 3) && !defined(__clang__)
+#if defined(__GNUC__) && (__GNUC__ >= 3) && defined(__GNU_LIBRARY__) && !defined(__clang__)
        /* make sure libgcc_s is already loaded, because pthread_exit() may
         * may need it on exit after the chroot! _Unwind_Find_FDE() is defined
         * there since gcc 3.0, has no side effect, doesn't take any argument