[clang] [profile] runtime counter relocation is needed on windows-msvc targets (PR #127858)

Martin Storsjö via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 11 08:25:19 PDT 2025


mstorsjo wrote:

Thanks for the very thorough explanation!

> Note if we miss a condition/configuration then it doesn't break the feature there, it just would [fail](https://github.com/llvm/llvm-project/blob/main/compiler-rt/lib/profile/InstrProfilingFile.c#L662) at runtime if you try enabling using this new clang option (-fprofile-continuous).

I see! With this, I was able to test the feature in a mingw configuration, and I do get `LLVM Profile Error: Neither __llvm_profile_counter_bias nor __llvm_profile_bitmap_bias is defined` at runtime there as well. If I modify the condition added by this patch to check `T.isOSWindows()` instead of `T.isKnownWindowsMSVCEnvironment()`, then it doesn't print any such error at runtime. So I believe this should be generalized to all of Windows (and/or generalized to check for a COFF object file format?) instead of singling out specifically MSVC only.



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


More information about the cfe-commits mailing list