summaryrefslogtreecommitdiffstats
path: root/libsanitizer/configure.ac
diff options
context:
space:
mode:
authorygribov <ygribov@138bc75d-0d04-0410-961f-82ee72b054a4>2013-11-29 12:30:36 +0000
committerygribov <ygribov@138bc75d-0d04-0410-961f-82ee72b054a4>2013-11-29 12:30:36 +0000
commit30ded303d62935b0b8a4c79e7552844603090078 (patch)
tree0cc2ab434efd00fd5b66854aa66871625d4c011b /libsanitizer/configure.ac
parentd71a185d8f18d2d98654994b031360962c238d47 (diff)
downloadppe42-gcc-30ded303d62935b0b8a4c79e7552844603090078.tar.gz
ppe42-gcc-30ded303d62935b0b8a4c79e7552844603090078.zip
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@205524 138bc75d-0d04-0410-961f-82ee72b054a4
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 f769fdb030c..7f9327904da 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
OpenPOWER on IntegriCloud