Forward declare OSSpinLockLock on MacOS since it's not shipped on the system.#101392
Merged
Forward declare OSSpinLockLock on MacOS since it's not shipped on the system.#101392
Conversation
… system. Fixes build errors on some SDKs. rdar://132607572
Member
|
@llvm/pr-subscribers-compiler-rt-sanitizer Author: Amara Emerson (aemerson) ChangesFixes build errors on some SDKs. rdar://132607572 Full diff: https://github.com/llvm/llvm-project/pull/101392.diff 1 Files Affected:
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
|
Contributor
Author
|
This fix was approved offline by @dougsonos |
Contributor
Author
|
/cherry-pick 3a4c7cc |
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)
Member
|
/pull-request #101432 |
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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes build errors on some SDKs.
rdar://132607572