[compiler-rt] [compiler-rt] Fix #83679 for macos sdk < 13.0 (PR #109946)

David CARLIER via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 25 03:08:15 PDT 2024


https://github.com/devnexen updated https://github.com/llvm/llvm-project/pull/109946

>From c6d2be479d3e2f8395e5304c89543ae40ae74ee2 Mon Sep 17 00:00:00 2001
From: David Carlier <devnexen at gmail.com>
Date: Wed, 25 Sep 2024 11:01:41 +0100
Subject: [PATCH] [compiler-rt] Fix #83679 for macos sdk < 13.0

---
 .../sanitizer_platform_interceptors.h                | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h b/compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h
index 05fa7e63268f26..4c354ef5b52c07 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h
@@ -526,9 +526,9 @@
 #define SANITIZER_INTERCEPT_READLINK SI_POSIX
 #if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && \
     __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 101000
-#define SI_MAC_DEPLOYMENT_BELOW_10_10 1
+#  define SI_MAC_DEPLOYMENT_BELOW_10_10 1
 #else
-#define SI_MAC_DEPLOYMENT_BELOW_10_10 0
+#  define SI_MAC_DEPLOYMENT_BELOW_10_10 0
 #endif
 #define SANITIZER_INTERCEPT_READLINKAT \
   (SI_POSIX && !SI_MAC_DEPLOYMENT_BELOW_10_10)
@@ -606,7 +606,13 @@
 // FIXME: also available from musl 1.2.5
 #define SANITIZER_INTERCEPT_PREADV2 (SI_LINUX && __GLIBC_PREREQ(2, 26))
 #define SANITIZER_INTERCEPT_PWRITEV2 (SI_LINUX && __GLIBC_PREREQ(2, 26))
-#define SANITIZER_INTERCEPT_FREADLINK SI_MAC
+#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && \
+    __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 130000
+#define SI_MAC_DEPLOYMENT_BELOW_13_00 1
+#else
+#define SI_MAC_DEPLOYMENT_BELOW_13_00 0
+#endif
+#define SANITIZER_INTERCEPT_FREADLINK (SI_MAC && !SI_MAC_DEPLOYMENT_BELOW_13_00)
 
 // This macro gives a way for downstream users to override the above
 // interceptor macros irrespective of the platform they are on. They have



More information about the llvm-commits mailing list