================
@@ -631,6 +631,20 @@ void amdgpu::Linker::ConstructJob(Compilation &C, const
JobAction &JA,
Args.getLastArgValue(options::OPT_mcpu_EQ))));
}
addLinkerCompressDebugSectionsOption(getToolChain(), Args, CmdArgs);
+
+ // ASan instrumented OpenMP+Offload libraries are installed in default ROCm
+ // LLVM ASan custom path.
+ // Below code prepends the LLVM ASan custom path to pick ASan instrumented
+ // libompdevice.a.
+ const SanitizerArgs &SanArgs = getToolChain().getSanitizerArgs(Args);
+ if (SanArgs.needsAsanRt()) {
+ const AMDGPUToolChain &AMDGPU =
+ static_cast<const AMDGPUToolChain &>(getToolChain());
+ StringRef ASanPath = Args.MakeArgString(
+ AMDGPU.getRocmInstallationPath().str() + "/lib/llvm/lib/asan");
----------------
shiltian wrote:
The OpenMP library is unfortunately not an amdgcn one. Ideally we want to move
`amdgcn/bitcode` to `llvm/lib/amdgcn`, but that would require a lot of changes,
testings, etc. And it will for sure break a huge amount of ROCm components
because most of them have pretty much hard coded path like this.
https://github.com/llvm/llvm-project/pull/179636
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits