[compiler-rt] 28800c2 - [sanitizer] Use consistent checks for XDR
Ian Anderson via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 20 22:28:22 PDT 2022
Author: Ian Anderson
Date: 2022-07-20T22:28:07-07:00
New Revision: 28800c2e18972935cd4f942aa428c5e6cc4c1670
URL: https://github.com/llvm/llvm-project/commit/28800c2e18972935cd4f942aa428c5e6cc4c1670
DIFF: https://github.com/llvm/llvm-project/commit/28800c2e18972935cd4f942aa428c5e6cc4c1670.diff
LOG: [sanitizer] Use consistent checks for XDR
sanitizer_platform_limits_posix.h defines `__sanitizer_XDR ` if `SANITIZER_LINUX && !SANITIZER_ANDROID`, but sanitizer_platform_limits_posix.cpp tries to check it if `HAVE_RPC_XDR_H`. This coincidentally works because macOS has a broken <rpc/xdr.h> which causes `HAVE_RPC_XDR_H` to be 0, but if <rpc/xdr.h> is fixed then clang fails to compile on macOS. Restore the platform checks so that <rpc/xdr.h> can be fixed on macOS.
Reviewed By: vitalybuka
Differential Revision: https://reviews.llvm.org/D130060
Added:
Modified:
compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
Removed:
################################################################################
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
index 235250261fec..c85cf1626a75 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
@@ -1275,7 +1275,7 @@ CHECK_SIZE_AND_OFFSET(group, gr_passwd);
CHECK_SIZE_AND_OFFSET(group, gr_gid);
CHECK_SIZE_AND_OFFSET(group, gr_mem);
-#if HAVE_RPC_XDR_H
+#if HAVE_RPC_XDR_H && !SANITIZER_APPLE
CHECK_TYPE_SIZE(XDR);
CHECK_SIZE_AND_OFFSET(XDR, x_op);
CHECK_SIZE_AND_OFFSET(XDR, x_ops);
More information about the llvm-commits
mailing list