[PATCH] D133165: [lld][COFF] Add support for overriding weak symbols in LLVM bitcode input

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 6 12:04:34 PDT 2022


rnk accepted this revision.
rnk added a comment.
This revision is now accepted and ready to land.

In D133165#3770165 <https://reviews.llvm.org/D133165#3770165>, @mstorsjo wrote:

> In D133165#3770117 <https://reviews.llvm.org/D133165#3770117>, @hans wrote:
>
>> I'm still curious how our non-ThinLTO builds worked. I assume there is some nuance to "COFF doesn't support weak symbols"?
>
> COFF does have weak aliases, and at least within the mingw/GNU ecosystem, there's ways that `__attribute__((weak))` is mapped to weak aliases, which mostly works to emulate ELF style weak symbols. Not sure if this is usable when building in MSVC mode or not - that could be what you've been using.

Yes, and I think it would be quite awkward for us to try to model bitcode weak symbols with weak aliases. This new flag seems like a better way, thanks!

lgtm


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D133165



More information about the llvm-commits mailing list