'How to build debug version of llvm linker from source?
Background: I want to make some small modifications to lld, the llvm linker (specifically, to the WebAssembly version wasm-ld). I have implemented a WebAssembly interpreter on a smart card, and I want to be able to compile and link C programs for it. Some modifications are required; a smart card has two distinct types of memory, transient and persistent (or RAM and Flash), and I want the data sections that are present in the object files to be instantiated as two different memory items in the executable.
So I want to be able to debug wasm-ld, because it is a little complicated :-/
Problem: I can build wasm-ld from source, but when I try to build a debug version, it fails on a particular source file, because one of the object files is too big.
I am using MinGW for Windows. My configuration command is:
cmake -DCMAKE_BUILD_TYPE=Debug -DLLVM_ENABLE_PROJECTS=libcxxabi;libcxx;libunwind;lld
-G Ninja -DCMAKE_CXX_FLAGS="-D_WIN32_WINNT=0x601 -D_LIBCPP_HAS_THREAD_API_EXTERNAL=1" ../llvm
And the error message is (deep breath):
[2410/2592] Building CXX object lib/Passes/CMakeFiles/LLVMPasses.dir/PassBuilder.cpp.obj FAILED: lib/Passes/CMakeFiles/LLVMPasses.dir/PassBuilder.cpp.obj C:\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin\c++.exe -DGTEST_HAS_RTTI=0 -D_FILE_OFFSET_B ITS=64 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -ID:/clang/build/lib/Pass es -ID:/clang/llvm/lib/Passes -ID:/clang/build/include -ID:/clang/llvm/include -D_WIN32_WINNT=0x601 -D _LIBCPP_HAS_THREAD_API_EXTERNAL=1 -Wa,-mbig-obj -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallth rough -Wno-maybe-uninitialized -Wno-class-memaccess -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wno- comment -Wmisleading-indentation -g -fno-exceptions -fno-rtti -std=c++14 -MD -MT lib/Passes/CMakeFile s/LLVMPasses.dir/PassBuilder.cpp.obj -MF lib\Passes\CMakeFiles\LLVMPasses.dir\PassBuilder.cpp.obj.d -o lib/Passes/CMakeFiles/LLVMPasses.dir/PassBuilder.cpp.obj -c D:/clang/llvm/lib/Passes/PassBuilder.cpp C:/mingw-w64/x86_64-8.1.0-posix-seh-rt_v6-rev0/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../. ./../x86_64-w64-mingw32/bin/as.exe: lib/Passes/CMakeFiles/LLVMPasses.dir/PassBuilder.cpp.obj: section .pdata$_ZN4llvm6detail17getAnalysisResultINS_27PassInstrumentationAnalysisENS_4LoopEJRNS_27LoopStandar dAnalysisResultsEEJS5_RNS_10LPMUpdaterEEEENT_6ResultERNS_15AnalysisManagerIT0_JDpT1_EEERSB_St5tupleIJD pT2_EE: string table overflow at offset 10000104 C:\Users\Tony\AppData\Local\Temp\ccXD93Jo.s: Assembler messages: C:\Users\Tony\AppData\Local\Temp\ccXD93Jo.s: Fatal error: can't close lib/Passes/CMakeFiles/LLVMPasses .dir/PassBuilder.cpp.obj: File too big [2411/2592] Linking CXX static library lib\libLLVMAnalysis.a ninja: build stopped: subcommand failed.
The important bit here is:
Fatal error: can't close lib/Passes/CMakeFiles/LLVMPasses .dir/PassBuilder.cpp.obj: File too big
Has anybody met this problem? Does anybody have any suggestions to get this thing built? I don't need debug information for PassBuilder.cpp. How can I convery this to CMake or Ninja? (Please don't tell me to switch to MSVC...)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
