Merge patch series "Bump minimum supported version of LLVM for building the kernel to 15.0.0"
s390 and x86 have required LLVM 15 since30d17fac6a("scripts/min-tool-version.sh: raise minimum clang version to 15.0.0 for s390")7861640aac("x86/build: Raise the minimum LLVM version to 15.0.0") respectively. This series bumps the rest of the kernel to 15.0.0 to match, which allows for a decent number of clean ups. On the distros front, we will only leave behind Debian Bookworm and Ubuntu Jammy. In both of those cases, builders / developers can either use the kernel.org toolchains or https://apt.llvm.org to get newer versions that will run on those distributions, if they cannot upgrade. archlinux:latest clang version 20.1.8 debian:oldoldstable-slim Debian clang version 11.0.1-2 debian:oldstable-slim Debian clang version 14.0.6 debian:stable-slim Debian clang version 19.1.7 (3+b1) debian:testing-slim Debian clang version 19.1.7 (3+b1) debian:unstable-slim Debian clang version 19.1.7 (3+b2) fedora:41 clang version 19.1.7 (Fedora 19.1.7-4.fc41) fedora:latest clang version 20.1.8 (Fedora 20.1.8-3.fc42) fedora:rawhide clang version 20.1.8 (Fedora 20.1.8-3.fc43) opensuse/leap:latest clang version 17.0.6 opensuse/tumbleweed:latest clang version 20.1.8 ubuntu:focal clang version 10.0.0-4ubuntu1 ubuntu:jammy Ubuntu clang version 14.0.0-1ubuntu1.1 ubuntu:noble Ubuntu clang version 18.1.3 (1ubuntu1) ubuntu:latest Ubuntu clang version 18.1.3 (1ubuntu1) ubuntu:rolling Ubuntu clang version 20.1.2 (0ubuntu1) ubuntu:devel Ubuntu clang version 20.1.8 (0ubuntu1) Link: https://lore.kernel.org/r/20250821-bump-min-llvm-ver-15-v2-0-635f3294e5f0@kernel.org Signed-off-by: Nathan Chancellor <nathan@kernel.org>
This commit is contained in:
@@ -30,7 +30,7 @@ you probably needn't concern yourself with pcmciautils.
|
||||
Program Minimal version Command to check the version
|
||||
====================== =============== ========================================
|
||||
GNU C 8.1 gcc --version
|
||||
Clang/LLVM (optional) 13.0.1 clang --version
|
||||
Clang/LLVM (optional) 15.0.0 clang --version
|
||||
Rust (optional) 1.78.0 rustc --version
|
||||
bindgen (optional) 0.65.1 bindgen --version
|
||||
GNU make 4.0 make --version
|
||||
|
||||
@@ -1475,7 +1475,6 @@ config RANDOMIZE_KSTACK_OFFSET
|
||||
bool "Support for randomizing kernel stack offset on syscall entry" if EXPERT
|
||||
default y
|
||||
depends on HAVE_ARCH_RANDOMIZE_KSTACK_OFFSET
|
||||
depends on INIT_STACK_NONE || !CC_IS_CLANG || CLANG_VERSION >= 140000
|
||||
help
|
||||
The kernel stack offset can be randomized (after pt_regs) by
|
||||
roughly 5 bits of entropy, frustrating memory corruption
|
||||
|
||||
+4
-7
@@ -166,15 +166,12 @@ config ARM
|
||||
<http://www.arm.linux.org.uk/>.
|
||||
|
||||
config ARM_HAS_GROUP_RELOCS
|
||||
def_bool y
|
||||
depends on !LD_IS_LLD || LLD_VERSION >= 140000
|
||||
depends on !COMPILE_TEST
|
||||
def_bool !COMPILE_TEST
|
||||
help
|
||||
Whether or not to use R_ARM_ALU_PC_Gn or R_ARM_LDR_PC_Gn group
|
||||
relocations, which have been around for a long time, but were not
|
||||
supported in LLD until version 14. The combined range is -/+ 256 MiB,
|
||||
which is usually sufficient, but not for allyesconfig, so we disable
|
||||
this feature when doing compile testing.
|
||||
relocations. The combined range is -/+ 256 MiB, which is usually
|
||||
sufficient, but not for allyesconfig, so we disable this feature
|
||||
when doing compile testing.
|
||||
|
||||
config ARM_DMA_USE_IOMMU
|
||||
bool
|
||||
|
||||
+1
-4
@@ -1492,8 +1492,6 @@ choice
|
||||
|
||||
config CPU_BIG_ENDIAN
|
||||
bool "Build big-endian kernel"
|
||||
# https://github.com/llvm/llvm-project/commit/1379b150991f70a5782e9a143c2ba5308da1161c
|
||||
depends on AS_IS_GNU || AS_VERSION >= 150000
|
||||
help
|
||||
Say Y if you plan on running a kernel with a big-endian userspace.
|
||||
|
||||
@@ -2363,8 +2361,7 @@ config STACKPROTECTOR_PER_TASK
|
||||
|
||||
config UNWIND_PATCH_PAC_INTO_SCS
|
||||
bool "Enable shadow call stack dynamically using code patching"
|
||||
# needs Clang with https://github.com/llvm/llvm-project/commit/de07cde67b5d205d58690be012106022aea6d2b3 incorporated
|
||||
depends on CC_IS_CLANG && CLANG_VERSION >= 150000
|
||||
depends on CC_IS_CLANG
|
||||
depends on ARM64_PTR_AUTH_KERNEL && CC_HAS_BRANCH_PROT_PAC_RET
|
||||
depends on SHADOW_CALL_STACK
|
||||
select UNWIND_TABLES
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ config MIPS
|
||||
select ARCH_BINFMT_ELF_STATE if MIPS_FP_SUPPORT
|
||||
select ARCH_HAS_CPU_CACHE_ALIASING
|
||||
select ARCH_HAS_CPU_FINALIZE_INIT
|
||||
select ARCH_HAS_CURRENT_STACK_POINTER if !CC_IS_CLANG || CLANG_VERSION >= 140000
|
||||
select ARCH_HAS_CURRENT_STACK_POINTER
|
||||
select ARCH_HAS_DEBUG_VIRTUAL if !64BIT
|
||||
select ARCH_HAS_DMA_OPS if MACH_JAZZ
|
||||
select ARCH_HAS_FORTIFY_SOURCE
|
||||
|
||||
@@ -143,10 +143,6 @@ static inline int __copy_inst_from_kernel_nofault(ppc_inst_t *inst, u32 *src)
|
||||
{
|
||||
unsigned int val, suffix;
|
||||
|
||||
/* See https://github.com/ClangBuiltLinux/linux/issues/1521 */
|
||||
#if defined(CONFIG_CC_IS_CLANG) && CONFIG_CLANG_VERSION < 140000
|
||||
val = suffix = 0;
|
||||
#endif
|
||||
__get_kernel_nofault(&val, src, u32, Efault);
|
||||
if (IS_ENABLED(CONFIG_PPC64) && get_op(val) == OP_PREFIX) {
|
||||
__get_kernel_nofault(&suffix, src + 1, u32, Efault);
|
||||
|
||||
+7
-14
@@ -64,9 +64,8 @@ config RISCV
|
||||
select ARCH_SUPPORTS_DEBUG_PAGEALLOC if MMU
|
||||
select ARCH_SUPPORTS_HUGE_PFNMAP if TRANSPARENT_HUGEPAGE
|
||||
select ARCH_SUPPORTS_HUGETLBFS if MMU
|
||||
# LLD >= 14: https://github.com/llvm/llvm-project/issues/50505
|
||||
select ARCH_SUPPORTS_LTO_CLANG if LLD_VERSION >= 140000
|
||||
select ARCH_SUPPORTS_LTO_CLANG_THIN if LLD_VERSION >= 140000
|
||||
select ARCH_SUPPORTS_LTO_CLANG
|
||||
select ARCH_SUPPORTS_LTO_CLANG_THIN
|
||||
select ARCH_SUPPORTS_MSEAL_SYSTEM_MAPPINGS if 64BIT && MMU
|
||||
select ARCH_SUPPORTS_PAGE_TABLE_CHECK if MMU
|
||||
select ARCH_SUPPORTS_PER_VMA_LOCK if MMU
|
||||
@@ -247,15 +246,9 @@ config HAVE_SHADOW_CALL_STACK
|
||||
# https://github.com/riscv-non-isa/riscv-elf-psabi-doc/commit/a484e843e6eeb51f0cb7b8819e50da6d2444d769
|
||||
depends on $(ld-option,--no-relax-gp)
|
||||
|
||||
config RISCV_USE_LINKER_RELAXATION
|
||||
def_bool y
|
||||
# https://github.com/llvm/llvm-project/commit/6611d58f5bbcbec77262d392e2923e1d680f6985
|
||||
depends on !LD_IS_LLD || LLD_VERSION >= 150000
|
||||
|
||||
# https://github.com/llvm/llvm-project/commit/bbc0f99f3bc96f1db16f649fc21dd18e5b0918f6
|
||||
config ARCH_HAS_BROKEN_DWARF5
|
||||
def_bool y
|
||||
depends on RISCV_USE_LINKER_RELAXATION
|
||||
# https://github.com/llvm/llvm-project/commit/1df5ea29b43690b6622db2cad7b745607ca4de6a
|
||||
depends on AS_IS_LLVM && AS_VERSION < 180000
|
||||
# https://github.com/llvm/llvm-project/commit/7ffabb61a5569444b5ac9322e22e5471cc5e4a77
|
||||
@@ -627,7 +620,7 @@ config TOOLCHAIN_HAS_V
|
||||
default y
|
||||
depends on !64BIT || $(cc-option,-mabi=lp64 -march=rv64imv)
|
||||
depends on !32BIT || $(cc-option,-mabi=ilp32 -march=rv32imv)
|
||||
depends on LLD_VERSION >= 140000 || LD_VERSION >= 23800
|
||||
depends on LD_IS_LLD || LD_VERSION >= 23800
|
||||
depends on AS_HAS_OPTION_ARCH
|
||||
|
||||
config RISCV_ISA_V
|
||||
@@ -728,7 +721,7 @@ config TOOLCHAIN_HAS_ZBB
|
||||
default y
|
||||
depends on !64BIT || $(cc-option,-mabi=lp64 -march=rv64ima_zbb)
|
||||
depends on !32BIT || $(cc-option,-mabi=ilp32 -march=rv32ima_zbb)
|
||||
depends on LLD_VERSION >= 150000 || LD_VERSION >= 23900
|
||||
depends on LD_IS_LLD || LD_VERSION >= 23900
|
||||
depends on AS_HAS_OPTION_ARCH
|
||||
|
||||
# This symbol indicates that the toolchain supports all v1.0 vector crypto
|
||||
@@ -743,7 +736,7 @@ config TOOLCHAIN_HAS_ZBA
|
||||
default y
|
||||
depends on !64BIT || $(cc-option,-mabi=lp64 -march=rv64ima_zba)
|
||||
depends on !32BIT || $(cc-option,-mabi=ilp32 -march=rv32ima_zba)
|
||||
depends on LLD_VERSION >= 150000 || LD_VERSION >= 23900
|
||||
depends on LD_IS_LLD || LD_VERSION >= 23900
|
||||
depends on AS_HAS_OPTION_ARCH
|
||||
|
||||
config RISCV_ISA_ZBA
|
||||
@@ -778,7 +771,7 @@ config TOOLCHAIN_HAS_ZBC
|
||||
default y
|
||||
depends on !64BIT || $(cc-option,-mabi=lp64 -march=rv64ima_zbc)
|
||||
depends on !32BIT || $(cc-option,-mabi=ilp32 -march=rv32ima_zbc)
|
||||
depends on LLD_VERSION >= 150000 || LD_VERSION >= 23900
|
||||
depends on LD_IS_LLD || LD_VERSION >= 23900
|
||||
depends on AS_HAS_OPTION_ARCH
|
||||
|
||||
config RISCV_ISA_ZBC
|
||||
@@ -801,7 +794,7 @@ config TOOLCHAIN_HAS_ZBKB
|
||||
default y
|
||||
depends on !64BIT || $(cc-option,-mabi=lp64 -march=rv64ima_zbkb)
|
||||
depends on !32BIT || $(cc-option,-mabi=ilp32 -march=rv32ima_zbkb)
|
||||
depends on LLD_VERSION >= 150000 || LD_VERSION >= 23900
|
||||
depends on LD_IS_LLD || LD_VERSION >= 23900
|
||||
depends on AS_HAS_OPTION_ARCH
|
||||
|
||||
config RISCV_ISA_ZBKB
|
||||
|
||||
+1
-8
@@ -46,17 +46,10 @@ else
|
||||
KBUILD_LDFLAGS += -melf32lriscv
|
||||
endif
|
||||
|
||||
ifndef CONFIG_RISCV_USE_LINKER_RELAXATION
|
||||
KBUILD_CFLAGS += -mno-relax
|
||||
KBUILD_AFLAGS += -mno-relax
|
||||
ifndef CONFIG_AS_IS_LLVM
|
||||
KBUILD_CFLAGS += -Wa,-mno-relax
|
||||
KBUILD_AFLAGS += -Wa,-mno-relax
|
||||
endif
|
||||
# LLVM has an issue with target-features and LTO: https://github.com/llvm/llvm-project/issues/59350
|
||||
# Ensure it is aware of linker relaxation with LTO, otherwise relocations may
|
||||
# be incorrect: https://github.com/llvm/llvm-project/issues/65090
|
||||
else ifeq ($(CONFIG_LTO_CLANG),y)
|
||||
ifeq ($(CONFIG_LTO_CLANG),y)
|
||||
KBUILD_LDFLAGS += -mllvm -mattr=+c -mllvm -mattr=+relax
|
||||
endif
|
||||
|
||||
|
||||
+1
-1
@@ -259,7 +259,7 @@ config DEBUG_INFO_NONE
|
||||
config DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT
|
||||
bool "Rely on the toolchain's implicit default DWARF version"
|
||||
select DEBUG_INFO
|
||||
depends on !CC_IS_CLANG || AS_IS_LLVM || CLANG_VERSION < 140000 || (AS_IS_GNU && AS_VERSION >= 23502 && AS_HAS_NON_CONST_ULEB128)
|
||||
depends on !CC_IS_CLANG || AS_IS_LLVM || (AS_IS_GNU && AS_VERSION >= 23502 && AS_HAS_NON_CONST_ULEB128)
|
||||
help
|
||||
The implicit default version of DWARF debug info produced by a
|
||||
toolchain changes over time.
|
||||
|
||||
@@ -185,12 +185,6 @@ config KCSAN_WEAK_MEMORY
|
||||
bool "Enable weak memory modeling to detect missing memory barriers"
|
||||
default y
|
||||
depends on KCSAN_STRICT
|
||||
# We can either let objtool nop __tsan_func_{entry,exit}() and builtin
|
||||
# atomics instrumentation in .noinstr.text, or use a compiler that can
|
||||
# implement __no_kcsan to really remove all instrumentation.
|
||||
depends on !ARCH_WANTS_NO_INSTR || HAVE_NOINSTR_HACK || \
|
||||
CC_IS_GCC || CLANG_VERSION >= 140000
|
||||
select OBJTOOL if HAVE_NOINSTR_HACK
|
||||
help
|
||||
Enable support for modeling a subset of weak memory, which allows
|
||||
detecting a subset of data races due to missing memory barriers.
|
||||
|
||||
+1
-10
@@ -3,10 +3,7 @@ config HAVE_ARCH_KMSAN
|
||||
bool
|
||||
|
||||
config HAVE_KMSAN_COMPILER
|
||||
# Clang versions <14.0.0 also support -fsanitize=kernel-memory, but not
|
||||
# all the features necessary to build the kernel with KMSAN.
|
||||
depends on CC_IS_CLANG && CLANG_VERSION >= 140000
|
||||
def_bool $(cc-option,-fsanitize=kernel-memory -mllvm -msan-disable-checks=1)
|
||||
def_bool CC_IS_CLANG
|
||||
|
||||
config KMSAN
|
||||
bool "KMSAN: detector of uninitialized values use"
|
||||
@@ -28,15 +25,9 @@ config KMSAN
|
||||
|
||||
if KMSAN
|
||||
|
||||
config HAVE_KMSAN_PARAM_RETVAL
|
||||
# -fsanitize-memory-param-retval is supported only by Clang >= 14.
|
||||
depends on HAVE_KMSAN_COMPILER
|
||||
def_bool $(cc-option,-fsanitize=kernel-memory -fsanitize-memory-param-retval)
|
||||
|
||||
config KMSAN_CHECK_PARAM_RETVAL
|
||||
bool "Check for uninitialized values passed to and returned from functions"
|
||||
default y
|
||||
depends on HAVE_KMSAN_PARAM_RETVAL
|
||||
help
|
||||
If the compiler supports -fsanitize-memory-param-retval, KMSAN will
|
||||
eagerly check every function parameter passed by value and every
|
||||
|
||||
@@ -24,12 +24,10 @@ gcc)
|
||||
fi
|
||||
;;
|
||||
llvm)
|
||||
if [ "$SRCARCH" = s390 -o "$SRCARCH" = x86 ]; then
|
||||
echo 15.0.0
|
||||
elif [ "$SRCARCH" = loongarch ]; then
|
||||
if [ "$SRCARCH" = loongarch ]; then
|
||||
echo 18.0.0
|
||||
else
|
||||
echo 13.0.1
|
||||
echo 15.0.0
|
||||
fi
|
||||
;;
|
||||
rustc)
|
||||
|
||||
@@ -2453,16 +2453,6 @@ static bool is_profiling_func(const char *name)
|
||||
if (!strncmp(name, "__sanitizer_cov_", 16))
|
||||
return true;
|
||||
|
||||
/*
|
||||
* Some compilers currently do not remove __tsan_func_entry/exit nor
|
||||
* __tsan_atomic_signal_fence (used for barrier instrumentation) with
|
||||
* the __no_sanitize_thread attribute, remove them. Once the kernel's
|
||||
* minimum Clang version is 14.0, this can be removed.
|
||||
*/
|
||||
if (!strncmp(name, "__tsan_func_", 12) ||
|
||||
!strcmp(name, "__tsan_atomic_signal_fence"))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user