Skip to content

Commit aa943a2

Browse files
committed
Merge patch series "Bump minimum supported version of LLVM for building the kernel to 15.0.0"
s390 and x86 have required LLVM 15 since 30d17fa ("scripts/min-tool-version.sh: raise minimum clang version to 15.0.0 for s390") 7861640 ("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/[email protected] Signed-off-by: Nathan Chancellor <[email protected]>
2 parents 1e15086 + 5ff8c11 commit aa943a2

File tree

13 files changed

+19
-71
lines changed

13 files changed

+19
-71
lines changed

Documentation/process/changes.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ you probably needn't concern yourself with pcmciautils.
3030
Program Minimal version Command to check the version
3131
====================== =============== ========================================
3232
GNU C 8.1 gcc --version
33-
Clang/LLVM (optional) 13.0.1 clang --version
33+
Clang/LLVM (optional) 15.0.0 clang --version
3434
Rust (optional) 1.78.0 rustc --version
3535
bindgen (optional) 0.65.1 bindgen --version
3636
GNU make 4.0 make --version

arch/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1475,7 +1475,6 @@ config RANDOMIZE_KSTACK_OFFSET
14751475
bool "Support for randomizing kernel stack offset on syscall entry" if EXPERT
14761476
default y
14771477
depends on HAVE_ARCH_RANDOMIZE_KSTACK_OFFSET
1478-
depends on INIT_STACK_NONE || !CC_IS_CLANG || CLANG_VERSION >= 140000
14791478
help
14801479
The kernel stack offset can be randomized (after pt_regs) by
14811480
roughly 5 bits of entropy, frustrating memory corruption

arch/arm/Kconfig

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -166,15 +166,12 @@ config ARM
166166
<http://www.arm.linux.org.uk/>.
167167

168168
config ARM_HAS_GROUP_RELOCS
169-
def_bool y
170-
depends on !LD_IS_LLD || LLD_VERSION >= 140000
171-
depends on !COMPILE_TEST
169+
def_bool !COMPILE_TEST
172170
help
173171
Whether or not to use R_ARM_ALU_PC_Gn or R_ARM_LDR_PC_Gn group
174-
relocations, which have been around for a long time, but were not
175-
supported in LLD until version 14. The combined range is -/+ 256 MiB,
176-
which is usually sufficient, but not for allyesconfig, so we disable
177-
this feature when doing compile testing.
172+
relocations. The combined range is -/+ 256 MiB, which is usually
173+
sufficient, but not for allyesconfig, so we disable this feature
174+
when doing compile testing.
178175

179176
config ARM_DMA_USE_IOMMU
180177
bool

arch/arm64/Kconfig

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1492,8 +1492,6 @@ choice
14921492

14931493
config CPU_BIG_ENDIAN
14941494
bool "Build big-endian kernel"
1495-
# https://github.com/llvm/llvm-project/commit/1379b150991f70a5782e9a143c2ba5308da1161c
1496-
depends on AS_IS_GNU || AS_VERSION >= 150000
14971495
help
14981496
Say Y if you plan on running a kernel with a big-endian userspace.
14991497

@@ -2363,8 +2361,7 @@ config STACKPROTECTOR_PER_TASK
23632361

23642362
config UNWIND_PATCH_PAC_INTO_SCS
23652363
bool "Enable shadow call stack dynamically using code patching"
2366-
# needs Clang with https://github.com/llvm/llvm-project/commit/de07cde67b5d205d58690be012106022aea6d2b3 incorporated
2367-
depends on CC_IS_CLANG && CLANG_VERSION >= 150000
2364+
depends on CC_IS_CLANG
23682365
depends on ARM64_PTR_AUTH_KERNEL && CC_HAS_BRANCH_PROT_PAC_RET
23692366
depends on SHADOW_CALL_STACK
23702367
select UNWIND_TABLES

arch/mips/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ config MIPS
66
select ARCH_BINFMT_ELF_STATE if MIPS_FP_SUPPORT
77
select ARCH_HAS_CPU_CACHE_ALIASING
88
select ARCH_HAS_CPU_FINALIZE_INIT
9-
select ARCH_HAS_CURRENT_STACK_POINTER if !CC_IS_CLANG || CLANG_VERSION >= 140000
9+
select ARCH_HAS_CURRENT_STACK_POINTER
1010
select ARCH_HAS_DEBUG_VIRTUAL if !64BIT
1111
select ARCH_HAS_DMA_OPS if MACH_JAZZ
1212
select ARCH_HAS_FORTIFY_SOURCE

arch/powerpc/include/asm/inst.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,6 @@ static inline int __copy_inst_from_kernel_nofault(ppc_inst_t *inst, u32 *src)
143143
{
144144
unsigned int val, suffix;
145145

146-
/* See https://github.com/ClangBuiltLinux/linux/issues/1521 */
147-
#if defined(CONFIG_CC_IS_CLANG) && CONFIG_CLANG_VERSION < 140000
148-
val = suffix = 0;
149-
#endif
150146
__get_kernel_nofault(&val, src, u32, Efault);
151147
if (IS_ENABLED(CONFIG_PPC64) && get_op(val) == OP_PREFIX) {
152148
__get_kernel_nofault(&suffix, src + 1, u32, Efault);

arch/riscv/Kconfig

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,8 @@ config RISCV
6464
select ARCH_SUPPORTS_DEBUG_PAGEALLOC if MMU
6565
select ARCH_SUPPORTS_HUGE_PFNMAP if TRANSPARENT_HUGEPAGE
6666
select ARCH_SUPPORTS_HUGETLBFS if MMU
67-
# LLD >= 14: https://github.com/llvm/llvm-project/issues/50505
68-
select ARCH_SUPPORTS_LTO_CLANG if LLD_VERSION >= 140000
69-
select ARCH_SUPPORTS_LTO_CLANG_THIN if LLD_VERSION >= 140000
67+
select ARCH_SUPPORTS_LTO_CLANG
68+
select ARCH_SUPPORTS_LTO_CLANG_THIN
7069
select ARCH_SUPPORTS_MSEAL_SYSTEM_MAPPINGS if 64BIT && MMU
7170
select ARCH_SUPPORTS_PAGE_TABLE_CHECK if MMU
7271
select ARCH_SUPPORTS_PER_VMA_LOCK if MMU
@@ -247,15 +246,9 @@ config HAVE_SHADOW_CALL_STACK
247246
# https://github.com/riscv-non-isa/riscv-elf-psabi-doc/commit/a484e843e6eeb51f0cb7b8819e50da6d2444d769
248247
depends on $(ld-option,--no-relax-gp)
249248

250-
config RISCV_USE_LINKER_RELAXATION
251-
def_bool y
252-
# https://github.com/llvm/llvm-project/commit/6611d58f5bbcbec77262d392e2923e1d680f6985
253-
depends on !LD_IS_LLD || LLD_VERSION >= 150000
254-
255249
# https://github.com/llvm/llvm-project/commit/bbc0f99f3bc96f1db16f649fc21dd18e5b0918f6
256250
config ARCH_HAS_BROKEN_DWARF5
257251
def_bool y
258-
depends on RISCV_USE_LINKER_RELAXATION
259252
# https://github.com/llvm/llvm-project/commit/1df5ea29b43690b6622db2cad7b745607ca4de6a
260253
depends on AS_IS_LLVM && AS_VERSION < 180000
261254
# https://github.com/llvm/llvm-project/commit/7ffabb61a5569444b5ac9322e22e5471cc5e4a77
@@ -627,7 +620,7 @@ config TOOLCHAIN_HAS_V
627620
default y
628621
depends on !64BIT || $(cc-option,-mabi=lp64 -march=rv64imv)
629622
depends on !32BIT || $(cc-option,-mabi=ilp32 -march=rv32imv)
630-
depends on LLD_VERSION >= 140000 || LD_VERSION >= 23800
623+
depends on LD_IS_LLD || LD_VERSION >= 23800
631624
depends on AS_HAS_OPTION_ARCH
632625

633626
config RISCV_ISA_V
@@ -728,7 +721,7 @@ config TOOLCHAIN_HAS_ZBB
728721
default y
729722
depends on !64BIT || $(cc-option,-mabi=lp64 -march=rv64ima_zbb)
730723
depends on !32BIT || $(cc-option,-mabi=ilp32 -march=rv32ima_zbb)
731-
depends on LLD_VERSION >= 150000 || LD_VERSION >= 23900
724+
depends on LD_IS_LLD || LD_VERSION >= 23900
732725
depends on AS_HAS_OPTION_ARCH
733726

734727
# This symbol indicates that the toolchain supports all v1.0 vector crypto
@@ -743,7 +736,7 @@ config TOOLCHAIN_HAS_ZBA
743736
default y
744737
depends on !64BIT || $(cc-option,-mabi=lp64 -march=rv64ima_zba)
745738
depends on !32BIT || $(cc-option,-mabi=ilp32 -march=rv32ima_zba)
746-
depends on LLD_VERSION >= 150000 || LD_VERSION >= 23900
739+
depends on LD_IS_LLD || LD_VERSION >= 23900
747740
depends on AS_HAS_OPTION_ARCH
748741

749742
config RISCV_ISA_ZBA
@@ -778,7 +771,7 @@ config TOOLCHAIN_HAS_ZBC
778771
default y
779772
depends on !64BIT || $(cc-option,-mabi=lp64 -march=rv64ima_zbc)
780773
depends on !32BIT || $(cc-option,-mabi=ilp32 -march=rv32ima_zbc)
781-
depends on LLD_VERSION >= 150000 || LD_VERSION >= 23900
774+
depends on LD_IS_LLD || LD_VERSION >= 23900
782775
depends on AS_HAS_OPTION_ARCH
783776

784777
config RISCV_ISA_ZBC
@@ -801,7 +794,7 @@ config TOOLCHAIN_HAS_ZBKB
801794
default y
802795
depends on !64BIT || $(cc-option,-mabi=lp64 -march=rv64ima_zbkb)
803796
depends on !32BIT || $(cc-option,-mabi=ilp32 -march=rv32ima_zbkb)
804-
depends on LLD_VERSION >= 150000 || LD_VERSION >= 23900
797+
depends on LD_IS_LLD || LD_VERSION >= 23900
805798
depends on AS_HAS_OPTION_ARCH
806799

807800
config RISCV_ISA_ZBKB

arch/riscv/Makefile

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,17 +46,10 @@ else
4646
KBUILD_LDFLAGS += -melf32lriscv
4747
endif
4848

49-
ifndef CONFIG_RISCV_USE_LINKER_RELAXATION
50-
KBUILD_CFLAGS += -mno-relax
51-
KBUILD_AFLAGS += -mno-relax
52-
ifndef CONFIG_AS_IS_LLVM
53-
KBUILD_CFLAGS += -Wa,-mno-relax
54-
KBUILD_AFLAGS += -Wa,-mno-relax
55-
endif
5649
# LLVM has an issue with target-features and LTO: https://github.com/llvm/llvm-project/issues/59350
5750
# Ensure it is aware of linker relaxation with LTO, otherwise relocations may
5851
# be incorrect: https://github.com/llvm/llvm-project/issues/65090
59-
else ifeq ($(CONFIG_LTO_CLANG),y)
52+
ifeq ($(CONFIG_LTO_CLANG),y)
6053
KBUILD_LDFLAGS += -mllvm -mattr=+c -mllvm -mattr=+relax
6154
endif
6255

lib/Kconfig.debug

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ config DEBUG_INFO_NONE
259259
config DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT
260260
bool "Rely on the toolchain's implicit default DWARF version"
261261
select DEBUG_INFO
262-
depends on !CC_IS_CLANG || AS_IS_LLVM || CLANG_VERSION < 140000 || (AS_IS_GNU && AS_VERSION >= 23502 && AS_HAS_NON_CONST_ULEB128)
262+
depends on !CC_IS_CLANG || AS_IS_LLVM || (AS_IS_GNU && AS_VERSION >= 23502 && AS_HAS_NON_CONST_ULEB128)
263263
help
264264
The implicit default version of DWARF debug info produced by a
265265
toolchain changes over time.

lib/Kconfig.kcsan

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -185,12 +185,6 @@ config KCSAN_WEAK_MEMORY
185185
bool "Enable weak memory modeling to detect missing memory barriers"
186186
default y
187187
depends on KCSAN_STRICT
188-
# We can either let objtool nop __tsan_func_{entry,exit}() and builtin
189-
# atomics instrumentation in .noinstr.text, or use a compiler that can
190-
# implement __no_kcsan to really remove all instrumentation.
191-
depends on !ARCH_WANTS_NO_INSTR || HAVE_NOINSTR_HACK || \
192-
CC_IS_GCC || CLANG_VERSION >= 140000
193-
select OBJTOOL if HAVE_NOINSTR_HACK
194188
help
195189
Enable support for modeling a subset of weak memory, which allows
196190
detecting a subset of data races due to missing memory barriers.

0 commit comments

Comments
 (0)