[compiler-rt] [llvm] [PGO][AMDGPU] Add basic HIP offload PGO support (PR #177665)
Yaxun Liu via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 9 07:46:53 PDT 2026
================
@@ -9,19 +9,68 @@
// This file is a part of AddressSanitizer, an address sanity checker.
//
// Linux-specific interception methods.
+//
+// POSIX dynamic-library helpers (dlopen / dlsym) live here for every
+// non-Windows interception target (Linux, *BSD, Darwin, AIX, Fuchsia, …).
+// macOS/AIX/Fuchsia compile this TU for RTInterception but do not use the
+// Linux-specific InterceptFunction helpers below.
//===----------------------------------------------------------------------===//
#include "interception.h"
+#if !SANITIZER_WINDOWS
+
+# include <dlfcn.h>
+
+# pragma weak dlopen
+# pragma weak dlsym
+# pragma weak dlvsym
+
+namespace __interception {
+
+bool DynamicLoaderAvailable() { return dlopen != nullptr && dlsym != nullptr; }
+
+void* OpenLibrary(const char* name) {
----------------
yxsamliu wrote:
interception’s existing public APIs here are already PascalCase (e.g. InterceptFunction, OverrideFunction), so we matched that local style
https://github.com/llvm/llvm-project/pull/177665
More information about the llvm-commits
mailing list