From 1ff7c8bf0dd6ffe2003c754d81c0cd32ae95bbe4 Mon Sep 17 00:00:00 2001 From: Yi Kong Date: Thu, 21 Aug 2025 15:16:50 +0900 Subject: [PATCH] [compiler-rt] Fix musl build The change in PR #154268 introduced a dependency on the `__GLIBC_PREREQ` macro, which is not defined in musl libc. This caused the build to fail in environments using musl. This patch fixes the build by including `sanitizer_common/sanitizer_glibc_version.h`. This header provides a fallback definition for `__GLIBC_PREREQ` when LLVM is built against non-glibc C libraries, resolving the compilation error. --- compiler-rt/lib/tsan/dd/dd_interceptors.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/compiler-rt/lib/tsan/dd/dd_interceptors.cpp b/compiler-rt/lib/tsan/dd/dd_interceptors.cpp index 09d7cf1ccbaf..50531ea759a7 100644 --- a/compiler-rt/lib/tsan/dd/dd_interceptors.cpp +++ b/compiler-rt/lib/tsan/dd/dd_interceptors.cpp @@ -11,6 +11,7 @@ #include "dd_rtl.h" #include "interception/interception.h" #include "sanitizer_common/sanitizer_allocator_internal.h" +#include "sanitizer_common/sanitizer_glibc_version.h" #include "sanitizer_common/sanitizer_procmaps.h" using namespace __dsan;