aboutsummaryrefslogtreecommitdiff
path: root/libsanitizer/configure.ac
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2013-11-29 13:30:36 +0100
committerYury Gribov <ygribov@gcc.gnu.org>2013-11-29 12:30:36 +0000
commit35814b034651b543b2521f9bd028c35f1fcaac1a (patch)
tree0cc2ab434efd00fd5b66854aa66871625d4c011b /libsanitizer/configure.ac
parent08c5a7c685a97e0870fe278a1113523763b7af5f (diff)
downloadgcc-35814b034651b543b2521f9bd028c35f1fcaac1a.zip
gcc-35814b034651b543b2521f9bd028c35f1fcaac1a.tar.gz
gcc-35814b034651b543b2521f9bd028c35f1fcaac1a.tar.bz2
re PR sanitizer/59063 (ASAN: segfault in __interceptor_clock_gettime)
gcc/ 2013-11-29 Jakub Jelinek <jakub@redhat.com> Yury Gribov <y.gribov@samsung.com> PR sanitizer/59063 * config/gnu-user.h: Removed old code for setting up sanitizer libs. * gcc.c: Using libsanitizer spec instead of explicit libs. gcc/testsuite/ 2013-11-29 Jakub Jelinek <jakub@redhat.com> Yury Gribov <y.gribov@samsung.com> PR sanitizer/59063 * c-c++-common/asan/pr59063-1.c: New test. * c-c++-common/asan/pr59063-2.c: Likewise. * lib/asan-dg.exp: Add path to libsanitizer.spec to cflags. * lib/ubsan-dg.exp: Likewise. libsanitizer/ 2013-11-29 Jakub Jelinek <jakub@redhat.com> Yury Gribov <y.gribov@samsung.com> PR sanitizer/59063 * libsanitizer.spec.in: Add spec file to hold link flags for various sanitizer libs. * configure.ac: Check whether clock_* routines come from librt. * asan/Makefile.am (libasan_la_LDFLAGS): Libs now come from configure.ac. * tsan/Makefile.am (libtsan_la_LDFLAGS): Likewise. * ubsan/Makefile.am (libubsan_la_LDFLAGS): Likewise. * lsan/Makefile.am (liblsan_la_LDFLAGS): Likewise. * asan/Makefile.in: Regenerate. * interception/Makefile.in: Regenerate. * lsan/Makefile.in: Regenerate. * sanitizer_common/Makefile.in: Regenerate. * tsan/Makefile.in: Regenerate. * ubsan/Makefile.in: Regenerate. * Makefile.in: Regenerate. * configure: Regenerate. Co-Authored-By: Yury Gribov <y.gribov@samsung.com> From-SVN: r205524
Diffstat (limited to 'libsanitizer/configure.ac')
-rw-r--r--libsanitizer/configure.ac35
1 files changed, 34 insertions, 1 deletions
diff --git a/libsanitizer/configure.ac b/libsanitizer/configure.ac
index f769fdb..7f93279 100644
--- a/libsanitizer/configure.ac
+++ b/libsanitizer/configure.ac
@@ -83,13 +83,46 @@ unset LSAN_SUPPORTED
AM_CONDITIONAL(TSAN_SUPPORTED, [test "x$TSAN_SUPPORTED" = "xyes"])
AM_CONDITIONAL(LSAN_SUPPORTED, [test "x$LSAN_SUPPORTED" = "xyes"])
+# Check for functions needed.
+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'
+
+# Set up the set of additional libraries that we need to link against for libasan.
+link_libasan=$link_sanitizer_common
+AC_SUBST(link_libasan)
+
+# Set up the set of additional libraries that we need to link against for libtsan.
+link_libtsan=$link_sanitizer_common
+AC_SUBST(link_libtsan)
+
+# Set up the set of additional libraries that we need to link against for libubsan.
+link_libubsan=$link_sanitizer_common
+AC_SUBST(link_libubsan)
+
+# Set up the set of additional libraries that we need to link against for liblsan.
+link_liblsan=$link_sanitizer_common
+AC_SUBST(link_liblsan)
+
+# At least for glibc, clock_gettime is in librt. But don't pull that
+# in if it still doesn't give us the function we want. This
+# test is copied from libgomp.
+if test $ac_cv_func_clock_gettime = no; then
+ AC_CHECK_LIB(rt, clock_gettime,
+ [link_libasan="-lrt $link_libasan"
+link_libtsan="-lrt $link_libtsan"
+# Other sanitizers do not override clock_* API
+])
+fi
+
case "$host" in
*-*-darwin*) MAC_INTERPOSE=true ; enable_static=no ;;
*) MAC_INTERPOSE=false ;;
esac
AM_CONDITIONAL(USING_MAC_INTERPOSE, $MAC_INTERPOSE)
-AC_CONFIG_FILES([Makefile])
+AC_CONFIG_FILES([Makefile libsanitizer.spec])
AC_CONFIG_FILES(AC_FOREACH([DIR], [interception sanitizer_common lsan asan ubsan], [DIR/Makefile ]),
[cat > vpsed$$ << \_EOF