summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandreast <andreast@138bc75d-0d04-0410-961f-82ee72b054a4>2016-01-14 20:27:49 +0000
committerandreast <andreast@138bc75d-0d04-0410-961f-82ee72b054a4>2016-01-14 20:27:49 +0000
commita2a7452b3a4926fa8193f434dc0d9c32c87ee319 (patch)
tree92f1ce1f067dd71e382bc2344c00514b5bb404f0
parent4c39e3a534b3071dda9130f05ef6db5106821490 (diff)
downloadgcc-a2a7452b3a4926fa8193f434dc0d9c32c87ee319.tar.gz
2016-01-14 Andreas Tobler <andreast@gcc.gnu.org>
* configure.ac: Replace the hard-coded -ldl requirement for link_sanitizer_common with a configure time check for -ldl. * configure: Regenerate. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@232385 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--libsanitizer/ChangeLog6
-rwxr-xr-xlibsanitizer/configure48
-rw-r--r--libsanitizer/configure.ac6
3 files changed, 56 insertions, 4 deletions
diff --git a/libsanitizer/ChangeLog b/libsanitizer/ChangeLog
index 895d3bd6db2..5d25590ae7c 100644
--- a/libsanitizer/ChangeLog
+++ b/libsanitizer/ChangeLog
@@ -1,3 +1,9 @@
+2016-01-14 Andreas Tobler <andreast@gcc.gnu.org>
+
+ * configure.ac: Replace the hard-coded -ldl requirement for
+ link_sanitizer_common with a configure time check for -ldl.
+ * configure: Regenerate.
+
2015-11-24 Maxim Ostapenko <m.ostapenko@partner.samsung.com>
* include/system/linux/asm/ptrace.h: Move to ...
diff --git a/libsanitizer/configure b/libsanitizer/configure
index a0fc860bfce..040ded0abc6 100755
--- a/libsanitizer/configure
+++ b/libsanitizer/configure
@@ -10000,7 +10000,7 @@ _LT_EOF
if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
else
- export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
fi
aix_use_runtimelinking=no
@@ -14486,7 +14486,7 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
else
- export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
fi
;;
pw32*)
@@ -15515,7 +15515,7 @@ done
# Common libraries that we need to link against for all sanitizer libs.
-link_sanitizer_common='-lpthread -ldl -lm'
+link_sanitizer_common='-lpthread -lm'
# At least for glibc, shm_open is in librt. But don't pull that
# in if it still doesn't give us the function we want. This
@@ -15561,6 +15561,48 @@ if test "x$ac_cv_lib_rt_shm_open" = x""yes; then :
fi
+# Do a configure time check for -ldl
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlsym in -ldl" >&5
+$as_echo_n "checking for dlsym in -ldl... " >&6; }
+if test "${ac_cv_lib_dl_dlsym+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlsym ();
+int
+main ()
+{
+return dlsym ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_dl_dlsym=yes
+else
+ ac_cv_lib_dl_dlsym=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlsym" >&5
+$as_echo "$ac_cv_lib_dl_dlsym" >&6; }
+if test "x$ac_cv_lib_dl_dlsym" = x""yes; then :
+ link_sanitizer_common="-ldl $link_sanitizer_common"
+fi
+
+
# Set up the set of additional libraries that we need to link against for libasan.
link_libasan=$link_sanitizer_common
diff --git a/libsanitizer/configure.ac b/libsanitizer/configure.ac
index 72b13a10367..063b1d64c25 100644
--- a/libsanitizer/configure.ac
+++ b/libsanitizer/configure.ac
@@ -96,7 +96,7 @@ AM_CONDITIONAL(LSAN_SUPPORTED, [test "x$LSAN_SUPPORTED" = "xyes"])
AC_CHECK_FUNCS(clock_getres clock_gettime clock_settime)
# Common libraries that we need to link against for all sanitizer libs.
-link_sanitizer_common='-lpthread -ldl -lm'
+link_sanitizer_common='-lpthread -lm'
# At least for glibc, shm_open is in librt. But don't pull that
# in if it still doesn't give us the function we want. This
@@ -104,6 +104,10 @@ link_sanitizer_common='-lpthread -ldl -lm'
AC_CHECK_LIB(rt, shm_open,
[link_sanitizer_common="-lrt $link_sanitizer_common"])
+# Do a configure time check for -ldl
+AC_CHECK_LIB(dl, dlsym,
+ [link_sanitizer_common="-ldl $link_sanitizer_common"])
+
# Set up the set of additional libraries that we need to link against for libasan.
link_libasan=$link_sanitizer_common
AC_SUBST(link_libasan)