[clang] [lld] [llvm] [llvm][lld][clang] Delay initializing TargetOptions in LTO builds until a Triple is available (PR #179509)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 4 23:04:01 PST 2026


https://github.com/MaskRay requested changes to this pull request.

This breaks a -DBUILD_SHARED_LIBS=on build
```
ld.lld: error: undefined symbol: llvm::codegen::InitTargetOptionsFromCodeGenFlags(llvm::Triple const&)
>>> referenced by LTO.cpp
>>>               tools/lld/ELF/CMakeFiles/lldELF.dir/LTO.cpp.o:(createConfig(lld::elf::Ctx&)::$_0::operator()(llvm::Triple const&) const)
>>> referenced by LTO.cpp
>>>               tools/lld/ELF/CMakeFiles/lldELF.dir/LTO.cpp.o:(llvm::lto::Config::InitTargetOptions::'lambda'(llvm::Triple const&)::operator()(llvm::Triple const&) const)
```

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


More information about the llvm-commits mailing list