[PATCH] D108095: [profile] Don't use pragma comment linker on mingw

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 15 15:17:22 PDT 2021


mstorsjo added a comment.

In D108095#2945822 <https://reviews.llvm.org/D108095#2945822>, @mstorsjo wrote:

> In D108095#2945817 <https://reviews.llvm.org/D108095#2945817>, @mstorsjo wrote:
>
>> FWIW, when using lld as linker in a mingw setting, it does support those embedded directives, but ld.bfd doesn't indeed. We do use those extensions in compiler-rt's sanitizers though, and have been doing that for a couple years. I guess those are considered unsupported when building with GCC.
>>
>> In this case, we'd lose the weak linked symbol altogether in mingw configurations. I'm not familiar with the profiler library so I don't know exactly how big a feature this loses though... Alternatively this could maybe use a regular `__attribute__((weak))` symbol in mingw configurations, which both GCC and Clang, ld.bfd and lld might support.
>
> Oh, now I see there actually is such an `#else` codepath here. I guess that'd work yes. I don't have any continuous testing setup that uses the profiling library though so I won't know immediately if it broke or not.
>
> Btw, to understand your setup - you're building compiler-rt/profile as part of building clang, via e.g. `LLVM_ENABLE_PROJECTS` (so it ends up being built with the existing host compiler, GCC) but then compile code using the clang and using the newly built compiler-rt/profile library with the newly built clang?

Sorry, I’m a bit slow today: I presume the situation is that this setup used to work fine, when doing profiled builds with clang, when linking with ld.bfd - but now it no longer does. But sanitizers have always required that they (the compiler-rt code) are built with clang (e.g. with LLVM_ENABLE_RUNTIMES, or entirely manually/separately) and linked with lld.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D108095/new/

https://reviews.llvm.org/D108095



More information about the llvm-commits mailing list