From 986c44a43e70a2a006f36555207b14584517997e Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Wed, 2 Sep 2020 09:53:47 +0200 Subject: [PATCH] BUILD: thread: limit the libgcc_s workaround to glibc only 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. (cherry picked from commit 06a1806083dd9f0d21e045baad4c61559211f956) Signed-off-by: Willy Tarreau (cherry picked from commit e6a4e318db089df3dbadcbed286ed12a3742a7e5) Signed-off-by: Christopher Faulet --- src/hathreads.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hathreads.c b/src/hathreads.c index 5bdb618..e09f187 100644 --- a/src/hathreads.c +++ b/src/hathreads.c @@ -201,7 +201,7 @@ static void __hathreads_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 -- 1.7.10.4