This allows users of static libraries (such as ubsan) to link without knowing about this transitive dependency, if using the psapi functions that require linking to a separate psapi library. Since Windows 7, these functions (EnumProcessModules, GetModuleInformation, GetProcessMemoryInfo) are remapped to K32- prefixed ones, available in kernel32.dll.
Details
Diff Detail
Event Timeline
lib/sanitizer_common/sanitizer_win.cc | ||
---|---|---|
34 | This distinction between library names (psapi.lib vs libpsapi.a) needs to be taken care of at some level; either here, in clang or in lld. I'm including it in all patches, to easier compare where the logic fits the best. For MinGW, this pragma/directive requires compiling with -fms-extensions, and ld.bfd doesn't support defaultlib in embedded directives (but the sanitizers in general require a number of other features missing in ld.bfd already). |
lib/sanitizer_common/sanitizer_win.cc | ||
---|---|---|
34 | If this is only targeting LLD, then I'd prefer to just use the basename "psapi" version and continue forward with making LLD search for .a files in addition to .lib files. |
This distinction between library names (psapi.lib vs libpsapi.a) needs to be taken care of at some level; either here, in clang or in lld. I'm including it in all patches, to easier compare where the logic fits the best.
For MinGW, this pragma/directive requires compiling with -fms-extensions, and ld.bfd doesn't support defaultlib in embedded directives (but the sanitizers in general require a number of other features missing in ld.bfd already).