lld does not compile
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
[lld_at_master_fail_to_compile.tar.gz](https://github.com/user-attachments/files/32128872/lld_at_master_fail_to_compile.tar.gz)
````shell
FAILED: [code=1] ELF/CMakeFiles/lldELF.dir/SyntheticSections.cpp.o
/usr/bin/x86_64-pc-linux-gnu-g++ -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GLIBCXX_USE_CXX11_ABI=1 -D_GNU_SOURCE -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/var/tmp/portage/llvm-core/lld-24.0.0.9999/work/lld_build/ELF -I/var/tmp/portage/llvm-core/lld-24.0.0.9999/work/lld/ELF -I/var/tmp/portage/llvm-core/lld-24.0.0.9999/work/lld/include -I/var/tmp/portage/llvm-core/lld-24.0.0.9999/work/lld_build/include -I/usr/lib/llvm/24/include -O3 -pipe -march=alderlake -mabm -mno-cldemote -mno-kl -mno-pconfig -mno-sgx -mno-widekl -mshstk --param=l1-cache-line-size=64 --param=l1-cache-size=32 --param=l2-cache-size=30720 -fuse-linker-plugin -flto -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing -fgraphite-identity -floop-interchange -floop-strip-mine -floop-nest-optimize -ftree-loop-linear -ggdb3 -frecord-gcc-switches -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -Wimplicit-fallthrough -Wno-nonnull -Wno-class-memaccess -Wno-dangling-reference -Wno-redundant-move -Wno-pessimizing-move -Wno-array-bounds -Wno-stringop-overread -Wno-dangling-pointer -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -std=c++17 -fPIC -UNDEBUG -MD -MT ELF/CMakeFiles/lldELF.dir/SyntheticSections.cpp.o -MF ELF/CMakeFiles/lldELF.dir/SyntheticSections.cpp.o.d -o ELF/CMakeFiles/lldELF.dir/SyntheticSections.cpp.o -c /var/tmp/portage/llvm-core/lld-24.0.0.9999/work/lld/ELF/SyntheticSections.cpp
/var/tmp/portage/llvm-core/lld-24.0.0.9999/work/lld/ELF/SyntheticSections.cpp: In member function ‘virtual void lld::elf::DynamicDebugNote::writeTo(uint8_t*)’:
/var/tmp/portage/llvm-core/lld-24.0.0.9999/work/lld/ELF/SyntheticSections.cpp:4447:25: error: ‘NT_LLVM_DYNAMIC_DEBUGGING’ was not declared in this scope
4447 | write32(ctx, buf + 8, NT_LLVM_DYNAMIC_DEBUGGING); // Type
| ^~~~~~~~~~~~~~~~~~~~~~~~~
````
```shell
* Package: llvm-core/lld-24.0.0.9999:24/24.0.0.9999
* Repository: gentoo
* Maintainer: llvm@gentoo.org
* USE: abi_x86_64 amd64 debug elibc_glibc kernel_linux llvm_targets_AArch64 llvm_targets_AMDGPU llvm_targets_ARC llvm_targets_ARM llvm_targets_AVR llvm_targets_BPF llvm_targets_CSKY llvm_targets_DirectX llvm_targets_Hexagon llvm_targets_Lanai llvm_targets_LoongArch llvm_targets_M68k llvm_targets_MSP430 llvm_targets_Mips llvm_targets_NVPTX llvm_targets_PowerPC llvm_targets_RISCV llvm_targets_SPIRV llvm_targets_Sparc llvm_targets_SystemZ llvm_targets_VE llvm_targets_WebAssembly llvm_targets_X86 llvm_targets_XCore llvm_targets_Xtensa test zstd
* FEATURES: installsources network-sandbox nostrip preserve-libs sandbox test userpriv usersandbox
* Checking whether python3_14 is suitable ...
* dev-lang/python:3.14 ... [ ok ]
* python_check_deps ...
* dev-python/lit[python_targets_python3_14(-)] ... [ ok ]
* Using python3.14 to build (via PYTHON_COMPAT iteration)
>>> Unpacking source...
* Repository id: llvm_llvm-project.git
* To override fetched repository properties, use:
* EGIT_OVERRIDE_REPO_LLVM_LLVM_PROJECT
* EGIT_OVERRIDE_BRANCH_LLVM_LLVM_PROJECT
* EGIT_OVERRIDE_COMMIT_LLVM_LLVM_PROJECT
* EGIT_OVERRIDE_COMMIT_DATE_LLVM_LLVM_PROJECT
*
* Fetching https://github.com/llvm/llvm-project.git ...
git fetch https://github.com/llvm/llvm-project.git +HEAD:refs/git-r3/HEAD
git symbolic-ref refs/git-r3/llvm-core/lld/24/__main__ refs/git-r3/HEAD
* Checking out https://github.com/llvm/llvm-project.git to . ...
git checkout --quiet refs/git-r3/HEAD -- lld cmake libunwind/include/mach-o llvm/utils/dtlto
GIT update -->
repository: https://github.com/llvm/llvm-project.git
updating from commit: 374a8320bf21962b6749965b97294e4815641cb6
to commit: 318e5ab66c1496784eb16ed1af193a58c75efd59
```
Contributor guide
Research direction
Start by reproducing the lld build failure and inspect lld/ELF/SyntheticSections.cpp around DynamicDebugNote::writeTo(), especially the missing NT_LLVM_DYNAMIC_DEBUGGING reference. Trace where that constant should be declared or provided in the LLVM build, then verify that lld compiles successfully with the reported configuration.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cmake, cpp
- Domain
- build-system, compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 62/100