[llvm] Use thinlto and pgo for x86_64 windows release packaging (PR #71067)

Martin Storsjö via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 15 12:22:23 PST 2023


mstorsjo wrote:

> IIUC, you want to remove such mangled name prefix when using profile from x64 but targeting to windows i386.

My primary usecase would be to profile on x86_64 Linux, and apply this profile when I cross-build binaries for Windows i386. (The symbol names should mostly match without other tricks when cross building binaries for Windows for other architectures.)

The same mechanism would help if profiling on x86_64 Windows and using the profile for a build for Windows i386 as well, or profiling on Linux but using the profile on macOS, or vice versa as well.

> I'm not sure about this. @xur-llvm might know this. BTW, what's the extra symbol prefix? Is it prefixed to all symbol on Windows i386?

Almost, yes. On macOS, essentially all extern symbols have an extra underscore at the start. On Windows i386, all cdecl symbols have an extra underscore at the start as well. MSVC C++ ABI symbols don't have such an extra underscore on i386 though. But the Itanium ABI/name mangling used in MinGW should be essentially the same as on other Itanium platforms, modulo an extra leading underscore. And the same goes for Linux<->macOS.

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


More information about the llvm-commits mailing list