Cosmin Apreutesei via llvm-dev
2019-Jun-21 10:55 UTC
[llvm-dev] "Export ordinal too large" when linking LLVM.dll with MinGW64
Hi, Trying to build llvm.dll (8.0.0) with mingw64 (gcc 8.1.0) using cmake. After linking for hours and consuming some 7GB of RAM, ld.exe finally bails out with: X:/tools/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: Error: export ordinal too large: 283482 The command I used is: cmake \ -DLLVM_TARGETS_TO_BUILD=X86 \ -DCMAKE_BUILD_TYPE=Debug \ -DLLVM_LINK_LLVM_DYLIB=ON \ -DLLVM_BUILD_TOOLS=OFF \ -DCMAKE_SHARED_LINKER_FLAGS="-t" \ -DCMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS="-t" \ -G "MinGW Makefiles" Am I doing something wrong? Did anyone managed to get a LLVM.dll with this toolchain?
Cosmin Apreutesei via llvm-dev
2019-Jun-22 09:19 UTC
[llvm-dev] "Export ordinal too large" when linking LLVM.dll with MinGW64
Update: looks like the the problem was that the cmake script in tools/llvm-shlib was set to export all symbols instead of just the C symbols, and those are way too many (max is 65535). Changing tools\llvm-shlib\simple_version_script.map.in to read "LLVM_8 { global: LLVM*; local: *; };" fixed it for me and now I have a dll.
Valentin Churavy via llvm-dev
2019-Aug-14 20:00 UTC
[llvm-dev] "Export ordinal too large" when linking LLVM.dll with MinGW64
Just ran into the same problem, but with `-DLLVM_BUILD_TOOLS=ON` since the tools link against shlib and use the C++ interface I can't use Cosmin's solution. I managed to get through with using `RelWithDebInfo` instead of `Debug` On Sat, Jun 22, 2019 at 5:20 AM Cosmin Apreutesei via llvm-dev < llvm-dev at lists.llvm.org> wrote:> Update: looks like the the problem was that the cmake script in > tools/llvm-shlib was set to export all symbols instead of just the C > symbols, and those are way too many (max is 65535). > > Changing tools\llvm-shlib\simple_version_script.map.in to read "LLVM_8 > { global: LLVM*; local: *; };" fixed it for me and now I have a dll. > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190814/549484ea/attachment.html>
Apparently Analagous Threads
- "Export ordinal too large" when linking LLVM.dll with MinGW64
- Help Building LLVM for Android
- [LLVMdev] buildbot failure in LLVM on clang-native-mingw64-win7
- [LLVMdev] MingGW32 and MinGW64 builds (Windows) fail
- [PATCH][git-pull] win64/find-mingw64.sh: Debian/Ubuntu