summaryrefslogtreecommitdiffstats
path: root/libsanitizer
diff options
context:
space:
mode:
authorygribov <ygribov@138bc75d-0d04-0410-961f-82ee72b054a4>2014-01-23 14:32:05 +0000
committerygribov <ygribov@138bc75d-0d04-0410-961f-82ee72b054a4>2014-01-23 14:32:05 +0000
commite78a493b1cd63afcae3460c50d1023268e427c4a (patch)
tree4d075b27403ec43fc7f118adb0e459bdd3ad930b /libsanitizer
parentd6779b5fd64898e8c5235558a59dcd57c082469d (diff)
downloadppe42-gcc-e78a493b1cd63afcae3460c50d1023268e427c4a.tar.gz
ppe42-gcc-e78a493b1cd63afcae3460c50d1023268e427c4a.zip
2014-01-23 Yury Gribov <y.gribov@samsung.com>
Jakub Jelinek <jakub@redhat.com> PR sanitizer/57316 * configure.ac: Check for missing syscalls. * Makefile.am: Likewise. * configure: Regenerate. * Makefile.in: Regenerate. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@206966 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libsanitizer')
-rw-r--r--libsanitizer/ChangeLog9
-rw-r--r--libsanitizer/Makefile.am2
-rw-r--r--libsanitizer/Makefile.in11
-rwxr-xr-xlibsanitizer/configure51
-rw-r--r--libsanitizer/configure.ac18
5 files changed, 84 insertions, 7 deletions
diff --git a/libsanitizer/ChangeLog b/libsanitizer/ChangeLog
index 30a26bcd4ef..f4cc57f83f1 100644
--- a/libsanitizer/ChangeLog
+++ b/libsanitizer/ChangeLog
@@ -1,3 +1,12 @@
+2014-01-23 Yury Gribov <y.gribov@samsung.com>
+ Jakub Jelinek <jakub@redhat.com>
+
+ PR sanitizer/57316
+ * configure.ac: Check for missing syscalls.
+ * Makefile.am: Likewise.
+ * configure: Regenerate.
+ * Makefile.in: Regenerate.
+
2014-01-09 Jakub Jelinek <jakub@redhat.com>
* sanitizer_common/sanitizer_symbolizer_libbacktrace.h
diff --git a/libsanitizer/Makefile.am b/libsanitizer/Makefile.am
index a17f7b6af86..b0dc582ccfb 100644
--- a/libsanitizer/Makefile.am
+++ b/libsanitizer/Makefile.am
@@ -1,5 +1,6 @@
ACLOCAL_AMFLAGS = -I .. -I ../config
+if SANITIZER_SUPPORTED
SUBDIRS = sanitizer_common
if !USING_MAC_INTERPOSE
SUBDIRS += interception
@@ -11,6 +12,7 @@ SUBDIRS += lsan asan ubsan
if TSAN_SUPPORTED
SUBDIRS += tsan
endif
+endif
## May be used by toolexeclibdir.
gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER)
diff --git a/libsanitizer/Makefile.in b/libsanitizer/Makefile.in
index 5a33e0ec529..60cbe2ee554 100644
--- a/libsanitizer/Makefile.in
+++ b/libsanitizer/Makefile.in
@@ -35,9 +35,9 @@ POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
-@USING_MAC_INTERPOSE_FALSE@am__append_1 = interception
-@LIBBACKTRACE_SUPPORTED_TRUE@am__append_2 = libbacktrace
-@TSAN_SUPPORTED_TRUE@am__append_3 = tsan
+@SANITIZER_SUPPORTED_TRUE@@USING_MAC_INTERPOSE_FALSE@am__append_1 = interception
+@LIBBACKTRACE_SUPPORTED_TRUE@@SANITIZER_SUPPORTED_TRUE@am__append_2 = libbacktrace
+@SANITIZER_SUPPORTED_TRUE@@TSAN_SUPPORTED_TRUE@am__append_3 = tsan
subdir = .
DIST_COMMON = ChangeLog $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
$(top_srcdir)/configure $(am__configure_deps) \
@@ -250,8 +250,9 @@ top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
ACLOCAL_AMFLAGS = -I .. -I ../config
-SUBDIRS = sanitizer_common $(am__append_1) $(am__append_2) lsan asan \
- ubsan $(am__append_3)
+@SANITIZER_SUPPORTED_TRUE@SUBDIRS = sanitizer_common $(am__append_1) \
+@SANITIZER_SUPPORTED_TRUE@ $(am__append_2) lsan asan ubsan \
+@SANITIZER_SUPPORTED_TRUE@ $(am__append_3)
gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER)
# Work around what appears to be a GNU make bug handling MAKEFLAGS
diff --git a/libsanitizer/configure b/libsanitizer/configure
index c20735921ef..5e4840ffea4 100755
--- a/libsanitizer/configure
+++ b/libsanitizer/configure
@@ -612,6 +612,8 @@ ALLOC_FILE
VIEW_FILE
BACKTRACE_SUPPORTED
FORMAT_FILE
+SANITIZER_SUPPORTED_FALSE
+SANITIZER_SUPPORTED_TRUE
USING_MAC_INTERPOSE_FALSE
USING_MAC_INTERPOSE_TRUE
link_liblsan
@@ -12017,7 +12019,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 12020 "configure"
+#line 12022 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -12123,7 +12125,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 12126 "configure"
+#line 12128 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -15586,6 +15588,47 @@ fi
backtrace_supported=yes
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for necessary platform features" >&5
+$as_echo_n "checking for necessary platform features... " >&6; }
+case "$target" in
+ *-*-linux*)
+ # Some old Linux distributions miss required syscalls.
+ sanitizer_supported=no
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/syscall.h>
+int
+main ()
+{
+
+ syscall (__NR_gettid);
+ syscall (__NR_futex);
+ syscall (__NR_exit_group);
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ sanitizer_supported=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ;;
+ *)
+ sanitizer_supported=yes
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $sanitizer_supported" >&5
+$as_echo "$sanitizer_supported" >&6; }
+ if test "$sanitizer_supported" = yes; then
+ SANITIZER_SUPPORTED_TRUE=
+ SANITIZER_SUPPORTED_FALSE='#'
+else
+ SANITIZER_SUPPORTED_TRUE='#'
+ SANITIZER_SUPPORTED_FALSE=
+fi
+
+
# Test for __sync support.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking __sync extensions" >&5
$as_echo_n "checking __sync extensions... " >&6; }
@@ -16456,6 +16499,10 @@ if test -z "${USING_MAC_INTERPOSE_TRUE}" && test -z "${USING_MAC_INTERPOSE_FALSE
as_fn_error "conditional \"USING_MAC_INTERPOSE\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
+if test -z "${SANITIZER_SUPPORTED_TRUE}" && test -z "${SANITIZER_SUPPORTED_FALSE}"; then
+ as_fn_error "conditional \"SANITIZER_SUPPORTED\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
if test -z "${LIBBACKTRACE_SUPPORTED_TRUE}" && test -z "${LIBBACKTRACE_SUPPORTED_FALSE}"; then
as_fn_error "conditional \"LIBBACKTRACE_SUPPORTED\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
diff --git a/libsanitizer/configure.ac b/libsanitizer/configure.ac
index c4641d47286..e6721312d0c 100644
--- a/libsanitizer/configure.ac
+++ b/libsanitizer/configure.ac
@@ -132,6 +132,24 @@ AM_CONDITIONAL(USING_MAC_INTERPOSE, $MAC_INTERPOSE)
backtrace_supported=yes
+AC_MSG_CHECKING([for necessary platform features])
+case "$target" in
+ *-*-linux*)
+ # Some old Linux distributions miss required syscalls.
+ sanitizer_supported=no
+ AC_TRY_COMPILE([#include <sys/syscall.h>],[
+ syscall (__NR_gettid);
+ syscall (__NR_futex);
+ syscall (__NR_exit_group);
+ ], [sanitizer_supported=yes])
+ ;;
+ *)
+ sanitizer_supported=yes
+ ;;
+esac
+AC_MSG_RESULT($sanitizer_supported)
+AM_CONDITIONAL(SANITIZER_SUPPORTED, test "$sanitizer_supported" = yes)
+
# Test for __sync support.
AC_CACHE_CHECK([__sync extensions],
[libsanitizer_cv_sys_sync],
OpenPOWER on IntegriCloud