[llvm] [IR] Use EXPORTAS for ARM64EC mangled symbols with dllexport attribute. (PR #81940)

Jacek Caban via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 19 16:24:55 PST 2024


cjacek wrote:

I can reproduce the inconsistency. In fact, it's already there: for LTO we use demangled names, while for the regular compilation we use mangled ones. In practice, this is fine with the linker as it will resolve demangled name from generated aliases, but it differs from the regular build.

I'm not sure what would be the best way to use EXPORTAS in that case. I was thinking about predicting that demangled functions will get mangled later anyway and mangling them using `getArm64ECMangledFunctionName` here anyway. Doing that in `emitLinkerFlagsForGlobalCOFF` somewhat works, but maybe this would be better done in `getNameWithPrefix` to cover other cases.

BTW, simple LTO cases seem to work with my WIP branch implementing ARM64EC in LLD (https://github.com/cjacek/llvm-project/commits/arm64ec). Hacking use of EXPORTAS as I described above actually makes it not work, because then linker doesn't know that bitcode will eventually expose ARM64EC symbols. This seems to be a more general problem, I didn't really look deeper at it yet as I'd like to get basics right first. It's likely that the fix should be in LLD, but possibly not only.

I think that a FIXME comment is best for now, I will add one.

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


More information about the llvm-commits mailing list