| Issue |
166256
|
| Summary |
`lld` says `LLVM ERROR: Broken module found, compilation aborted!` in `vmlinux.o` on compiling Linux 6.17.6.
|
| Labels |
crash,
LTO
|
| Assignees |
|
| Reporter |
dreirund
|
Ahoj,
a build of Linux 6.17.6 with LLVM's `clang` version 21.1.4, `lld` version 21.1.4 resulted in error outputs from LLVM CLang/ lld that sais that I should report an issue here:
```
LLVM ERROR: Broken module found, compilation aborted!
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
```
Here is what I did:
* I have Artix GNU/Linux (rolling release) as my operating system and installed packages `clang` and `llvm` from their repositories,
* I took [vanilla Linux kernel 6.17.6 from kernel.org](https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-6.17.6.tar.xz),
* added `-mno-sse4a` to `KBUILD_CFLAGS` to work around [this bug](https://bugs.gentoo.org/962779) ([this is the patch applied to achieve this](https://github.com/user-attachments/files/23319250/kbuild-disable-sse4a_vanilla.patch.txt),
* used [this kernel configuration](https://github.com/user-attachments/files/23319184/config-6.17-vanilla-custom-clang.txt) (i.e. build with LTO),
* compiled by `LLVM=1 LLVM_IAS=1 make V=1 -j1 all`.
Terminal output of `LLVM=1 LLVM_IAS=1 make V=1 -j1 all`:
```c++
[...]
make -f ./scripts/Makefile.vmlinux_o
# LD vmlinux.o
ld.lld -m elf_x86_64 -mllvm -import-instr-limit=5 --compress-debug-sections=zstd -z noexecstack -r -o vmlinux.o -T .tmp_initcalls.lds --whole-archive vmlinux.a --no-whole-archive --start-group --end-group ; ./tools/objtool/objtool --hacks=jump_label --hacks=noinstr --ibt --mcount --mnop --orc --retpoline --rethunk --sls --static-call --uaccess --link vmlinux.o
inlinable function call in a function with debug info must have a !dbg location
call void @__sanitizer_cov_stack_depth() #335
inlinable function call in a function with debug info must have a !dbg location
call void @__sanitizer_cov_stack_depth() #335
inlinable function call in a function with debug info must have a !dbg location
call void @__sanitizer_cov_stack_depth() #335
inlinable function call in a function with debug info must have a !dbg location
call void @__sanitizer_cov_stack_depth() #335
inlinable function call in a function with debug info must have a !dbg location
call void @__sanitizer_cov_stack_depth() #335
inlinable function call in a function with debug info must have a !dbg location
call void @__sanitizer_cov_stack_depth() #335
inlinable function call in a function with debug info must have a !dbg location
call void @__sanitizer_cov_stack_depth() #335
inlinable function call in a function with debug info must have a !dbg location
call void @__sanitizer_cov_stack_depth() #335
inlinable function call in a function with debug info must have a !dbg location
call void @__sanitizer_cov_stack_depth() #335
inlinable function call in a function with debug info must have a !dbg location
call void @__sanitizer_cov_stack_depth() #335
inlinable function call in a function with debug info must have a !dbg location
call void @__sanitizer_cov_stack_depth() #335
inlinable function call in a function with debug info must have a !dbg location
call void @__sanitizer_cov_stack_depth() #335
inlinable function call in a function with debug info must have a !dbg location
call void @__sanitizer_cov_stack_depth() #335
inlinable function call in a function with debug info must have a !dbg location
call void @__sanitizer_cov_stack_depth() #335
inlinable function call in a function with debug info must have a !dbg location
call void @__sanitizer_cov_stack_depth() #335
inlinable function call in a function with debug info must have a !dbg location
call void @__sanitizer_cov_stack_depth() #335
inlinable function call in a function with debug info must have a !dbg location
call void @__sanitizer_cov_stack_depth() #335
inlinable function call in a function with debug info must have a !dbg location
call void @__sanitizer_cov_stack_depth() #335
inlinable function call in a function with debug info must have a !dbg location
call void @__sanitizer_cov_stack_depth() #335
inlinable function call in a function with debug info must have a !dbg location
call void @__sanitizer_cov_stack_depth() #335
inlinable function call in a function with debug info must have a !dbg location
call void @__sanitizer_cov_stack_depth() #335
inlinable function call in a function with debug info must have a !dbg location
call void @__sanitizer_cov_stack_depth() #335
inlinable function call in a function with debug info must have a !dbg location
call void @__sanitizer_cov_stack_depth() #335
inlinable function call in a function with debug info must have a !dbg location
call void @__sanitizer_cov_stack_depth() #335
inlinable function call in a function with debug info must have a !dbg location
call void @__sanitizer_cov_stack_depth() #335
inlinable function call in a function with debug info must have a !dbg location
call void @__sanitizer_cov_stack_depth() #335
inlinable function call in a function with debug info must have a !dbg location
call void @__sanitizer_cov_stack_depth() #335
LLVM ERROR: Broken module found, compilation aborted!
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0. Program arguments: ld.lld -m elf_x86_64 -mllvm -import-instr-limit=5 --compress-debug-sections=zstd -z noexecstack -r -o vmlinux.o -T .tmp_initcalls.lds --whole-archive vmlinux.a --no-whole-archive --start-group --end-group
1. Running pass "verify" on module "ld-temp.o"
#0 0x00007f4d1fcfe91e llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/usr/lib/libLLVM.so.21.1+0x8fe91e)
#1 0x00007f4d1fcfba67 (/usr/lib/libLLVM.so.21.1+0x8fba67)
#2 0x00007f4d1ec3e240 (/usr/lib/libc.so.6+0x3e240)
#3 0x00007f4d1ec9644c __pthread_kill_implementation /usr/src/debug/glibc/glibc/nptl/pthread_kill.c:44:76
#4 0x00007f4d1ec3e108 raise /usr/src/debug/glibc/glibc/signal/../sysdeps/posix/raise.c:27:6
#5 0x00007f4d1ec25667 abort /usr/src/debug/glibc/glibc/stdlib/abort.c:85:3
#6 0x00007f4d1f93f198 (/usr/lib/libLLVM.so.21.1+0x53f198)
#7 0x00007f4d1fbf34ce (/usr/lib/libLLVM.so.21.1+0x7f34ce)
#8 0x00007f4d1ff91411 (/usr/lib/libLLVM.so.21.1+0xb91411)
#9 0x00007f4d22184ba4 (/usr/lib/libLLVM.so.21.1+0x2d84ba4)
#10 0x00007f4d1ff4bc00 llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/usr/lib/libLLVM.so.21.1+0xb4bc00)
#11 0x00007f4d2218c8c8 (/usr/lib/libLLVM.so.21.1+0x2d8c8c8)
#12 0x00007f4d2218e5e5 llvm::lto::opt(llvm::lto::Config const&, llvm::TargetMachine*, unsigned int, llvm::Module&, bool, llvm::ModuleSummaryIndex*, llvm::ModuleSummaryIndex const*, std::vector<unsigned char, std::allocator<unsigned char>> const&) (/usr/lib/libLLVM.so.21.1+0x2d8e5e5)
#13 0x00007f4d22190e3d llvm::lto::backend(llvm::lto::Config const&, std::function<llvm::Expected<std::unique_ptr<llvm::CachedFileStream, std::default_delete<llvm::CachedFileStream>>> (unsigned int, llvm::Twine const&)>, unsigned int, llvm::Module&, llvm::ModuleSummaryIndex&) (/usr/lib/libLLVM.so.21.1+0x2d90e3d)
#14 0x00007f4d2217ec07 llvm::lto::LTO::runRegularLTO(std::function<llvm::Expected<std::unique_ptr<llvm::CachedFileStream, std::default_delete<llvm::CachedFileStream>>> (unsigned int, llvm::Twine const&)>) (/usr/lib/libLLVM.so.21.1+0x2d7ec07)
#15 0x00007f4d22183326 llvm::lto::LTO::run(std::function<llvm::Expected<std::unique_ptr<llvm::CachedFileStream, std::default_delete<llvm::CachedFileStream>>> (unsigned int, llvm::Twine const&)>, llvm::FileCache) (/usr/lib/libLLVM.so.21.1+0x2d83326)
#16 0x00007f4d28f66c1c lld::elf::BitcodeCompiler::compile() (/usr/lib/liblldELF.so.21.1+0x166c1c)
#17 0x00007f4d28ecfa42 (/usr/lib/liblldELF.so.21.1+0xcfa42)
#18 0x00007f4d28eada23 lld::elf::LinkerDriver::linkerMain(llvm::ArrayRef<char const*>) (/usr/lib/liblldELF.so.21.1+0xada23)
#19 0x00007f4d28eaf5f0 lld::elf::link(llvm::ArrayRef<char const*>, llvm::raw_ostream&, llvm::raw_ostream&, bool, bool) (/usr/lib/liblldELF.so.21.1+0xaf5f0)
#20 0x00007f4d28c10bc0 lld::unsafeLldMain(llvm::ArrayRef<char const*>, llvm::raw_ostream&, llvm::raw_ostream&, llvm::ArrayRef<lld::DriverDef>, bool) (/usr/lib/liblldCommon.so.21.1+0xcbc0)
#21 0x000055fa94971a7c lld_main(int, char**, llvm::ToolContext const&) (/usr/bin/ld.lld+0x2a7c)
#22 0x000055fa949712b6 main (/usr/bin/ld.lld+0x22b6)
#23 0x00007f4d1ec2773b __libc_start_call_main /usr/src/debug/glibc/glibc/csu/../sysdeps/nptl/libc_start_call_main.h:74:3
#24 0x00007f4d1ec277fc call_init /usr/src/debug/glibc/glibc/csu/../csu/libc-start.c:128:20
#25 0x00007f4d1ec277fc __libc_start_main /usr/src/debug/glibc/glibc/csu/../csu/libc-start.c:347:5
#26 0x000055fa94971315 _start (/usr/bin/ld.lld+0x2315)
make[2]: *** [scripts/Makefile.vmlinux_o:72: vmlinux.o] Error 134
make[1]: *** [/var/cache/makepkg/build/linux-dreieck/src/build/vanilla-customconfig-clang/Makefile:1225: vmlinux_o] Error 2
make: *** [Makefile:248: __sub-make] Error 2
```
A GDB session (`gdb --args make LLVM=1 LLVM_IAS=1 make V=1 -j1 all`) also does not give more options (no backtrace possible).
[Others also seem to have this](https://aur.archlinux.org/packages/linux-cachyos-headers#comment-1045184).
I do not know C, I do not know about how linking works, I can only report what goes on here, and I report because I am told so in the message that I should report.
Regards!
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs