diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc index e2fb94fc6876..6ffd26d9f1ce 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc +++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc @@ -762,7 +762,12 @@ namespace __sanitizer { unsigned IOCTL_TIOCSSERIAL = TIOCSSERIAL; #endif +// EOWNERDEAD is not present in some older platforms. +#if defined(EOWNERDEAD) extern const int errno_EOWNERDEAD = EOWNERDEAD; +#else + extern const int errno_EOWNERDEAD = -1; +#endif } // namespace __sanitizer COMPILER_CHECK(sizeof(__sanitizer_pthread_attr_t) >= sizeof(pthread_attr_t));