From: Harlan Stenn Date: Wed, 8 Jan 2014 07:46:45 +0000 (-0500) Subject: [Bug 2332] Force reference to 'libgcc_s' when using GCC and GNU ld X-Git-Tag: NTP_4_2_7P410~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=194fc20d89360b7b8c6c6c77108a7e4ac600fb42;p=thirdparty%2Fntp.git [Bug 2332] Force reference to 'libgcc_s' when using GCC and GNU ld bk: 52cd0265BHNe_12C8_rPYTXFfXWNbg --- diff --git a/sntp/m4/ntp_libntp.m4 b/sntp/m4/ntp_libntp.m4 index cf29992ce..214d824c3 100644 --- a/sntp/m4/ntp_libntp.m4 +++ b/sntp/m4/ntp_libntp.m4 @@ -19,6 +19,8 @@ LIBS= dnl The contents of NTP_PROG_CC used to be here... AC_PROG_INSTALL +# [Bug 2332] because we need to know if we are using GNU ld... +LT_PATH_LD NTP_DIR_SEP NTP_LINEEDITLIBS @@ -338,13 +340,13 @@ 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 + # 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) + case "$GCC$with_gnu_ld" in + yesyes) PTHREAD_LIBS="$LTHREAD_LIBS -Wl,--no-as-needed,-lgcc_s,--as-needed" ;; esac