diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-11-23 00:31:54 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-11-23 00:31:54 +0000 |
commit | a96132f29aa3dfe94141a87537f62ea73ce0fc19 (patch) | |
tree | 339414cc4c7cfeb18efd639d3d7dc3f403afa560 /libsanitizer | |
parent | d5f11a61b373041e421ec38a5c014891b39d5693 (diff) | |
download | gcc-a96132f29aa3dfe94141a87537f62ea73ce0fc19.tar.gz |
* tsan/Makefile.am (AM_CXXFLAGS): Remove -Wno-variadic-macros.
* Makefile.am (SUBDIRS): Guard tsan addition with TSAN_SUPPORTED
automake conditional instead of !MULTISUBDIR32.
* configure.tgt: Set TSAN_SUPPORTED=yes for x86_64/i686-linux
for 64-bit multilib.
* configure.ac: Check for void * size, source in configure.tgt,
define TSAN_SUPPORTED conditional instead of MULTILIBDIR32.
* configure: Regenerated.
* Makefile.in: Regenerated.
* tsan/Makefile.in: Regenerated.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@193741 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libsanitizer')
-rw-r--r-- | libsanitizer/ChangeLog | 13 | ||||
-rw-r--r-- | libsanitizer/Makefile.am | 6 | ||||
-rw-r--r-- | libsanitizer/Makefile.in | 4 | ||||
-rwxr-xr-x | libsanitizer/configure | 241 | ||||
-rw-r--r-- | libsanitizer/configure.ac | 10 | ||||
-rw-r--r-- | libsanitizer/configure.tgt | 7 | ||||
-rw-r--r-- | libsanitizer/tsan/Makefile.am | 2 | ||||
-rw-r--r-- | libsanitizer/tsan/Makefile.in | 2 |
8 files changed, 263 insertions, 22 deletions
diff --git a/libsanitizer/ChangeLog b/libsanitizer/ChangeLog index 3d6bde32c49..ce59f906aaf 100644 --- a/libsanitizer/ChangeLog +++ b/libsanitizer/ChangeLog @@ -1,3 +1,16 @@ +2012-11-23 Jakub Jelinek <jakub@redhat.com> + + * tsan/Makefile.am (AM_CXXFLAGS): Remove -Wno-variadic-macros. + * Makefile.am (SUBDIRS): Guard tsan addition with TSAN_SUPPORTED + automake conditional instead of !MULTISUBDIR32. + * configure.tgt: Set TSAN_SUPPORTED=yes for x86_64/i686-linux + for 64-bit multilib. + * configure.ac: Check for void * size, source in configure.tgt, + define TSAN_SUPPORTED conditional instead of MULTILIBDIR32. + * configure: Regenerated. + * Makefile.in: Regenerated. + * tsan/Makefile.in: Regenerated. + 2012-11-22 Wei Mi <wmi@google.com> * tsan: New directory. Import tsan runtime from llvm. diff --git a/libsanitizer/Makefile.am b/libsanitizer/Makefile.am index d2192b2d38f..64d3d2eab9a 100644 --- a/libsanitizer/Makefile.am +++ b/libsanitizer/Makefile.am @@ -1,9 +1,9 @@ ACLOCAL_AMFLAGS = -I .. -I ../config -if MULTISUBDIR32 -SUBDIRS = interception sanitizer_common asan -else +if TSAN_SUPPORTED SUBDIRS = interception sanitizer_common asan tsan +else +SUBDIRS = interception sanitizer_common asan endif # Work around what appears to be a GNU make bug handling MAKEFLAGS diff --git a/libsanitizer/Makefile.in b/libsanitizer/Makefile.in index 09eb6e2897a..21c27113c38 100644 --- a/libsanitizer/Makefile.in +++ b/libsanitizer/Makefile.in @@ -244,8 +244,8 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ ACLOCAL_AMFLAGS = -I .. -I ../config -@MULTISUBDIR32_FALSE@SUBDIRS = interception sanitizer_common asan tsan -@MULTISUBDIR32_TRUE@SUBDIRS = interception sanitizer_common asan +@TSAN_SUPPORTED_FALSE@SUBDIRS = interception sanitizer_common asan +@TSAN_SUPPORTED_TRUE@SUBDIRS = interception sanitizer_common asan tsan # 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 519b1db8932..198a94d3272 100755 --- a/libsanitizer/configure +++ b/libsanitizer/configure @@ -604,8 +604,8 @@ ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS -MULTISUBDIR32_FALSE -MULTISUBDIR32_TRUE +TSAN_SUPPORTED_FALSE +TSAN_SUPPORTED_TRUE enable_static enable_shared CXXCPP @@ -1878,6 +1878,184 @@ fi return $ac_retval } # ac_fn_cxx_try_link + +# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES +# -------------------------------------------- +# Tries to find the compile-time value of EXPR in a program that includes +# INCLUDES, setting VAR accordingly. Returns whether the value could be +# computed +ac_fn_c_compute_int () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) >= 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_lo=0 ac_mid=0 + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_hi=$ac_mid; break +else + as_fn_arith $ac_mid + 1 && ac_lo=$as_val + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) < 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_hi=-1 ac_mid=-1 + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) >= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_lo=$ac_mid; break +else + as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + ac_lo= ac_hi= +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_hi=$ac_mid +else + as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in #(( +?*) eval "$3=\$ac_lo"; ac_retval=0 ;; +'') ac_retval=1 ;; +esac + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +static long int longval () { return $2; } +static unsigned long int ulongval () { return $2; } +#include <stdio.h> +#include <stdlib.h> +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + return 1; + if (($2) < 0) + { + long int i = longval (); + if (i != ($2)) + return 1; + fprintf (f, "%ld", i); + } + else + { + unsigned long int i = ulongval (); + if (i != ($2)) + return 1; + fprintf (f, "%lu", i); + } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + echo >>conftest.val; read $3 <conftest.val; ac_retval=0 +else + ac_retval=1 +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f conftest.val + + fi + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + return $ac_retval + +} # ac_fn_c_compute_int cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. @@ -10900,7 +11078,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 10903 "configure" +#line 11081 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11006,7 +11184,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11009 "configure" +#line 11187 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -14263,17 +14441,56 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of void *" >&5 +$as_echo_n "checking size of void *... " >&6; } +if test "${ac_cv_sizeof_void_p+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (void *))" "ac_cv_sizeof_void_p" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_void_p" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ as_fn_set_status 77 +as_fn_error "cannot compute sizeof (void *) +See \`config.log' for more details." "$LINENO" 5; }; } + else + ac_cv_sizeof_void_p=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_void_p" >&5 +$as_echo "$ac_cv_sizeof_void_p" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_VOID_P $ac_cv_sizeof_void_p +_ACEOF + + + if test "${multilib}" = "yes"; then multilib_arg="--enable-multilib" else multilib_arg= fi - if test "x$with_multisubdir" = "x32"; then - MULTISUBDIR32_TRUE= - MULTISUBDIR32_FALSE='#' + +# Get target configury. +unset TSAN_SUPPORTED +. ${srcdir}/configure.tgt + if test "x$TSAN_SUPPORTED" = "xyes"; then + TSAN_SUPPORTED_TRUE= + TSAN_SUPPORTED_FALSE='#' else - MULTISUBDIR32_TRUE='#' - MULTISUBDIR32_FALSE= + TSAN_SUPPORTED_TRUE='#' + TSAN_SUPPORTED_FALSE= fi @@ -14283,7 +14500,7 @@ ac_config_files="$ac_config_files Makefile" ac_config_files="$ac_config_files interception/Makefile sanitizer_common/Makefile asan/Makefile" -if test "x$with_multisubdir" != "x32"; then +if test "x$TSAN_SUPPORTED" = "xyes"; then ac_config_files="$ac_config_files tsan/Makefile" fi @@ -14449,8 +14666,8 @@ if test -z "${am__fastdepCCAS_TRUE}" && test -z "${am__fastdepCCAS_FALSE}"; then as_fn_error "conditional \"am__fastdepCCAS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${MULTISUBDIR32_TRUE}" && test -z "${MULTISUBDIR32_FALSE}"; then - as_fn_error "conditional \"MULTISUBDIR32\" was never defined. +if test -z "${TSAN_SUPPORTED_TRUE}" && test -z "${TSAN_SUPPORTED_FALSE}"; then + as_fn_error "conditional \"TSAN_SUPPORTED\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi diff --git a/libsanitizer/configure.ac b/libsanitizer/configure.ac index 0f9e185aa2a..45183db609f 100644 --- a/libsanitizer/configure.ac +++ b/libsanitizer/configure.ac @@ -67,12 +67,18 @@ AM_PROG_LIBTOOL AC_SUBST(enable_shared) AC_SUBST(enable_static) +AC_CHECK_SIZEOF([void *]) + if test "${multilib}" = "yes"; then multilib_arg="--enable-multilib" else multilib_arg= fi -AM_CONDITIONAL(MULTISUBDIR32, [test "x$with_multisubdir" = "x32"]) + +# Get target configury. +unset TSAN_SUPPORTED +. ${srcdir}/configure.tgt +AM_CONDITIONAL(TSAN_SUPPORTED, [test "x$TSAN_SUPPORTED" = "xyes"]) AC_CONFIG_FILES([Makefile]) @@ -89,7 +95,7 @@ _EOF AS_UNSET([ml_norecursion]) ]) -if test "x$with_multisubdir" != "x32"; then +if test "x$TSAN_SUPPORTED" = "xyes"; then AC_CONFIG_FILES(AC_FOREACH([DIR], [tsan], [DIR/Makefile ]), [cat > vpsed$$ << \_EOF s!`test -f '$<' || echo '$(srcdir)/'`!! diff --git a/libsanitizer/configure.tgt b/libsanitizer/configure.tgt index 988312ec95f..1506a20dab1 100644 --- a/libsanitizer/configure.tgt +++ b/libsanitizer/configure.tgt @@ -20,7 +20,12 @@ # Filter out unsupported systems. case "${target}" in - x86_64-*-linux* | i?86-*-linux* | sparc*-*-linux*) + x86_64-*-linux* | i?86-*-linux*) + if test x$ac_cv_sizeof_void_p = x8; then + TSAN_SUPPORTED=yes + fi + ;; + sparc*-*-linux*) ;; *) UNSUPPORTED=1 diff --git a/libsanitizer/tsan/Makefile.am b/libsanitizer/tsan/Makefile.am index 96b4fab8244..a307502c97a 100644 --- a/libsanitizer/tsan/Makefile.am +++ b/libsanitizer/tsan/Makefile.am @@ -1,7 +1,7 @@ AM_CPPFLAGS = -I $(top_srcdir) -I $(top_srcdir)/include DEFS = -D_GNU_SOURCE -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -AM_CXXFLAGS = -Wall -W -Wno-unused-parameter -Wwrite-strings -pedantic -Wno-long-long -fPIC -fno-builtin -fno-exceptions -fomit-frame-pointer -funwind-tables -fvisibility=hidden -Wno-variadic-macros -Wno-c99-extensions +AM_CXXFLAGS = -Wall -W -Wno-unused-parameter -Wwrite-strings -pedantic -Wno-long-long -fPIC -fno-builtin -fno-exceptions -fomit-frame-pointer -funwind-tables -fvisibility=hidden -Wno-variadic-macros ACLOCAL_AMFLAGS = -I m4 toolexeclib_LTLIBRARIES = libtsan.la diff --git a/libsanitizer/tsan/Makefile.in b/libsanitizer/tsan/Makefile.in index 71439d601aa..a893bccd5ef 100644 --- a/libsanitizer/tsan/Makefile.in +++ b/libsanitizer/tsan/Makefile.in @@ -238,7 +238,7 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CPPFLAGS = -I $(top_srcdir) -I $(top_srcdir)/include -AM_CXXFLAGS = -Wall -W -Wno-unused-parameter -Wwrite-strings -pedantic -Wno-long-long -fPIC -fno-builtin -fno-exceptions -fomit-frame-pointer -funwind-tables -fvisibility=hidden -Wno-variadic-macros -Wno-c99-extensions +AM_CXXFLAGS = -Wall -W -Wno-unused-parameter -Wwrite-strings -pedantic -Wno-long-long -fPIC -fno-builtin -fno-exceptions -fomit-frame-pointer -funwind-tables -fvisibility=hidden -Wno-variadic-macros ACLOCAL_AMFLAGS = -I m4 toolexeclib_LTLIBRARIES = libtsan.la tsan_files = \ |