[compiler-rt] [llvm] [compiler-rt] Hide dlvsym call behind appropriate guards (PR #191440)

via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 10 08:07:21 PDT 2026


https://github.com/google-yfyang updated https://github.com/llvm/llvm-project/pull/191440

>From d85ec3cb5e7de9a8a6d4bdc6ba5ff1bd4c6237c6 Mon Sep 17 00:00:00 2001
From: google-yfyang <yfyang at google.com>
Date: Fri, 10 Apr 2026 10:02:18 -0400
Subject: [PATCH 1/2] Fix Bazel build issue with ##190862

---
 utils/bazel/llvm-project-overlay/llvm/BUILD.bazel | 1 +
 1 file changed, 1 insertion(+)

diff --git a/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel b/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel
index ce866a4ac0e3a..170a7214292c6 100644
--- a/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel
@@ -5935,6 +5935,7 @@ cc_binary(
     deps = [
         ":AllTargetsCodeGens",
         ":AllTargetsDisassemblers",
+        ":BinaryFormat",
         ":Core",
         ":DebugInfoDWARF",
         ":DebugInfoPDB",

>From af550ce91bdc9847378f8c447016c8dfea5ca166 Mon Sep 17 00:00:00 2001
From: google-yfyang <yfyang at google.com>
Date: Fri, 10 Apr 2026 10:59:04 -0400
Subject: [PATCH 2/2] [compiler-rt] Address dlvsym not found compilation error
 when targeting incompatible platforms

---
 compiler-rt/lib/interception/interception_linux.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/compiler-rt/lib/interception/interception_linux.cpp b/compiler-rt/lib/interception/interception_linux.cpp
index f2c959d2d05c6..c997cc452256a 100644
--- a/compiler-rt/lib/interception/interception_linux.cpp
+++ b/compiler-rt/lib/interception/interception_linux.cpp
@@ -54,11 +54,13 @@ void* LookupSymbolNext(const char* symbol) {
   return dlsym(RTLD_NEXT, symbol);
 }
 
+#if SANITIZER_GLIBC || SANITIZER_FREEBSD || SANITIZER_NETBSD
 void* LookupSymbolNextVersioned(const char* symbol, const char* version) {
   if (!DynamicLoaderAvailable() || dlvsym == nullptr)
     return nullptr;
   return dlvsym(RTLD_NEXT, symbol, version);
 }
+#endif  // SANITIZER_GLIBC || SANITIZER_FREEBSD || SANITIZER_NETBSD
 
 }  // namespace __interception
 



More information about the llvm-commits mailing list