<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/78732>78732</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Crash compiling linux-6.7.0 with clang-17.0.6
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
srcshelton
</td>
</tr>
</table>
<pre>
```
Stack dump:
0. Program arguments: ld.lld -m elf_x86_64 -mllvm -import-instr-limit=5 -z noexecstack -r -o arch/x86/crypto/ghash-clmulni-intel.o @arch/x86/crypto/ghash-clmulni-intel.mod
1. Running pass 'Function Pass Manager' on module 'ld-temp.o'.
2. Running pass 'Prologue/Epilogue Insertion & Frame Finalization' on function '@ghash_async_init'
#0 0x00007f7ecffa4e9e llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/usr/lib/llvm/17/bin/../lib64/libLLVM-17.so+0x9a4e9e)
#1 0x00007f7ecffa2c44 llvm::sys::RunSignalHandlers() (/usr/lib/llvm/17/bin/../lib64/libLLVM-17.so+0x9a2c44)
#2 0x00007f7ecffa2da6 (/usr/lib/llvm/17/bin/../lib64/libLLVM-17.so+0x9a2da6)
#3 0x00007f7ecf05fb70 (/lib64/libc.so.6+0x38b70)
#4 0x00007f7ed04c2301 (/usr/lib/llvm/17/bin/../lib64/libLLVM-17.so+0xec2301)
#5 0x00007f7ed04c91a9 (/usr/lib/llvm/17/bin/../lib64/libLLVM-17.so+0xec91a9)
#6 0x00007f7ed039cb5d llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (/usr/lib/llvm/17/bin/../lib64/libLLVM-17.so+0xd9cb5d)
#7 0x00007f7ed00ecc49 llvm::FPPassManager::runOnFunction(llvm::Function&) (/usr/lib/llvm/17/bin/../lib64/libLLVM-17.so+0xaecc49)
#8 0x00007f7ed00eced3 llvm::FPPassManager::runOnModule(llvm::Module&) (/usr/lib/llvm/17/bin/../lib64/libLLVM-17.so+0xaeced3)
#9 0x00007f7ed00ed557 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/usr/lib/llvm/17/bin/../lib64/libLLVM-17.so+0xaed557)
#10 0x00007f7ed180d474 (/usr/lib/llvm/17/bin/../lib64/libLLVM-17.so+0x220d474)
#11 0x00007f7ed180dbaa 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/llvm/17/bin/../lib64/libLLVM-17.so+0x220dbaa)
#12 0x00007f7ed1803fc7 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/llvm/17/bin/../lib64/libLLVM-17.so+0x2203fc7)
#13 0x00007f7ed180443b llvm::lto::LTO::run(std::function<llvm::Expected<std::unique_ptr<llvm::CachedFileStream, std::default_delete<llvm::CachedFileStream>>> (unsigned int, llvm::Twine const&)>, std::function<llvm::Expected<std::function<llvm::Expected<std::unique_ptr<llvm::CachedFileStream, std::default_delete<llvm::CachedFileStream>>> (unsigned int, llvm::Twine const&)>> (unsigned int, llvm::StringRef, llvm::Twine const&)>) (/usr/lib/llvm/17/bin/../lib64/libLLVM-17.so+0x220443b)
#14 0x00007f7ed395d6d6 lld::elf::BitcodeCompiler::compile() (/usr/lib/llvm/17/bin/../lib64/liblldELF.so.17+0x15d6d6)
#15 0x00007f7ed38e01f7 void lld::elf::LinkerDriver::compileBitcodeFiles<llvm::object::ELFType<(llvm::support::endianness)1, true>>(bool) (/usr/lib/llvm/17/bin/../lib64/liblldELF.so.17+0xe01f7)
#16 0x00007f7ed38e8ae8 lld::elf::LinkerDriver::link(llvm::opt::InputArgList&) (/usr/lib/llvm/17/bin/../lib64/liblldELF.so.17+0xe8ae8)
#17 0x00007f7ed38eb3e0 lld::elf::LinkerDriver::linkerMain(llvm::ArrayRef<char const*>) (/usr/lib/llvm/17/bin/../lib64/liblldELF.so.17+0xeb3e0)
#18 0x00007f7ed38ecddc lld::elf::link(llvm::ArrayRef<char const*>, llvm::raw_ostream&, llvm::raw_ostream&, bool, bool) (/usr/lib/llvm/17/bin/../lib64/liblldELF.so.17+0xecddc)
#19 0x00007f7ed3ae10ad lld::unsafeLldMain(llvm::ArrayRef<char const*>, llvm::raw_ostream&, llvm::raw_ostream&, llvm::ArrayRef<lld::DriverDef>, bool) (/usr/lib/llvm/17/bin/../lib64/liblldCommon.so.17+0x100ad)
#20 0x000055ee43ce6d4c lld_main(int, char**, llvm::ToolContext const&) (/usr/lib/llvm/17/bin/ld.lld+0x3d4c)
#21 0x000055ee43ce6501 main (/usr/lib/llvm/17/bin/ld.lld+0x3501)
#22 0x00007f7ecf04ad77 (/lib64/libc.so.6+0x23d77)
#23 0x00007f7ecf04ae35 __libc_start_main (/lib64/libc.so.6+0x23e35)
#24 0x000055ee43ce6531 _start (/usr/lib/llvm/17/bin/ld.lld+0x3531)
Segmentation fault
make[6]: *** [/usr/src/linux-6.7.0/scripts/Makefile.build:438: arch/x86/crypto/ghash-clmulni-intel.o] Error 139
make[5]: *** [/usr/src/linux-6.7.0/scripts/Makefile.build:480: arch/x86/crypto] Error 2
make[4]: *** [/usr/src/linux-6.7.0/scripts/Makefile.build:480: arch/x86] Error 2
make[3]: *** [/usr/src/linux-6.7.0/Makefile:1911: .] Error 2
make[2]: *** [/usr/src/linux-6.7.0/Makefile:350: __build_one_by_one] Error 2
make[1]: *** [/usr/src/linux-6.7.0/Makefile:234: __sub-make] Error 2
make[1]: Leaving directory '/usr/src/build'
```
If the kernel is reconfigured with this module disabled then there is a different crash in `KVM`, and if that is disabled then another module breaks. I stopped trying to dig any deeper at this point.
FWIW, on the same host building `linux-6.6.9` with `clang-16.0.6` and the same configuration worked as expected.
```
# /usr/lib/llvm/17/bin/clang --version
clang version 17.0.6
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/lib/llvm/17/bin
Configuration file: /etc/clang/x86_64-pc-linux-gnu-clang.cfg
```
Configuration:
```
--rtlib=compiler-rt
--unwindlib=libunwind
--stdlib=libc++
-fuse-ld=lld
-Wl,-z,relro
--gcc-install-dir="/usr/lib/gcc/x86_64-pc-linux-gnu/13"
-fstack-clash-protection
-fstack-protector-strong
-fPIE
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzcWUtv2zjX_jXMhpAgUTd7kUVix_iCL8EETTGzNCjyWOYbitRLUo3dX_-ClJxYbpK2U88sGhi2ckie5zkXHl5ErRWNArhExTUqlhe0d1ttLq1hdgvSaXVRa76_RGUyfpIlSq4eHWVPmPdth7KrQZTEOPw9GN0Y2mJqmr4F5SzKrrDksZQcRy0GuVnvZuW6zHHUSvmlxZFoO21cJJR1JpKiFQ5lywJHX7HSsANmA1hkcKQxNWyLyGo3KxFZMbPvnEZk1Wyp3UZMtr1UIhLKgYw1Rnny491bzQc70tGOT71SQjW4o9ZiRKpVr5gTWuEHL7inijZgEKmwVrjVvJfge0keOWi7WCNSxYNC8o7CB6OlbnpAZHXTifCIb5UFE1AQKfHK0BbwSigqxVfqxSPe5sAFkQrlSbBnTe1esbVQwnlpgMaIZAlOdkmSJNWmArbZ0BzmgL3jfeSyK7u3w8ODEcqFuH42lAEis9dOhj6vtXUGaItIicgCC-UQmWNEZoisemsQWUlR-28_iKzSCpFVLRQiqzgeGst8-L27-_M-SqvYakSuk908MEJk_ko5PaFMWJ6_RflTrx5Fo6j8P6q4BGMDnTOx8qATVuSUFaflmaA4LSdQ2QQqKTZ1lYxQR3pYbHVcBh3ZrK6SiYr8SAVPckayJD0HWwiaJlDFCdQ8pWeJAQRNE6hyApXNWV3wo8y4p2wrFBymqp-pYwL36g91EE9S-1VYnil1eGA1oV1NaCfAWD4_or168EwPJeVfJ0wDnwnh2Slh4NkPEL4PdXBC9yA6I1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