Clang/LLVM 13 and PE exported symbol limits #9765
Replies: 8 comments 39 replies
-
A third option that I thought of, but don't know how practical it would be, would be to split libLLVM into multiple DLLs ( |
Beta Was this translation helpful? Give feedback.
-
It looks like @mstorsjo only enables AArch64, arm, and X86 targets in his scripts: https://github.com/mstorsjo/llvm-mingw/blob/378525eb9b72a7deacdde084356926724238e231/build-llvm.sh#L235. Also looks like he uses DYLIB by default, unless explicitly asked not to. |
Beta Was this translation helpful? Give feedback.
-
I was able to expand the number of targets while still coming in under 65535 exports (CLANG32 came in at 64249). The list I came up with is AArch64;AMDGPU;ARM;AVR;BPF;Mips;MSP430;NVPTX;RISCV;WebAssembly;X86. It might be better to list what isn't present from the default list:
|
Beta Was this translation helpful? Give feedback.
-
As an update, I later had to disable MIPS too, as rebuilding llvm 13 with clang/llvm 13 resulted in even more exported symbols |
Beta Was this translation helpful? Give feedback.
-
Why add targets other than X86/WebAssembly? Msys2 don't support other platforms, and it seems that no one will do cross-compile under msys2. And it make programs that statically link with libclang very big (90M+), because clang_createIndex (in libclang) uses llvm::InitializeAllTargets(), and it depends all compiled llvm targets. |
Beta Was this translation helpful? Give feedback.
-
Bad News! |
Beta Was this translation helpful? Give feedback.
-
New bad News!
I don't know what to do with MLIR? |
Beta Was this translation helpful? Give feedback.
-
While preparing the update to mingw-w64-clang (really LLVM) 13.0.0, it failed to link libLLVM-13.dll due to:
This limit is due to the PE/COFF format using a 16-bit integer as in index into the export tables (IIUC). There are only a couple of options to get around this:
Either of these options is probably going to negatively impact somebody, so I thought it would be a good idea to open a discussion to see if there's a consensus on what would be the least-bad option here, and to see if there are any suggestions to adjust the list of targets for option 2.
Package size comparison
(the net upgrade size is from 12.0.1, and most of that on the dynamically-linked side is from the new package "mlir"). Unfortunately the other MSYSTEMs hit the 6 hour GHA limit while packaging/compressing.
MINGW64
Statically linked (with all default targets) (built locally)
Packages (13) mingw-w64-x86_64-clang-13.0.0-1 mingw-w64-x86_64-clang-analyzer-13.0.0-1 mingw-w64-x86_64-clang-tools-extra-13.0.0-1 mingw-w64-x86_64-compiler-rt-13.0.0-1 mingw-w64-x86_64-libc++-13.0.0-1 mingw-w64-x86_64-libc++abi-13.0.0-1 mingw-w64-x86_64-libunwind-13.0.0-1 mingw-w64-x86_64-lld-13.0.0-1 mingw-w64-x86_64-lldb-13.0.0-1 mingw-w64-x86_64-llvm-13.0.0-1 mingw-w64-x86_64-mlir-13.0.0-1 mingw-w64-x86_64-openmp-13.0.0-1 mingw-w64-x86_64-polly-13.0.0-1
CLANG32
Dynamically linked (with fewer targets)
Packages (13) mingw-w64-clang-i686-clang-13.0.0-1 mingw-w64-clang-i686-clang-analyzer-13.0.0-1 mingw-w64-clang-i686-clang-tools-extra-13.0.0-1 mingw-w64-clang-i686-compiler-rt-13.0.0-1 mingw-w64-clang-i686-libc++-13.0.0-1 mingw-w64-clang-i686-libc++abi-13.0.0-1 mingw-w64-clang-i686-libunwind-13.0.0-1 mingw-w64-clang-i686-lld-13.0.0-1 mingw-w64-clang-i686-lldb-13.0.0-1 mingw-w64-clang-i686-llvm-13.0.0-1 mingw-w64-clang-i686-mlir-13.0.0-1 mingw-w64-clang-i686-openmp-13.0.0-1 mingw-w64-clang-i686-polly-13.0.0-1
Statically linked (with all default targets)
Packages (13) mingw-w64-clang-i686-clang-13.0.0-1 mingw-w64-clang-i686-clang-analyzer-13.0.0-1 mingw-w64-clang-i686-clang-tools-extra-13.0.0-1 mingw-w64-clang-i686-compiler-rt-13.0.0-1 mingw-w64-clang-i686-libc++-13.0.0-1 mingw-w64-clang-i686-libc++abi-13.0.0-1 mingw-w64-clang-i686-libunwind-13.0.0-1 mingw-w64-clang-i686-lld-13.0.0-1 mingw-w64-clang-i686-lldb-13.0.0-1 mingw-w64-clang-i686-llvm-13.0.0-1 mingw-w64-clang-i686-mlir-13.0.0-1 mingw-w64-clang-i686-openmp-13.0.0-1 mingw-w64-clang-i686-polly-13.0.0-1
Beta Was this translation helpful? Give feedback.
All reactions