re PR sanitizer/64839 (libsanitizer shouldn't require <rpc/xdr.h>)
authorYury Gribov <y.gribov@samsung.com>
Mon, 13 Apr 2015 08:59:55 +0000 (08:59 +0000)
committerYury Gribov <ygribov@gcc.gnu.org>
Mon, 13 Apr 2015 08:59:55 +0000 (08:59 +0000)
2015-04-13  Yury Gribov  <y.gribov@samsung.com>

PR sanitizer/64839

libsanitizer/
* sanitizer_common/sanitizer_platform.h: Cherry pick
upstream r234470.
* sanitizer_common/sanitizer_platform_limits_posix.cc: Ditto.
* configure.ac (RPC_DEFS): Check for precense of RPC headers.
* sanitizer_common/Makefile.am (DEFS): Pass info to compiler.
* Makefile.in: Regenerate.
* asan/Makefile.in: Regenerate.
* config.h.in: Regenerate.
* configure: Regenerate.
* interception/Makefile.in: Regenerate.
* libbacktrace/Makefile.in: Regenerate.
* lsan/Makefile.in: Regenerate.
* sanitizer_common/Makefile.in: Regenerate.
* tsan/Makefile.in: Regenerate.
* ubsan/Makefile.in: Regenerate.

From-SVN: r222043

15 files changed:
libsanitizer/ChangeLog
libsanitizer/Makefile.in
libsanitizer/asan/Makefile.in
libsanitizer/config.h.in
libsanitizer/configure
libsanitizer/configure.ac
libsanitizer/interception/Makefile.in
libsanitizer/libbacktrace/Makefile.in
libsanitizer/lsan/Makefile.in
libsanitizer/sanitizer_common/Makefile.am
libsanitizer/sanitizer_common/Makefile.in
libsanitizer/sanitizer_common/sanitizer_platform.h
libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc
libsanitizer/tsan/Makefile.in
libsanitizer/ubsan/Makefile.in

index 282afed1e3379443627be24baa0ee3c5b6ab3223..6f44dcf09ec96ea052a8982f6bddc3d91a9892da 100644 (file)
@@ -1,3 +1,23 @@
+2015-04-13  Yury Gribov  <y.gribov@samsung.com>
+
+       PR sanitizer/64839
+       * sanitizer_common/sanitizer_platform.h: Cherry pick
+       upstream r234470.
+       * sanitizer_common/sanitizer_platform_limits_posix.cc: Ditto.
+       * configure.ac (RPC_DEFS): Check for precense of RPC headers.
+       * sanitizer_common/Makefile.am (DEFS): Pass info to compiler.
+       * Makefile.in: Regenerate.
+       * asan/Makefile.in: Regenerate.
+       * config.h.in: Regenerate.
+       * configure: Regenerate.
+       * interception/Makefile.in: Regenerate.
+       * libbacktrace/Makefile.in: Regenerate.
+       * lsan/Makefile.in: Regenerate.
+       * sanitizer_common/Makefile.in: Regenerate.
+       * tsan/Makefile.in: Regenerate.
+       * ubsan/Makefile.in: Regenerate.
+
+
 2015-03-23  Christophe Lyon  <christophe.lyon@linaro.org>
 
        PR sanitizer/59009
index 79a1be686b6e2855bb3abf892589b4b2b736701c..2f5f1bd8ff9a1e98d8e623f33040db568ef38222 100644 (file)
@@ -181,6 +181,7 @@ PACKAGE_URL = @PACKAGE_URL@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 RANLIB = @RANLIB@
+RPC_DEFS = @RPC_DEFS@
 SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
index e61ceda7254854b7d26bce1329cf255fcd6c79b7..a56c6b14bbfed6d64c600740948f03d65007850c 100644 (file)
@@ -190,6 +190,7 @@ PACKAGE_URL = @PACKAGE_URL@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 RANLIB = @RANLIB@
+RPC_DEFS = @RPC_DEFS@
 SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
index e4b2786324efe480c0a26953201a4b6ca0fa80ba..7195840f2db182f8b42957097167a5befd7a689a 100644 (file)
@@ -43,6 +43,9 @@
 /* Define to 1 if you have the <memory.h> header file. */
 #undef HAVE_MEMORY_H
 
+/* Define to 1 if you have the <rpc/xdr.h> header file. */
+#undef HAVE_RPC_XDR_H
+
 /* Define to 1 if you have the <stdint.h> header file. */
 #undef HAVE_STDINT_H
 
@@ -67,6 +70,9 @@
 /* Define to 1 if you have the <sys/types.h> header file. */
 #undef HAVE_SYS_TYPES_H
 
+/* Define to 1 if you have the <tirpc/rpc/xdr.h> header file. */
+#undef HAVE_TIRPC_RPC_XDR_H
+
 /* Define to 1 if you have the <unistd.h> header file. */
 #undef HAVE_UNISTD_H
 
index 9ded4cc7782cf5dec6665c9796d39ba4aaf53777..1efbd5314afc8f40a064f84afe8e13a8d7baff26 100755 (executable)
@@ -607,6 +607,7 @@ LIBOBJS
 TSAN_TARGET_DEPENDENT_OBJECTS
 LIBBACKTRACE_SUPPORTED_FALSE
 LIBBACKTRACE_SUPPORTED_TRUE
+RPC_DEFS
 BACKTRACE_SUPPORTS_THREADS
 BACKTRACE_USES_MALLOC
 ALLOC_FILE
@@ -12021,7 +12022,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12024 "configure"
+#line 12025 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12127,7 +12128,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12130 "configure"
+#line 12131 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -16341,6 +16342,47 @@ $as_echo "#define HAVE_GETEXECNAME 1" >>confdefs.h
 
 fi
 
+# Check for rpc/xdr.h
+for ac_header in rpc/xdr.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "rpc/xdr.h" "ac_cv_header_rpc_xdr_h" "$ac_includes_default"
+if test "x$ac_cv_header_rpc_xdr_h" = x""yes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_RPC_XDR_H 1
+_ACEOF
+
+fi
+
+done
+
+if test x"$ac_cv_header_rpc_xdr_h" = xyes; then
+  rpc_defs="$rpc_defs -DHAVE_RPC_XDR_H=1"
+else
+  rpc_defs="$rpc_defs -DHAVE_RPC_XDR_H=0"
+fi
+
+# Check for tirpc/rpc/xdr.h
+for ac_header in tirpc/rpc/xdr.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "tirpc/rpc/xdr.h" "ac_cv_header_tirpc_rpc_xdr_h" "$ac_includes_default"
+if test "x$ac_cv_header_tirpc_rpc_xdr_h" = x""yes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_TIRPC_RPC_XDR_H 1
+_ACEOF
+
+fi
+
+done
+
+if test x"$ac_cv_header_tirpc_rpc_xdr_h" = xyes; then
+  rpc_defs="$rpc_defs -DHAVE_TIRPC_RPC_XDR_H=1"
+else
+  rpc_defs="$rpc_defs -DHAVE_TIRPC_RPC_XDR_H=0"
+fi
+
+RPC_DEFS=$rpc_defs
+
+
  if test "x${BACKTRACE_SUPPORTED}x${BACKTRACE_USES_MALLOC}" = "x1x0"; then
   LIBBACKTRACE_SUPPORTED_TRUE=
   LIBBACKTRACE_SUPPORTED_FALSE='#'
index 031c2710a82f6e7d35275b49410ff731f17c425d..11e2d9961d66f757ce75409fd9ea7f9ca64fd6af 100644 (file)
@@ -312,6 +312,24 @@ if test "$have_getexecname" = "yes"; then
   AC_DEFINE(HAVE_GETEXECNAME, 1, [Define if getexecname is available.])
 fi
 
+# Check for rpc/xdr.h
+AC_CHECK_HEADERS(rpc/xdr.h)
+if test x"$ac_cv_header_rpc_xdr_h" = xyes; then
+  rpc_defs="$rpc_defs -DHAVE_RPC_XDR_H=1"
+else
+  rpc_defs="$rpc_defs -DHAVE_RPC_XDR_H=0"
+fi
+
+# Check for tirpc/rpc/xdr.h
+AC_CHECK_HEADERS(tirpc/rpc/xdr.h)
+if test x"$ac_cv_header_tirpc_rpc_xdr_h" = xyes; then
+  rpc_defs="$rpc_defs -DHAVE_TIRPC_RPC_XDR_H=1"
+else
+  rpc_defs="$rpc_defs -DHAVE_TIRPC_RPC_XDR_H=0"
+fi
+
+AC_SUBST([RPC_DEFS], [$rpc_defs])
+
 AM_CONDITIONAL(LIBBACKTRACE_SUPPORTED,
               [test "x${BACKTRACE_SUPPORTED}x${BACKTRACE_USES_MALLOC}" = "x1x0"])
 
index 0e261b4266994027f31cb93bc6438ffd1d399cfb..5a49650758839c941b1588379440227e99eaf137 100644 (file)
@@ -146,6 +146,7 @@ PACKAGE_URL = @PACKAGE_URL@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 RANLIB = @RANLIB@
+RPC_DEFS = @RPC_DEFS@
 SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
index 7d2e2443e342aae8f6ea83c495e32c16f4e0e4dc..66d1962711c8e7fb56307fb105cb2d8cb7212931 100644 (file)
@@ -188,6 +188,7 @@ PACKAGE_URL = @PACKAGE_URL@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 RANLIB = @RANLIB@
+RPC_DEFS = @RPC_DEFS@
 SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
index 3ad44012e9f324453c372c8fff93eb5310eeeae3..49fa874946168061fe2b6e9fd19b3d0460cb1973 100644 (file)
@@ -181,6 +181,7 @@ PACKAGE_URL = @PACKAGE_URL@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 RANLIB = @RANLIB@
+RPC_DEFS = @RPC_DEFS@
 SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
index 28ce39b64c23be7dcde4509adba7d00605f8210d..d541717866b338ffc00b544046d7454f9677f35f 100644 (file)
@@ -3,7 +3,7 @@ AM_CPPFLAGS = -I $(top_srcdir)/include -isystem $(top_srcdir)/include/system
 # May be used by toolexeclibdir.
 gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER)
 
-DEFS = -D_GNU_SOURCE -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS 
+DEFS = -D_GNU_SOURCE -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS @RPC_DEFS@
 AM_CXXFLAGS = -Wall -W -Wno-unused-parameter -Wwrite-strings -pedantic -Wno-long-long  -fPIC -fno-builtin -fno-exceptions -fno-rtti -fomit-frame-pointer -funwind-tables -fvisibility=hidden -Wno-variadic-macros
 AM_CXXFLAGS += $(LIBSTDCXX_RAW_CXX_CXXFLAGS)
 AM_CXXFLAGS += -std=gnu++11
index 4a0e72762a6b4e810c3ab87b2fe3c71556d08ee6..77ad416defb3555c3dd86bc602d9b9907ffc9092 100644 (file)
@@ -129,7 +129,7 @@ CXXCPP = @CXXCPP@
 CXXDEPMODE = @CXXDEPMODE@
 CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
-DEFS = -D_GNU_SOURCE -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS 
+DEFS = -D_GNU_SOURCE -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS @RPC_DEFS@
 DEPDIR = @DEPDIR@
 DSYMUTIL = @DSYMUTIL@
 DUMPBIN = @DUMPBIN@
@@ -174,6 +174,7 @@ PACKAGE_URL = @PACKAGE_URL@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 RANLIB = @RANLIB@
+RPC_DEFS = @RPC_DEFS@
 SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
index 55bec90b08056657446d23333f42dbad779b8399..e0e740225e21a39a3069d9813ebcb1391eff7f83 100644 (file)
 # define SANITIZER_POINTER_FORMAT_LENGTH FIRST_32_SECOND_64(8, 12)
 #endif
 
+// Assume obsolete RPC headers are available by default
+#if !defined(HAVE_RPC_XDR_H) && !defined(HAVE_TIRPC_RPC_XDR_H)
+# define HAVE_RPC_XDR_H (SANITIZER_LINUX && !SANITIZER_ANDROID)
+# define HAVE_TIRPC_RPC_XDR_H 0
+#endif
+
 #endif // SANITIZER_PLATFORM_H
index 4971c4075bce10aa9ecf623a652bb2c052ea2d2b..2ef4ca22276e9ea67b6f983c1b4f10f4b98cbcab 100644 (file)
 #include <netax25/ax25.h>
 #include <netipx/ipx.h>
 #include <netrom/netrom.h>
-#include <rpc/xdr.h>
+#if HAVE_RPC_XDR_H
+# include <rpc/xdr.h>
+#elif HAVE_TIRPC_RPC_XDR_H
+# include <tirpc/rpc/xdr.h>
+#endif
 #include <scsi/scsi.h>
 #include <sys/mtio.h>
 #include <sys/kd.h>
@@ -1147,7 +1151,7 @@ CHECK_SIZE_AND_OFFSET(group, gr_passwd);
 CHECK_SIZE_AND_OFFSET(group, gr_gid);
 CHECK_SIZE_AND_OFFSET(group, gr_mem);
 
-#if SANITIZER_LINUX && !SANITIZER_ANDROID
+#if HAVE_RPC_XDR_H || HAVE_TIRPC_RPC_XDR_H
 CHECK_TYPE_SIZE(XDR);
 CHECK_SIZE_AND_OFFSET(XDR, x_op);
 CHECK_SIZE_AND_OFFSET(XDR, x_ops);
index c4e649008ecd74e05f9236772cd0bf0a96049153..ed594a6f63167e19dfc018036a117b73cfaa828a 100644 (file)
@@ -194,6 +194,7 @@ PACKAGE_URL = @PACKAGE_URL@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 RANLIB = @RANLIB@
+RPC_DEFS = @RPC_DEFS@
 SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
index e0f89148948e19f693829c3b7a2a478272b5fba3..0973a7a050e8556c5acffe98401c184855e82f30 100644 (file)
@@ -177,6 +177,7 @@ PACKAGE_URL = @PACKAGE_URL@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 RANLIB = @RANLIB@
+RPC_DEFS = @RPC_DEFS@
 SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@