diff options
author | Jakub Jelinek <jakub@redhat.com> | 2013-11-29 13:30:36 +0100 |
---|---|---|
committer | Yury Gribov <ygribov@gcc.gnu.org> | 2013-11-29 12:30:36 +0000 |
commit | 35814b034651b543b2521f9bd028c35f1fcaac1a (patch) | |
tree | 0cc2ab434efd00fd5b66854aa66871625d4c011b /libsanitizer | |
parent | 08c5a7c685a97e0870fe278a1113523763b7af5f (diff) | |
download | gcc-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')
-rw-r--r-- | libsanitizer/ChangeLog | 21 | ||||
-rw-r--r-- | libsanitizer/Makefile.am | 2 | ||||
-rw-r--r-- | libsanitizer/Makefile.in | 78 | ||||
-rw-r--r-- | libsanitizer/asan/Makefile.am | 2 | ||||
-rw-r--r-- | libsanitizer/asan/Makefile.in | 6 | ||||
-rwxr-xr-x | libsanitizer/configure | 94 | ||||
-rw-r--r-- | libsanitizer/configure.ac | 35 | ||||
-rw-r--r-- | libsanitizer/interception/Makefile.in | 4 | ||||
-rw-r--r-- | libsanitizer/libsanitizer.spec.in | 11 | ||||
-rw-r--r-- | libsanitizer/lsan/Makefile.am | 2 | ||||
-rw-r--r-- | libsanitizer/lsan/Makefile.in | 6 | ||||
-rw-r--r-- | libsanitizer/sanitizer_common/Makefile.in | 4 | ||||
-rw-r--r-- | libsanitizer/tsan/Makefile.am | 2 | ||||
-rw-r--r-- | libsanitizer/tsan/Makefile.in | 6 | ||||
-rw-r--r-- | libsanitizer/ubsan/Makefile.am | 2 | ||||
-rw-r--r-- | libsanitizer/ubsan/Makefile.in | 6 |
16 files changed, 258 insertions, 23 deletions
diff --git a/libsanitizer/ChangeLog b/libsanitizer/ChangeLog index 028c521..8404d51 100644 --- a/libsanitizer/ChangeLog +++ b/libsanitizer/ChangeLog @@ -1,3 +1,24 @@ +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. + 2013-11-28 Jakub Jelinek <jakub@redhat.com> Yury Gribov <y.gribov@samsung.com> diff --git a/libsanitizer/Makefile.am b/libsanitizer/Makefile.am index 15c11ec..6c3e5b0 100644 --- a/libsanitizer/Makefile.am +++ b/libsanitizer/Makefile.am @@ -50,5 +50,7 @@ AM_MAKEFLAGS = \ MAKEOVERRIDES= +nodist_toolexeclib_HEADERS = libsanitizer.spec + ## ################################################################ diff --git a/libsanitizer/Makefile.in b/libsanitizer/Makefile.in index 47a8771..9424c59 100644 --- a/libsanitizer/Makefile.in +++ b/libsanitizer/Makefile.in @@ -14,6 +14,7 @@ # PARTICULAR PURPOSE. @SET_MAKE@ + VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ @@ -37,7 +38,7 @@ target_triplet = @target@ subdir = . DIST_COMMON = ChangeLog $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/configure $(am__configure_deps) \ - $(srcdir)/../mkinstalldirs + $(srcdir)/../mkinstalldirs $(srcdir)/libsanitizer.spec.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \ $(top_srcdir)/../config/depstand.m4 \ @@ -54,7 +55,7 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs -CONFIG_CLEAN_FILES = +CONFIG_CLEAN_FILES = libsanitizer.spec CONFIG_CLEAN_VPATH_FILES = SOURCES = MULTISRCTOP = @@ -70,6 +71,29 @@ RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__installdirs = "$(DESTDIR)$(toolexeclibdir)" +HEADERS = $(nodist_toolexeclib_HEADERS) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ @@ -183,6 +207,10 @@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ +link_libasan = @link_libasan@ +link_liblsan = @link_liblsan@ +link_libtsan = @link_libtsan@ +link_libubsan = @link_libubsan@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ @@ -252,6 +280,7 @@ AM_MAKEFLAGS = \ "DESTDIR=$(DESTDIR)" MAKEOVERRIDES = +nodist_toolexeclib_HEADERS = libsanitizer.spec all: all-recursive .SUFFIXES: @@ -289,6 +318,8 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): +libsanitizer.spec: $(top_builddir)/config.status $(srcdir)/libsanitizer.spec.in + cd $(top_builddir) && $(SHELL) ./config.status $@ mostlyclean-libtool: -rm -f *.lo @@ -315,6 +346,26 @@ distclean-multi: $(MULTICLEAN) $(AM_MAKEFLAGS) DO=distclean multi-clean # $(MAKE) maintainer-clean-multi: $(MULTICLEAN) $(AM_MAKEFLAGS) DO=maintainer-clean multi-clean # $(MAKE) +install-nodist_toolexeclibHEADERS: $(nodist_toolexeclib_HEADERS) + @$(NORMAL_INSTALL) + test -z "$(toolexeclibdir)" || $(MKDIR_P) "$(DESTDIR)$(toolexeclibdir)" + @list='$(nodist_toolexeclib_HEADERS)'; test -n "$(toolexeclibdir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(toolexeclibdir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(toolexeclibdir)" || exit $$?; \ + done + +uninstall-nodist_toolexeclibHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(nodist_toolexeclib_HEADERS)'; test -n "$(toolexeclibdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + test -n "$$files" || exit 0; \ + echo " ( cd '$(DESTDIR)$(toolexeclibdir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(toolexeclibdir)" && rm -f $$files # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. @@ -452,9 +503,12 @@ distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags check-am: all-am check: check-recursive -all-am: Makefile all-multi +all-am: Makefile all-multi $(HEADERS) installdirs: installdirs-recursive installdirs-am: + for dir in "$(DESTDIR)$(toolexeclibdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive @@ -508,7 +562,7 @@ install-dvi: install-dvi-recursive install-dvi-am: -install-exec-am: install-multi +install-exec-am: install-multi install-nodist_toolexeclibHEADERS install-html: install-html-recursive @@ -548,7 +602,7 @@ ps: ps-recursive ps-am: -uninstall-am: +uninstall-am: uninstall-nodist_toolexeclibHEADERS .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all-multi \ clean-multi ctags-recursive distclean-multi install-am \ @@ -563,12 +617,14 @@ uninstall-am: install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ - install-multi install-pdf install-pdf-am install-ps \ - install-ps-am install-strip installcheck installcheck-am \ - installdirs installdirs-am maintainer-clean \ - maintainer-clean-generic maintainer-clean-multi mostlyclean \ - mostlyclean-generic mostlyclean-libtool mostlyclean-multi pdf \ - pdf-am ps ps-am tags tags-recursive uninstall uninstall-am + install-multi install-nodist_toolexeclibHEADERS install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs installdirs-am \ + maintainer-clean maintainer-clean-generic \ + maintainer-clean-multi mostlyclean mostlyclean-generic \ + mostlyclean-libtool mostlyclean-multi pdf pdf-am ps ps-am tags \ + tags-recursive uninstall uninstall-am \ + uninstall-nodist_toolexeclibHEADERS # Tell versions [3.59,3.63) of GNU make to not export all variables. diff --git a/libsanitizer/asan/Makefile.am b/libsanitizer/asan/Makefile.am index 0e1ee11..58defae 100644 --- a/libsanitizer/asan/Makefile.am +++ b/libsanitizer/asan/Makefile.am @@ -43,7 +43,7 @@ libasan_la_LIBADD = $(top_builddir)/sanitizer_common/libsanitizer_common.la $(to endif libasan_la_LIBADD += $(LIBSTDCXX_RAW_CXX_LDFLAGS) -libasan_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` -lpthread -ldl +libasan_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(link_libasan) libasan_preinit.o: asan_preinit.o cp $< $@ diff --git a/libsanitizer/asan/Makefile.in b/libsanitizer/asan/Makefile.in index c604474..e86d7b5 100644 --- a/libsanitizer/asan/Makefile.in +++ b/libsanitizer/asan/Makefile.in @@ -224,6 +224,10 @@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ +link_libasan = @link_libasan@ +link_liblsan = @link_liblsan@ +link_libtsan = @link_libtsan@ +link_libubsan = @link_libubsan@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ @@ -289,7 +293,7 @@ libasan_la_SOURCES = $(asan_files) @USING_MAC_INTERPOSE_TRUE@libasan_la_LIBADD = $(top_builddir)/sanitizer_common/libsanitizer_common.la \ @USING_MAC_INTERPOSE_TRUE@ $(top_builddir)/lsan/libsanitizer_lsan.la \ @USING_MAC_INTERPOSE_TRUE@ $(LIBSTDCXX_RAW_CXX_LDFLAGS) -libasan_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` -lpthread -ldl +libasan_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(link_libasan) # Work around what appears to be a GNU make bug handling MAKEFLAGS # values defined in terms of make variables, as is the case for CC and diff --git a/libsanitizer/configure b/libsanitizer/configure index 22f7fee..e5c3206 100755 --- a/libsanitizer/configure +++ b/libsanitizer/configure @@ -606,6 +606,10 @@ LTLIBOBJS LIBOBJS USING_MAC_INTERPOSE_FALSE USING_MAC_INTERPOSE_TRUE +link_liblsan +link_libubsan +link_libtsan +link_libasan LSAN_SUPPORTED_FALSE LSAN_SUPPORTED_TRUE TSAN_SUPPORTED_FALSE @@ -11119,7 +11123,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11122 "configure" +#line 11126 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11225,7 +11229,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11228 "configure" +#line 11232 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -14544,6 +14548,89 @@ else fi +# Check for functions needed. +for ac_func in clock_getres clock_gettime clock_settime +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +eval as_val=\$$as_ac_var + if test "x$as_val" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + +# 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 + + +# Set up the set of additional libraries that we need to link against for libtsan. +link_libtsan=$link_sanitizer_common + + +# Set up the set of additional libraries that we need to link against for libubsan. +link_libubsan=$link_sanitizer_common + + +# Set up the set of additional libraries that we need to link against for liblsan. +link_liblsan=$link_sanitizer_common + + +# 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 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clock_gettime in -lrt" >&5 +$as_echo_n "checking for clock_gettime in -lrt... " >&6; } +if test "${ac_cv_lib_rt_clock_gettime+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lrt $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 clock_gettime (); +int +main () +{ +return clock_gettime (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_rt_clock_gettime=yes +else + ac_cv_lib_rt_clock_gettime=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_rt_clock_gettime" >&5 +$as_echo "$ac_cv_lib_rt_clock_gettime" >&6; } +if test "x$ac_cv_lib_rt_clock_gettime" = x""yes; then : + link_libasan="-lrt $link_libasan" +link_libtsan="-lrt $link_libtsan" +# Other sanitizers do not override clock_* API + +fi + +fi + case "$host" in *-*-darwin*) MAC_INTERPOSE=true ; enable_static=no ;; *) MAC_INTERPOSE=false ;; @@ -14557,7 +14644,7 @@ else fi -ac_config_files="$ac_config_files Makefile" +ac_config_files="$ac_config_files Makefile libsanitizer.spec" ac_config_files="$ac_config_files interception/Makefile sanitizer_common/Makefile lsan/Makefile asan/Makefile ubsan/Makefile" @@ -15692,6 +15779,7 @@ do "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "libsanitizer.spec") CONFIG_FILES="$CONFIG_FILES libsanitizer.spec" ;; "interception/Makefile") CONFIG_FILES="$CONFIG_FILES interception/Makefile" ;; "sanitizer_common/Makefile") CONFIG_FILES="$CONFIG_FILES sanitizer_common/Makefile" ;; "lsan/Makefile") CONFIG_FILES="$CONFIG_FILES lsan/Makefile" ;; 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 diff --git a/libsanitizer/interception/Makefile.in b/libsanitizer/interception/Makefile.in index f3a2f41..52a06d6 100644 --- a/libsanitizer/interception/Makefile.in +++ b/libsanitizer/interception/Makefile.in @@ -181,6 +181,10 @@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ +link_libasan = @link_libasan@ +link_liblsan = @link_liblsan@ +link_libtsan = @link_libtsan@ +link_libubsan = @link_libubsan@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ diff --git a/libsanitizer/libsanitizer.spec.in b/libsanitizer/libsanitizer.spec.in new file mode 100644 index 0000000..a4fa87d --- /dev/null +++ b/libsanitizer/libsanitizer.spec.in @@ -0,0 +1,11 @@ +# This spec file is read by gcc when linking. It is used to specify the +# standard libraries we need in order to link with various sanitizer libs. + +*link_libasan: @link_libasan@ + +*link_libtsan: @link_libtsan@ + +*link_libubsan: @link_libubsan@ + +*link_liblsan: @link_liblsan@ + diff --git a/libsanitizer/lsan/Makefile.am b/libsanitizer/lsan/Makefile.am index a312c1c..36fd605 100644 --- a/libsanitizer/lsan/Makefile.am +++ b/libsanitizer/lsan/Makefile.am @@ -28,7 +28,7 @@ libsanitizer_lsan_la_SOURCES = $(sanitizer_lsan_files) liblsan_la_SOURCES = $(lsan_files) liblsan_la_LIBADD = $(top_builddir)/sanitizer_common/libsanitizer_common.la $(top_builddir)/interception/libinterception.la $(LIBSTDCXX_RAW_CXX_LDFLAGS) -liblsan_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` -lpthread -ldl +liblsan_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(link_liblsan) # Work around what appears to be a GNU make bug handling MAKEFLAGS # values defined in terms of make variables, as is the case for CC and diff --git a/libsanitizer/lsan/Makefile.in b/libsanitizer/lsan/Makefile.in index f094661..9296b70 100644 --- a/libsanitizer/lsan/Makefile.in +++ b/libsanitizer/lsan/Makefile.in @@ -215,6 +215,10 @@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ +link_libasan = @link_libasan@ +link_liblsan = @link_liblsan@ +link_libtsan = @link_libtsan@ +link_libubsan = @link_libubsan@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ @@ -265,7 +269,7 @@ lsan_files = \ libsanitizer_lsan_la_SOURCES = $(sanitizer_lsan_files) liblsan_la_SOURCES = $(lsan_files) liblsan_la_LIBADD = $(top_builddir)/sanitizer_common/libsanitizer_common.la $(top_builddir)/interception/libinterception.la $(LIBSTDCXX_RAW_CXX_LDFLAGS) -liblsan_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` -lpthread -ldl +liblsan_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(link_liblsan) # Work around what appears to be a GNU make bug handling MAKEFLAGS # values defined in terms of make variables, as is the case for CC and diff --git a/libsanitizer/sanitizer_common/Makefile.in b/libsanitizer/sanitizer_common/Makefile.in index b544653..9bbdfd6 100644 --- a/libsanitizer/sanitizer_common/Makefile.in +++ b/libsanitizer/sanitizer_common/Makefile.in @@ -192,6 +192,10 @@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ +link_libasan = @link_libasan@ +link_liblsan = @link_liblsan@ +link_libtsan = @link_libtsan@ +link_libubsan = @link_libubsan@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ diff --git a/libsanitizer/tsan/Makefile.am b/libsanitizer/tsan/Makefile.am index 6fc4d0e..9b039d2 100644 --- a/libsanitizer/tsan/Makefile.am +++ b/libsanitizer/tsan/Makefile.am @@ -39,7 +39,7 @@ tsan_files = \ libtsan_la_SOURCES = $(tsan_files) libtsan_la_LIBADD = $(top_builddir)/sanitizer_common/libsanitizer_common.la $(top_builddir)/interception/libinterception.la $(LIBSTDCXX_RAW_CXX_LDFLAGS) -libtsan_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` -lpthread -ldl +libtsan_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(link_libtsan) # Work around what appears to be a GNU make bug handling MAKEFLAGS # values defined in terms of make variables, as is the case for CC and diff --git a/libsanitizer/tsan/Makefile.in b/libsanitizer/tsan/Makefile.in index bac430b..eb5c7e7 100644 --- a/libsanitizer/tsan/Makefile.in +++ b/libsanitizer/tsan/Makefile.in @@ -231,6 +231,10 @@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ +link_libasan = @link_libasan@ +link_liblsan = @link_liblsan@ +link_libtsan = @link_libtsan@ +link_libubsan = @link_libubsan@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ @@ -295,7 +299,7 @@ tsan_files = \ libtsan_la_SOURCES = $(tsan_files) libtsan_la_LIBADD = $(top_builddir)/sanitizer_common/libsanitizer_common.la $(top_builddir)/interception/libinterception.la $(LIBSTDCXX_RAW_CXX_LDFLAGS) -libtsan_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` -lpthread -ldl +libtsan_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(link_libtsan) # Work around what appears to be a GNU make bug handling MAKEFLAGS # values defined in terms of make variables, as is the case for CC and diff --git a/libsanitizer/ubsan/Makefile.am b/libsanitizer/ubsan/Makefile.am index ce94eaa..24e405b 100644 --- a/libsanitizer/ubsan/Makefile.am +++ b/libsanitizer/ubsan/Makefile.am @@ -23,7 +23,7 @@ if !USING_MAC_INTERPOSE libubsan_la_LIBADD += $(top_builddir)/interception/libinterception.la endif libubsan_la_LIBADD += $(LIBSTDCXX_RAW_CXX_LDFLAGS) -libubsan_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` -lpthread -ldl +libubsan_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(link_libubsan) # Use special rules for files that require RTTI support. ubsan_handlers_cxx.% ubsan_type_hash.% : AM_CXXFLAGS += -frtti diff --git a/libsanitizer/ubsan/Makefile.in b/libsanitizer/ubsan/Makefile.in index 3148358..dcb04c7 100644 --- a/libsanitizer/ubsan/Makefile.in +++ b/libsanitizer/ubsan/Makefile.in @@ -210,6 +210,10 @@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ +link_libasan = @link_libasan@ +link_liblsan = @link_liblsan@ +link_libtsan = @link_libtsan@ +link_libubsan = @link_libubsan@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ @@ -256,7 +260,7 @@ libubsan_la_SOURCES = $(ubsan_files) libubsan_la_LIBADD = \ $(top_builddir)/sanitizer_common/libsanitizer_common.la \ $(am__append_1) $(LIBSTDCXX_RAW_CXX_LDFLAGS) -libubsan_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` -lpthread -ldl +libubsan_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(link_libubsan) # Work around what appears to be a GNU make bug handling MAKEFLAGS # values defined in terms of make variables, as is the case for CC and |