Skip to content

Forward declare OSSpinLockLock on MacOS since it's not shipped on the system. #101392

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 31, 2024

Conversation

aemerson
Copy link
Contributor

Fixes build errors on some SDKs.

rdar://132607572

… system.

Fixes build errors on some SDKs.

rdar://132607572
@llvmbot
Copy link
Member

llvmbot commented Jul 31, 2024

@llvm/pr-subscribers-compiler-rt-sanitizer

Author: Amara Emerson (aemerson)

Changes

Fixes build errors on some SDKs.

rdar://132607572


Full diff: https://github.com/llvm/llvm-project/pull/101392.diff

1 Files Affected:

  • (modified) compiler-rt/lib/rtsan/rtsan_interceptors.cpp (+12)
diff --git a/compiler-rt/lib/rtsan/rtsan_interceptors.cpp b/compiler-rt/lib/rtsan/rtsan_interceptors.cpp
index 3a65f9d3f779d..e8e7bdf17d822 100644
--- a/compiler-rt/lib/rtsan/rtsan_interceptors.cpp
+++ b/compiler-rt/lib/rtsan/rtsan_interceptors.cpp
@@ -17,6 +17,18 @@
 #include "rtsan/rtsan_context.h"
 
 #if SANITIZER_APPLE
+
+#if TARGET_OS_MAC
+// On MacOS OSSpinLockLock is deprecated and no longer present in the headers,
+// but the symbol still exists on the system. Forward declare here so we
+// don't get compilation errors.
+#include <stdint.h>
+extern "C" {
+typedef int32_t OSSpinLock;
+void OSSpinLockLock(volatile OSSpinLock *__lock);
+}
+#endif
+
 #include <libkern/OSAtomic.h>
 #include <os/lock.h>
 #endif

@aemerson
Copy link
Contributor Author

This fix was approved offline by @dougsonos

@aemerson aemerson merged commit 3a4c7cc into llvm:main Jul 31, 2024
9 checks passed
@aemerson
Copy link
Contributor Author

/cherry-pick 3a4c7cc

@aemerson
Copy link
Contributor Author

But let's wait for post-commit builders to ok this before we merge to rel branch.

llvmbot pushed a commit to llvmbot/llvm-project that referenced this pull request Jul 31, 2024
… system. (llvm#101392)

Fixes build errors on some SDKs.

rdar://132607572
(cherry picked from commit 3a4c7cc)
@llvmbot
Copy link
Member

llvmbot commented Jul 31, 2024

/pull-request #101432

@aemerson aemerson deleted the co2-main branch August 1, 2024 16:41
tru pushed a commit to llvmbot/llvm-project that referenced this pull request Aug 5, 2024
… system. (llvm#101392)

Fixes build errors on some SDKs.

rdar://132607572
(cherry picked from commit 3a4c7cc)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

2 participants