ClangBuiltLinux / linux

Linux kernel source tree
Other
242 stars 14 forks source link

LLD segfaults while linking drivers/scsi/megaraid/megaraid_mm.ko #1649

Open tpgxyz opened 2 years ago

tpgxyz commented 2 years ago

Hello team,

i'm building kernel 5.18.2 with LLVM-14.0.4 and got this issue:

  LD [M]  drivers/scsi/megaraid/megaraid_mm.ko
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
  LD [M]  drivers/scsi/megaraid/megaraid_sas.ko
  LD [M]  drivers/scsi/mpi3mr/mpi3mr.ko
  BTF [M] megaraid_mm
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
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 --icf=none --no-gc-sections -r -EL -maarch64elf -z norelro --thinlto-cache-dir=.thinlto-cache -mllvm -import-instr-limit=5 --build-id=sha1 -T scripts/module.lds -o drivers/scsi/megaraid/megaraid_mbox.ko drivers/scsi/megaraid/megaraid_mbox.prelink.o drivers/scsi/megaraid/megaraid_mbox.mod.o
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 --icf=none --no-gc-sections -r -EL -maarch64elf -z norelro --thinlto-cache-dir=.thinlto-cache -mllvm -import-instr-limit=5 --build-id=sha1 -T scripts/module.lds -o drivers/scsi/mpi3mr/mpi3mr.ko drivers/scsi/mpi3mr/mpi3mr.prelink.o drivers/scsi/mpi3mr/mpi3mr.mod.o
  LD [M]  drivers/scsi/mpt3sas/mpt3sas.ko
  LD [M]  drivers/scsi/mvsas/mvsas.ko
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 --icf=none --no-gc-sections -r -EL -maarch64elf -z norelro --thinlto-cache-dir=.thinlto-cache -mllvm -import-instr-limit=5 --build-id=sha1 -T scripts/module.lds -o drivers/scsi/mvsas/mvsas.ko drivers/scsi/mvsas/mvsas.prelink.o drivers/scsi/mvsas/mvsas.mod.o
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 --icf=none --no-gc-sections -r -EL -maarch64elf -z norelro --thinlto-cache-dir=.thinlto-cache -mllvm -import-instr-limit=5 --build-id=sha1 -T scripts/module.lds -o drivers/scsi/megaraid/megaraid_sas.ko drivers/scsi/megaraid/megaraid_sas.prelink.o drivers/scsi/megaraid/megaraid_sas.mod.o
  #0 0x0000ffffa9a64998 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (#0/usr/lib64/libLLVM-14.so +0x3a649980x0000ffff836b4998) 
llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/usr/lib64/libLLVM-14.so+0x3a64998)
 #1 0x0000ffffa9a63470 llvm::sys::RunSignalHandlers()  (#1/usr/lib64/libLLVM-14.so +0x3a634700x0000ffff836b3470) 
llvm::sys::RunSignalHandlers()  (#2/usr/lib64/libLLVM-14.so +0x0000ffffa9a641700x3a63470 (/usr/lib64/libLLVM-14.so+0x3a64170)
 #3 0x0000ffffae1717bc (linux-vdso.so.1+0x7bc))
  #4#2  0x0000000000639d6c0x0000ffff836b4170  ((/usr/bin/lld/usr/lib64/libLLVM-14.so++0x639d6c0x3a64170))
  #5#3  0x0000000000637cc80x0000ffff87dbe7bc  void lld::elf::writeResult<llvm::object::ELFType<(llvm::support::endianness)1, true> >()( linux-vdso.so.1(+/usr/bin/lld0x7bc+)0x637cc8
)
 #4  #60x0000000000639d6c  0x0000000000480b7c( /usr/bin/lldlld::elf::LinkerDriver::link(llvm::opt::InputArgList&)+ 0x639d6c()/usr/bin/lld
+0x480b7c )#5
 0x0000000000637cc8  #7void lld::elf::writeResult<llvm::object::ELFType<(llvm::support::endianness)1, true> >()  0x0000000000476914( /usr/bin/lldlld::elf::LinkerDriver::linkerMain(llvm::ArrayRef<char const*>)+ 0x637cc8()/usr/bin/lld
+0x476914 #6 )0x0000000000480b7c
  lld::elf::LinkerDriver::link(llvm::opt::InputArgList&)#8 ( /usr/bin/lld0x000000000047412c+ 0x480b7clld::elf::link(llvm::ArrayRef<char const*>, llvm::raw_ostream&, llvm::raw_ostream&, bool, bool)) 
( /usr/bin/lld#7+ 0x47412c0x0000000000476914) 
lld::elf::LinkerDriver::linkerMain(llvm::ArrayRef<char const*>)  (#9/usr/bin/lld +0x00000000003af8d80x476914 )(
/usr/bin/lld+ 0x3af8d8#8) 
0x000000000047412c #10lld::elf::link(llvm::ArrayRef<char const*>, llvm::raw_ostream&, llvm::raw_ostream&, bool, bool)  (0x00000000003b00b0/usr/bin/lld +0x47412cmain) 
(/usr/bin/lld +#90x3b00b0 )0x00000000003af8d8
 (#11/usr/bin/lld +0x0000ffffa5c0b2000x3af8d8 )(
/lib64/libc.so.6+#100x2b200 )0x00000000003b00b0
 main#12  (0x0000ffffa5c0b2d8/usr/bin/lld +__libc_start_main0x3b00b0 )(
/lib64/libc.so.6+#110x2b2d8 )0x0000ffff7f85b200
 (#13/lib64/libc.so.6 +0x00000000003ad1300x2b200 )_start
 (/usr/bin/lld#12+ 0x3ad1300x0000ffff7f85b2d8) 
__libc_start_main (/lib64/libc.so.6+0x2b2d8)
#13 0x00000000003ad130 _start (/usr/bin/lld+0x3ad130)
 #0 0x0000ffffac3a4998 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/usr/lib64/libLLVM-14.so+0x3a64998)
 #1 0x0000ffffac3a3470 llvm::sys::RunSignalHandlers() (/usr/lib64/libLLVM-14.so+0x3a63470)
 #2 0x0000ffffac3a4170 (/usr/lib64/libLLVM-14.so+0x3a64170)
 #3 0x0000ffffb0ab27bc (linux-vdso.so.1+0x7bc)
 #4 0x00000000004fcbc4 void lld::elf::InputSection::copyRelocations<llvm::object::ELFType<(llvm::support::endianness)1, true>, llvm::object::Elf_Rel_Impl<llvm::object::ELFType<(llvm::support::endianness)1, true>, true> >(unsigned char*, llvm::ArrayRef<llvm::object::Elf_Rel_Impl<llvm::object::ELFType<(llvm::support::endianness)1, true>, true> >)  (/usr/bin/lld#0+ 0x4fcbc4)0x0000ffff93934998
 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int)  (#5/usr/lib64/libLLVM-14.so +0x000000000053c3840x3a64998 )(
/usr/bin/lld+ 0x53c384#1) 
0x0000ffff93933470  llvm::sys::RunSignalHandlers()#6  (0x0000ffffac2fe33c/usr/lib64/libLLVM-14.so +(0x3a63470/usr/lib64/libLLVM-14.so)+
0x39be33c) 
#2  #70x0000ffff93934170  0x0000ffffac2fbf20( /usr/lib64/libLLVM-14.so(+/usr/lib64/libLLVM-14.so0x3a64170+)0x39bbf20
)
 #3  #80x0000ffff980427bc  0x0000ffffac2fd804( linux-vdso.so.1(+/usr/lib64/libLLVM-14.so0x7bc+)0x39bd804
) 
#4  #90x00000000004fcbc4  0x0000ffffa87de95cvoid lld::elf::InputSection::copyRelocations<llvm::object::ELFType<(llvm::support::endianness)1, true>, llvm::object::Elf_Rel_Impl<llvm::object::ELFType<(llvm::support::endianness)1, true>, true> >(unsigned char*, llvm::ArrayRef<llvm::object::Elf_Rel_Impl<llvm::object::ELFType<(llvm::support::endianness)1, true>, true> >)  ((/lib64/libstdc++.so.6+/usr/bin/lld0xce95c+)0x4fcbc4
)
#10  0x0000ffffa85a215c#5  (0x000000000053c384/lib64/libc.so.6 +(0x8215c/usr/bin/lld)+
0x53c384)#11
  0x0000ffffa860a49c#6  (0x0000ffff9388e33c/lib64/libc.so.6 +(0xea49c/usr/lib64/libLLVM-14.so)+
0x39be33c)
 #7 0x0000ffff9388bf20 (/usr/lib64/libLLVM-14.so+0x39bbf20)
 #8 0x0000ffff9388d804 (/usr/lib64/libLLVM-14.so+0x39bd804)
 #9 0x0000ffff8fd6e95c (/lib64/libstdc++.so.6+0xce95c)
#10 0x0000ffff8fb3215c (/lib64/libc.so.6+0x8215c)
#11 0x0000ffff8fb9a49c (/lib64/libc.so.6+0xea49c)
 #0 0x0000ffff95634998 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/usr/lib64/libLLVM-14.so+0x3a64998)
 #1 0x0000ffff95633470 llvm::sys::RunSignalHandlers() (/usr/lib64/libLLVM-14.so+0x3a63470)
 #2 0x0000ffff95634170 (/usr/lib64/libLLVM-14.so+0x3a64170)
 #3 0x0000ffff99d3f7bc (linux-vdso.so.1+0x7bc)
 #4 0x0000000000639d6c (/usr/bin/lld+0x639d6c)
 #5 0x0000000000637cc8 void lld::elf::writeResult<llvm::object::ELFType<(llvm::support::endianness)1, true> >() (/usr/bin/lld+0x637cc8)
 #6 0x0000000000480b7c lld::elf::LinkerDriver::link(llvm::opt::InputArgList&) (/usr/bin/lld+0x480b7c)
 #7 0x0000000000476914 lld::elf::LinkerDriver::linkerMain(llvm::ArrayRef<char const*>) (/usr/bin/lld+0x476914)
 #8 0x000000000047412c lld::elf::link(llvm::ArrayRef<char const*>, llvm::raw_ostream&, llvm::raw_ostream&, bool, bool) (/usr/bin/lld+0x47412c)
 #9 0x00000000003af8d8 (/usr/bin/lld+0x3af8d8)
#10 0x00000000003b00b0 main (/usr/bin/lld+0x3b00b0)
#11 0x0000ffff917db200 (/lib64/libc.so.6+0x2b200)
#12 0x0000ffff917db2d8 __libc_start_main (/lib64/libc.so.6+0x2b2d8)
#13 0x00000000003ad130 _start (/usr/bin/lld+0x3ad130)
 #0 0x0000ffff925b4998 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/usr/lib64/libLLVM-14.so+0x3a64998)
 #1 0x0000ffff925b3470 llvm::sys::RunSignalHandlers() (/usr/lib64/libLLVM-14.so+0x3a63470)
 #2 0x0000ffff925b4170 (/usr/lib64/libLLVM-14.so+0x3a64170)
 #3 0x0000ffff96cc27bc (linux-vdso.so.1+0x7bc)
 #4 0x0000000000639d6c (/usr/bin/lld+0x639d6c)
 #5 0x0000000000637cc8 void lld::elf::writeResult<llvm::object::ELFType<(llvm::support::endianness)1, true> >() (/usr/bin/lld+0x637cc8)
 #6 0x0000000000480b7c lld::elf::LinkerDriver::link(llvm::opt::InputArgList&) (/usr/bin/lld+0x480b7c)
 #7 0x0000000000476914 lld::elf::LinkerDriver::linkerMain(llvm::ArrayRef<char const*>) (/usr/bin/lld+0x476914)
 #8 0x000000000047412c lld::elf::link(llvm::ArrayRef<char const*>, llvm::raw_ostream&, llvm::raw_ostream&, bool, bool) (/usr/bin/lld+0x47412c)
 #9 0x00000000003af8d8 (/usr/bin/lld+0x3af8d8)
#10 0x00000000003b00b0 main (/usr/bin/lld+0x3b00b0)
#11 0x0000ffff8e75b200 (/lib64/libc.so.6+0x2b200)
#12 0x0000ffff8e75b2d8 __libc_start_main (/lib64/libc.so.6+0x2b2d8)
#13 0x00000000003ad130 _start (/usr/bin/lld+0x3ad130)
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 --icf=none --no-gc-sections -r -EL -maarch64elf -z norelro --thinlto-cache-dir=.thinlto-cache -mllvm -import-instr-limit=5 --build-id=sha1 -T scripts/module.lds -o drivers/scsi/lpfc/lpfc.ko drivers/scsi/lpfc/lpfc.prelink.o drivers/scsi/lpfc/lpfc.mod.o
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 --icf=none --no-gc-sections -r -EL -maarch64elf -z norelro --thinlto-cache-dir=.thinlto-cache -mllvm -import-instr-limit=5 --build-id=sha1 -T scripts/module.lds -o drivers/scsi/mpt3sas/mpt3sas.ko drivers/scsi/mpt3sas/mpt3sas.prelink.o drivers/scsi/mpt3sas/mpt3sas.mod.o
 #0 0x0000ffff9ba44998 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/usr/lib64/libLLVM-14.so+0x3a64998)
 #1 0x0000ffff9ba43470 llvm::sys::RunSignalHandlers() (/usr/lib64/libLLVM-14.so+0x3a63470)
 #2 0x0000ffff9ba44170 (/usr/lib64/libLLVM-14.so+0x3a64170)
 #3 0x0000ffffa01517bc (linux-vdso.so.1+0x7bc)
 #4 0x0000000000639d6c (/usr/bin/lld+0x639d6c)
 #5 0x0000000000637cc8 void lld::elf::writeResult<llvm::object::ELFType<(llvm::support::endianness)1, true> >() (/usr/bin/lld+0x637cc8)
 #6 0x0000000000480b7c lld::elf::LinkerDriver::link(llvm::opt::InputArgList&) (/usr/bin/lld+0x480b7c)
 #7 0x0000000000476914 lld::elf::LinkerDriver::linkerMain(llvm::ArrayRef<char const*>) (/usr/bin/lld+0x476914)
 #8 0x000000000047412c lld::elf::link(llvm::ArrayRef<char const*>, llvm::raw_ostream&, llvm::raw_ostream&, bool, bool) (/usr/bin/lld+0x47412c)
 #9 0x00000000003af8d8 (/usr/bin/lld+0x3af8d8)
#10 0x00000000003b00b0 main (/usr/bin/lld+0x3b00b0)
#11 0x0000ffff97beb200 (/lib64/libc.so.6+0x2b200)
#12 0x0000ffff97beb2d8 __libc_start_main (/lib64/libc.so.6+0x2b2d8)
#13 0x00000000003ad130 _start (/usr/bin/lld+0x3ad130)
 #0 0x0000ffffb30b4998 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/usr/lib64/libLLVM-14.so+0x3a64998)
 #1 0x0000ffffb30b3470 llvm::sys::RunSignalHandlers() (/usr/lib64/libLLVM-14.so+0x3a63470)
 #2 0x0000ffffb30b4170 (/usr/lib64/libLLVM-14.so+0x3a64170)
 #3 0x0000ffffb77bf7bc (linux-vdso.so.1+0x7bc)
 #4 0x0000000000639d6c (/usr/bin/lld+0x639d6c)
 #5 0x0000000000637cc8 void lld::elf::writeResult<llvm::object::ELFType<(llvm::support::endianness)1, true> >() (/usr/bin/lld+0x637cc8)
 #6 0x0000000000480b7c lld::elf::LinkerDriver::link(llvm::opt::InputArgList&) (/usr/bin/lld+0x480b7c)
 #7 0x0000000000476914 lld::elf::LinkerDriver::linkerMain(llvm::ArrayRef<char const*>) (/usr/bin/lld+0x476914)
 #8 0x000000000047412c lld::elf::link(llvm::ArrayRef<char const*>, llvm::raw_ostream&, llvm::raw_ostream&, bool, bool) (/usr/bin/lld+0x47412c)
 #9 0x00000000003af8d8 (/usr/bin/lld+0x3af8d8)
#10 0x00000000003b00b0 main (/usr/bin/lld+0x3b00b0)
#11 0x0000ffffaf25b200 (/lib64/libc.so.6+0x2b200)
#12 0x0000ffffaf25b2d8 __libc_start_main (/lib64/libc.so.6+0x2b2d8)
#13 0x00000000003ad130 _start (/usr/bin/lld+0x3ad130)
make[2]: *** [scripts/Makefile.modfinal:60: drivers/scsi/libsas/libsas.ko] Error 135
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [scripts/Makefile.modfinal:60: drivers/scsi/megaraid/megaraid_mbox.ko] Error 135
make[2]: *** [scripts/Makefile.modfinal:60: drivers/scsi/mpi3mr/mpi3mr.ko] Error 135
make[2]: *** [scripts/Makefile.modfinal:60: drivers/scsi/mvsas/mvsas.ko] Error 135
make[2]: *** [scripts/Makefile.modfinal:60: drivers/scsi/megaraid.ko] Error 135
make[2]: *** [scripts/Makefile.modfinal:60: drivers/scsi/megaraid/megaraid_sas.ko] Error 135
make[2]: *** [scripts/Makefile.modfinal:60: drivers/scsi/mpt3sas/mpt3sas.ko] Error 135
make[2]: *** [scripts/Makefile.modfinal:60: drivers/scsi/lpfc/lpfc.ko] Error 135
make[1]: *** [scripts/Makefile.modpost:140: __modpost] Error 2
make: *** [Makefile:1752: modules] Error 2
error: Bad exit status from /var/tmp/rpm-tmp.lerILD (%build)

Full build log can be found here https://file-https://abf.openmandriva.org/build_lists/211222

nathanchance commented 2 years ago

I can't reproduce this with vanilla 14.0.4 and Linux 5.18.2 with your configuration:

$ clang --version | head -1
ClangBuiltLinux clang version 14.0.4 (https://github.com/llvm/llvm-project 29f1039a7285a5c3a9c353d054140bf2556d4c4d)

$ git show -s
commit 25405d5eecac69622a155752bb8b0e1ed5071e36 (HEAD -> linux-5.18.y, tag: v5.18.2, origin/linux-5.18.y)
Author: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date:   Mon Jun 6 08:49:00 2022 +0200

    Linux 5.18.2

    Link: https://lore.kernel.org/r/20220603173820.731531504@linuxfoundation.org
    Tested-by: Ronald Warsow <rwarsow@gmx.de
    Tested-by: Justin M. Forbes <jforbes@fedoraproject.org>
    Tested-by: Ron Economos <re@w6rz.net>
    Tested-by: Linux Kernel Functional Testing <lkft@linaro.org>
    Tested-by: Guenter Roeck <linux@roeck-us.net>
    Tested-by: Rudi Heitbaum <rudi@heitbaum.com>
    Tested-by: Bagas Sanjaya <bagasdotme@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

$ curl -LSso .config https://github.com/OpenMandrivaAssociation/kernel-release/raw/master/aarch64-server-omv-defconfig

$ make -skj"$(nproc)" ARCH=arm64 LLVM=1 olddefconfig all
.config:8762:warning: override: reassigning to symbol TYPEC_WUSB3801
.config:12001:warning: symbol value 'm' invalid for CRYPTO_LIB_BLAKE2S_GENERIC
.config:12718:warning: override: reassigning to symbol KFENCE

$ echo $?
0

Is this related to changed ld.lld defaults?

tpgxyz commented 2 years ago

@nathanchance Please notice that https://github.com/OpenMandrivaAssociation/kernel-release/raw/master/aarch64-server-omv-defconfig is altered by spec file to push CLANG as a default compiler https://github.com/OpenMandrivaAssociation/kernel-release/blob/5cb5b1a949e9a6b7aae76790bf5d15d346ed3d24/kernel-release.spec#L1144

Second some potential harmful linker options for kernel are disabled https://github.com/OpenMandrivaAssociation/kernel-release/blob/5cb5b1a949e9a6b7aae76790bf5d15d346ed3d24/kernel-release.spec#L1211

nathanchance commented 2 years ago

@nathanchance Please notice that https://github.com/OpenMandrivaAssociation/kernel-release/raw/master/aarch64-server-omv-defconfig is altered by spec file to push CLANG as a default compiler https://github.com/OpenMandrivaAssociation/kernel-release/blob/5cb5b1a949e9a6b7aae76790bf5d15d346ed3d24/kernel-release.spec#L1144

Setting/removing the CONFIG_CC and CONFIG_LD variables is unnecessary, as they are not user defined symbols; they come from the tools themselves based on $(CC), $(LD), etc and Kconfig updates them automatically (see init/Kconfig, they are not bool "...", which means they cannot be changed by the user directly).

$ curl -LSso .config https://github.com/OpenMandrivaAssociation/kernel-release/raw/master/aarch64-server-omv-defconfig

$ head -23 .config
#
# Automatically generated file; DO NOT EDIT.
# Linux/arm64 5.16.1 Kernel Configuration
#
CONFIG_CC_VERSION_TEXT="aarch64-linux-gnu-gcc (GCC) 11.2.0 20210728 (OpenMandriva)"
CONFIG_CC_IS_GCC=y
CONFIG_GCC_VERSION=110200
CONFIG_CLANG_VERSION=0
CONFIG_AS_IS_GNU=y
CONFIG_AS_VERSION=23700
CONFIG_LD_VERSION=0
CONFIG_LD_IS_LLD=y
CONFIG_LLD_VERSION=130000
CONFIG_CC_CAN_LINK=y
CONFIG_CC_CAN_LINK_STATIC=y
CONFIG_CC_HAS_ASM_GOTO=y
CONFIG_CC_HAS_ASM_GOTO_OUTPUT=y
CONFIG_TOOLS_SUPPORT_RELR=y
CONFIG_CC_HAS_ASM_INLINE=y
CONFIG_CC_HAS_NO_PROFILE_FN_ATTR=y
CONFIG_IRQ_WORK=y
CONFIG_BUILDTIME_TABLE_SORT=y
CONFIG_THREAD_INFO_IN_TASK=y

$ make -skj"$(nproc)" ARCH=arm64 LLVM=1 olddefconfig
.config:8762:warning: override: reassigning to symbol TYPEC_WUSB3801
.config:12001:warning: symbol value 'm' invalid for CRYPTO_LIB_BLAKE2S_GENERIC
.config:12718:warning: override: reassigning to symbol KFENCE

$ head -23 .config
#
# Automatically generated file; DO NOT EDIT.
# Linux/arm64 5.18.2 Kernel Configuration
#
CONFIG_CC_VERSION_TEXT="ClangBuiltLinux clang version 14.0.4 (https://github.com/llvm/llvm-project 29f1039a7285a5c3a9c353d054140bf2556d4c4d)"
CONFIG_GCC_VERSION=0
CONFIG_CC_IS_CLANG=y
CONFIG_CLANG_VERSION=140004
CONFIG_AS_IS_LLVM=y
CONFIG_AS_VERSION=140004
CONFIG_LD_VERSION=0
CONFIG_LD_IS_LLD=y
CONFIG_LLD_VERSION=140004
CONFIG_CC_HAS_ASM_GOTO=y
CONFIG_CC_HAS_ASM_GOTO_OUTPUT=y
CONFIG_TOOLS_SUPPORT_RELR=y
CONFIG_CC_HAS_ASM_INLINE=y
CONFIG_CC_HAS_NO_PROFILE_FN_ATTR=y
CONFIG_PAHOLE_VERSION=123
CONFIG_IRQ_WORK=y
CONFIG_BUILDTIME_TABLE_SORT=y
CONFIG_THREAD_INFO_IN_TASK=y

Even if I apply the other changes, I still see no crash:

$ rg "CONFIG_(CC_|LD_|INIT_STACK_|KCSAN=|SHADOW_CALL_STACK |LTO_|CFI_|RELR=)" .config
5:CONFIG_CC_VERSION_TEXT="ClangBuiltLinux clang version 14.0.4 (https://github.com/llvm/llvm-project 29f1039a7285a5c3a9c353d054140bf2556d4c4d)"
7:CONFIG_CC_IS_CLANG=y
11:CONFIG_LD_VERSION=0
12:CONFIG_LD_IS_LLD=y
14:CONFIG_CC_HAS_ASM_GOTO=y
15:CONFIG_CC_HAS_ASM_GOTO_OUTPUT=y
17:CONFIG_CC_HAS_ASM_INLINE=y
18:CONFIG_CC_HAS_NO_PROFILE_FN_ATTR=y
171:CONFIG_CC_HAS_INT128=y
172:CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough"
221:CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE=y
222:# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
223:CONFIG_LD_ORPHAN_WARN=y
440:CONFIG_CC_HAVE_SHADOW_CALL_STACK=y
489:CONFIG_CC_HAS_BRANCH_PROT_PAC_RET=y
490:CONFIG_CC_HAS_SIGN_RETURN_ADDRESS=y
509:CONFIG_CC_HAS_BRANCH_PROT_PAC_RET_BTI=y
529:CONFIG_CC_HAVE_STACKPROTECTOR_SYSREG=y
794:# CONFIG_SHADOW_CALL_STACK is not set
796:CONFIG_LTO_CLANG=y
800:# CONFIG_LTO_NONE is not set
801:# CONFIG_LTO_CLANG_FULL is not set
802:CONFIG_LTO_CLANG_THIN=y
804:CONFIG_CFI_CLANG=y
805:CONFIG_CFI_CLANG_SHADOW=y
806:CONFIG_CFI_PERMISSIVE=y
843:CONFIG_RELR=y
11916:CONFIG_CC_HAS_AUTO_VAR_INIT_PATTERN=y
11917:CONFIG_CC_HAS_AUTO_VAR_INIT_ZERO=y
11918:CONFIG_INIT_STACK_NONE=y
11919:# CONFIG_INIT_STACK_ALL_PATTERN is not set
11920:# CONFIG_INIT_STACK_ALL_ZERO is not set
12509:CONFIG_CC_HAS_KASAN_GENERIC=y
12510:CONFIG_CC_HAS_KASAN_SW_TAGS=y
12511:CONFIG_CC_HAS_WORKING_NOSANITIZE_ADDRESS=y
12697:CONFIG_CC_HAS_SANCOV_TRACE_PC=y

Second some potential harmful linker options for kernel are disabled https://github.com/OpenMandrivaAssociation/kernel-release/blob/5cb5b1a949e9a6b7aae76790bf5d15d346ed3d24/kernel-release.spec#L1211

Both of those are default off in upstream but if I remember correctly, you default those to on?

https://github.com/llvm/llvm-project/blob/37028d3ea7fc9fa7e640c91faa9c347808598dd6/lld/ELF/Driver.cpp#L733

https://github.com/llvm/llvm-project/blob/37028d3ea7fc9fa7e640c91faa9c347808598dd6/lld/ELF/Driver.cpp#L1089

nickdesaulniers commented 2 years ago

Both of those are default off in upstream but if I remember correctly, you default those to on?

From the dump from lld posted, I see both --icf=none --no-gc-sections in the command line argument.