[compiler-rt] [compiler-rt][asan] Force RTLD_GLOBAL for HSA/HIP/OpenCL runtime dlopen. (PR #201081)

Amit Kumar Pandey via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 4 02:59:26 PDT 2026


ampandey-1995 wrote:

> Why is this injected directly into `sanitizer_linux.cpp`? I don't think overriding everything to `RTLD_GLOBAL` is that desirable as well. 

This was done so as to have a common single dlopen call made by any of these libraries(  libamdhip64.so, libhsa-runtime64.so, or libamdocl64.so) to have global namespace for libhsa-runtime64(and other) symbols. ASan HSA Device backend can then initialize the hsa function pointers using only `dlsym(handle,...)` call as it was believed that first custom `dlopen()` call from ASan was thought to be expensive.

> The HSA layer should be the one calling dlopen with its own flags AFAICT.
Ok.


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


More information about the llvm-commits mailing list