From: Harlan Stenn Date: Fri, 31 Jan 2014 11:48:11 +0000 (+0000) Subject: [Bug 2332] Be more careful about when we use 'libgcc_s' X-Git-Tag: NTP_4_2_7P416~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=de032db86c485a8907212bf89f9e1fe448e45574;p=thirdparty%2Fntp.git [Bug 2332] Be more careful about when we use 'libgcc_s' bk: 52eb8d7b2SWEzLYFng54cAKXp7ovcA --- diff --git a/ChangeLog b/ChangeLog index c2b06eeb4..d01a50f80 100644 --- 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 * Fix the man page installation for the scripts/ files. (4.2.7p414) 2014/01/28 Released by Harlan Stenn diff --git a/sntp/m4/ntp_libntp.m4 b/sntp/m4/ntp_libntp.m4 index 214d824c3..542d0120d 100644 --- a/sntp/m4/ntp_libntp.m4 +++ b/sntp/m4/ntp_libntp.m4 @@ -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