Open tpgxyz opened 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?
@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 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?
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.
Hello team,
i'm building kernel 5.18.2 with LLVM-14.0.4 and got this issue:
Full build log can be found here https://file-https://abf.openmandriva.org/build_lists/211222