[clang] [OpenMP][ASan][Driver] Update build steps for OpenMP ASan. (PR #179636)

Amit Kumar Pandey via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 24 05:24:35 PDT 2026


================
@@ -367,6 +368,25 @@ RocmInstallationDetector::RocmInstallationDetector(
 
   if (DetectHIPRuntime)
     detectHIPRuntime();
+  if (DetectOpenMPRuntime)
+    detectOpenMPRuntime();
+}
+
+void RocmInstallationDetector::detectOpenMPRuntime() {
+  assert(OpenMPASanRTLPath.empty());
+  // Set OpenMP ASan library directory path for pre-instrumented device
+  // libraries (e.g., libompdevice.a). This path is used when linking with
+  // -fsanitize=address for OpenMP offloading.
+  OpenMPASanRTLPath = llvm::sys::path::parent_path(D.Dir);
+  llvm::sys::path::append(OpenMPASanRTLPath, "lib", "asan");
----------------
ampandey-1995 wrote:

For AMD-ASan any runtime library component under `llvm-project` which is to be instrumented  always have the installation path `*llvm/lib/asan`. 

Hi @b-sumner is that correct?

All the AMD-ASan instrumented openmp, offload etc  libraries are installed under path `*llvm/lib/asan` which is to follow a common design and user has to set up only single path in env var `LD_LIBRARY_PATH`.

https://github.com/llvm/llvm-project/pull/179636


More information about the cfe-commits mailing list