Describe the bug
makeTargetSymbolTable() in clang/lib/Driver/OffloadBundler.cpp excludes sanitizer-internal
globals from the .tgtsym section using exact name comparison:
https://github.com/intel/llvm/blob/sycl/clang/lib/Driver/OffloadBundler.cpp#L755-L761
if (SF->isIR() &&
(Name == "llvm.used" || Name == "llvm.compiler.used" ||
Name == "__AsanDeviceGlobalMetadata" ||
Name == "__MsanDeviceGlobalMetadata" ||
Name == "__TsanDeviceGlobalMetadata" ||
Name == "__AsanKernelMetadata" || Name == "__MsanKernelMetadata" ||
Name == "__TsanKernelMetadata"))
continue;
This filter was added by #17399 ("Skip adding device sanitizers internal variable to bundler
symbol table") with the stated rationale that these "are sanitizer internal variables, and
should not be bundled to the symbol table."
Commit 0941896 (#22567, "[DeviceSanitizer] Make sanitizer metadata globals per-module
unique") renamed all six of these globals to carry a per-module unique id suffix:
- AddressSanitizer.cpp:1511 — ("_AsanKernelMetadata" + computeMetadataUniqueId(M)).str()
- AddressSanitizer.cpp:3133 — ("_AsanDeviceGlobalMetadata" + ...)
- MemorySanitizer.cpp:1314 — ("_MsanKernelMetadata" + ...)
- MemorySanitizer.cpp:1076 — ("_MsanDeviceGlobalMetadata" + ...)
- ThreadSanitizer.cpp:727 — ("_TsanKernelMetadata" + ...)
- ThreadSanitizer.cpp:556 — ("_TsanDeviceGlobalMetadata" + ...)
#22567 did not update OffloadBundler.cpp, so the exact comparisons no longer match and these
globals are now emitted into .tgtsym, contrary to #17399's intent.
To reproduce
Environment
No response
Additional context
No response
Describe the bug
makeTargetSymbolTable()inclang/lib/Driver/OffloadBundler.cppexcludes sanitizer-internalglobals from the
.tgtsymsection using exact name comparison:https://github.com/intel/llvm/blob/sycl/clang/lib/Driver/OffloadBundler.cpp#L755-L761
This filter was added by #17399 ("Skip adding device sanitizers internal variable to bundler
symbol table") with the stated rationale that these "are sanitizer internal variables, and
should not be bundled to the symbol table."
Commit 0941896 (#22567, "[DeviceSanitizer] Make sanitizer metadata globals per-module
unique") renamed all six of these globals to carry a per-module unique id suffix:
#22567 did not update OffloadBundler.cpp, so the exact comparisons no longer match and these
globals are now emitted into .tgtsym, contrary to #17399's intent.
To reproduce
Environment
No response
Additional context
No response