[PATCH] D60931: [builtins] Use aliases for function redirects

Petr Hosek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 25 12:35:57 PDT 2019


phosek added a comment.

In D60931#1476367 <https://reviews.llvm.org/D60931#1476367>, @rnk wrote:

> In D60931#1473456 <https://reviews.llvm.org/D60931#1473456>, @mstorsjo wrote:
>
> > However, the alias mechanism used for MSVC, alternatename directives, doesn't quite work the right way for compiler-rt. If the object file containing the alternatename directive hasn't been brought in by some other symbol, the linker won't find the alias symbol at all.
> >
> > Normally, I would presume that compiler-rt builtins aren't used in MSVC style builds though, but I'm not sure if we want to exclude them outright either. Reid, do you have opinions or creative ideas? (Afaik, the gnu alias attribute will work with clang-cl, but not with MSVC proper.)
>
>
> The best alternative to `/alternatename:` that I could find is `/export:fn1=fn2`, but it suffers from the same problem: `fn1` isn't in the symbol table, so it won't be found if the object is in an archive. I'm surprised MSVC doesn't have a way to do this, since it's quite representable in COFF.
>
> I think you're right, none of these aliases are needed on Windows. They are all for aebi compat or libgcc compat. Maybe the best thing to do would be to define the macro to nothing in the `defined(_WIN32)` case.


Done


Repository:
  rCRT Compiler Runtime

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

https://reviews.llvm.org/D60931





More information about the llvm-commits mailing list