[PATCH] D133107: [COFF] Don't generate -exclude-symbols for dllexported symbols
Martin Storsjö via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 1 11:55:02 PDT 2022
mstorsjo added a comment.
In D133107#3764655 <https://reviews.llvm.org/D133107#3764655>, @MaskRay wrote:
> This looks somewhat weird. How does a symbol end up with `hidden dllexport`? In other object file formats (ELF, Mach-O) this can't happen, since a hidden symbol cannot be exported.
It can happen if you build with e.g. `-fvisibility=hidden`, coupled with source that have `__declspec(dllexport)` for the symbols that should be exported.
Consider a project that has been built with `-fvisibility=hidden` traditionally (which has had no effect at all on windows targets, up until a month ago). Such a project would have e.g. an `EXPORT` define for symbols that should be exported. For windows, it expands to `__declspec(dllexport)` while it expands to `__attribute__((visibility(“default”)))` on other OSes.
So in one sense, I guess one could say that `dllexport` should imply default visibility on the clang level too.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D133107/new/
https://reviews.llvm.org/D133107
More information about the llvm-commits
mailing list