]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
[Bug 2332] Be more careful about when we use 'libgcc_s'
authorHarlan Stenn <stenn@ntp.org>
Fri, 31 Jan 2014 11:48:11 +0000 (11:48 +0000)
committerHarlan Stenn <stenn@ntp.org>
Fri, 31 Jan 2014 11:48:11 +0000 (11:48 +0000)
bk: 52eb8d7b2SWEzLYFng54cAKXp7ovcA

ChangeLog
sntp/m4/ntp_libntp.m4

index c2b06eeb4e9e9ed2e6efb4391f254427a25d52ff..d01a50f805f5cd02637df75304fef02f76f60b1f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,4 @@
+* [Bug 2332] Be more careful about when we use 'libgcc_s'.
 (4.2.7p415) 2014/01/28 Released by Harlan Stenn <stenn@ntp.org>
 * Fix the man page installation for the scripts/ files.
 (4.2.7p414) 2014/01/28 Released by Harlan Stenn <stenn@ntp.org>
index 214d824c32b1b739554af227a3c22a3e7b20c005..542d0120d2edc703808e430b8a716ff37f7ba8fe 100644 (file)
@@ -340,14 +340,16 @@ case "$enable_thread_support" in
         yes)
            PTHREAD_LIBS="$LTHREAD_LIBS"
            have_pthreads=yes
-           # Bug 2332: With GCC we need to force a reference to libgcc_s, or the
-           # combination threads + setuid + mlockall does not work on linux
-           # because thread cancellation fails to load libgcc_s with dlopen().
+           # Bug 2332: With GCC we need to force a reference to libgcc_s
+           # (if libgcc_s exists) or the combination of
+           # threads + setuid + mlockall does not work on linux because
+           # thread cancellation fails to load libgcc_s with dlopen().
            # We have to pass this all as linker options to avoid argument
            # reordering by libtool.
            case "$GCC$with_gnu_ld" in
            yesyes)
-               PTHREAD_LIBS="$LTHREAD_LIBS -Wl,--no-as-needed,-lgcc_s,--as-needed"
+               AC_CHECK_LIB([gcc_s], [exit],
+                       [PTHREAD_LIBS="$LTHREAD_LIBS -Wl,--no-as-needed,-lgcc_s,--as-needed"])
                ;;
            esac
        esac