[PATCH] [ASan] Only include rpc headers if they are available.

Yury Gribov tetra2005 at gmail.com
Mon Mar 30 02:29:41 PDT 2015


Hi kcc, samsonov,

See bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64839 for more information.

REPOSITORY
  rL LLVM

http://reviews.llvm.org/D8698

Files:
  CMakeLists.txt
  lib/sanitizer_common/sanitizer_platform_limits_posix.cc

Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -180,6 +180,8 @@
 #================================
 include(CheckIncludeFile)
 check_include_file(unwind.h HAVE_UNWIND_H)
+check_include_file(rpc/xdr.h HAVE_RPC_XDR_H)
+check_include_file(tirpc/rpc/xdr.h HAVE_TIRPC_XDR_H)
 
 include(config-ix)
 
Index: lib/sanitizer_common/sanitizer_platform_limits_posix.cc
===================================================================
--- lib/sanitizer_common/sanitizer_platform_limits_posix.cc
+++ lib/sanitizer_common/sanitizer_platform_limits_posix.cc
@@ -135,7 +135,11 @@
 #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_XDR_H
+# include <tirpc/rpc/xdr.h>
+#endif
 #include <scsi/scsi.h>
 #include <sys/mtio.h>
 #include <sys/kd.h>
@@ -1159,7 +1163,8 @@
 CHECK_SIZE_AND_OFFSET(group, gr_gid);
 CHECK_SIZE_AND_OFFSET(group, gr_mem);
 
-#if SANITIZER_LINUX && !SANITIZER_ANDROID
+#if SANITIZER_LINUX && !SANITIZER_ANDROID && \
+    (HAVE_RPC_XDR_H || HAVE_TIRPC_XDR_H)
 CHECK_TYPE_SIZE(XDR);
 CHECK_SIZE_AND_OFFSET(XDR, x_op);
 CHECK_SIZE_AND_OFFSET(XDR, x_ops);

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D8698.22870.patch
Type: text/x-patch
Size: 1253 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150330/9ac23e79/attachment.bin>


More information about the llvm-commits mailing list