diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_mac.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_mac.cpp
index 3f8de8dd064a..e13a951ad420 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_mac.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_mac.cpp
@@ -124,6 +124,11 @@ extern "C" int __munmap(void *, size_t) SANITIZER_WEAK_ATTRIBUTE;
 
 // ---------------------- sanitizer_libc.h
 
+// https://github.com/apple/darwin-xnu/blob/main/osfmk/mach/kern_return.h
+#ifndef KERN_DENIED
+#define KERN_DENIED 83
+#endif
+
 // From <mach/vm_statistics.h>, but not on older OSs.
 #ifndef VM_MEMORY_SANITIZER
 #define VM_MEMORY_SANITIZER 99
