]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
[Bug 2332] Force reference to 'libgcc_s' when using GCC, because threading+restricted...
authorJuergen Perlinger <perlinger@ntp.org>
Fri, 3 Jan 2014 23:11:38 +0000 (00:11 +0100)
committerJuergen Perlinger <perlinger@ntp.org>
Fri, 3 Jan 2014 23:11:38 +0000 (00:11 +0100)
bk: 52c743aatSh58iMpciUeJ4vU4ZBckg

ChangeLog
sntp/m4/ntp_libntp.m4

index 6cce57c2d6c0b07b33c0e199ff9ac1f73eede0f5..39d987dbf975c0ad2d33dd824ef51a53e8fe67dc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,5 @@
+* [Bug 2332] Force reference to 'libgcc_s' when using GCC, because
+  threading+restricted user+locked memory otherwise fails on Linux.
 * [Bug 2060] Warn about restrictions with "kod" but not "limited".
 (4.2.7p408) 2013/12/29 Released by Harlan Stenn <stenn@ntp.org>
 * [Bug 2187] Update version number generation scripts.
index 004f491cdbb6d017e1dff13303244cbfa59b2a51..cf29992cea490b89a8a5893456b34bdf6fd59898 100644 (file)
@@ -338,6 +338,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().
+           # We have to pass this all as linker options to avoid argument
+           # reordering by libtool.
+           case "$GCC" in
+           yes)
+               PTHREAD_LIBS="$LTHREAD_LIBS -Wl,--no-as-needed,-lgcc_s,--as-needed"
+               ;;
+           esac
        esac
     esac
 esac