llvm.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/10] Bump minimum supported version of LLVM for building the kernel to 15.0.0
@ 2025-08-18 18:57 Nathan Chancellor
  2025-08-18 18:57 ` [PATCH 01/10] kbuild: Bump minimum " Nathan Chancellor
                   ` (10 more replies)
  0 siblings, 11 replies; 21+ messages in thread
From: Nathan Chancellor @ 2025-08-18 18:57 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Arnd Bergmann, Kees Cook, Nick Desaulniers, Bill Wendling,
	Justin Stitt, linux-kernel, llvm, patches, Nathan Chancellor,
	linux-kbuild, linux-hardening, Russell King, Ard Biesheuvel,
	linux-arm-kernel, Catalin Marinas, Will Deacon,
	Thomas Bogendoerfer, linux-mips, Madhavan Srinivasan,
	Michael Ellerman, Nicholas Piggin, Christophe Leroy, linuxppc-dev,
	Palmer Dabbelt, Alexandre Ghiti, linux-riscv, Josh Poimboeuf,
	Peter Zijlstra, Marco Elver, Dmitry Vyukov, kasan-dev,
	Alexander Potapenko

s390 and x86 have required LLVM 15 since

  30d17fac6aae ("scripts/min-tool-version.sh: raise minimum clang version to 15.0.0 for s390")
  7861640aac52 ("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)

I think it makes sense for either Andrew to carry this via -mm on a
nonmm branch or me to carry this via the Kbuild tree, with the
appropriate acks.

---
Nathan Chancellor (10):
      kbuild: Bump minimum version of LLVM for building the kernel to 15.0.0
      arch/Kconfig: Drop always true condition from RANDOMIZE_KSTACK_OFFSET
      ARM: Clean up definition of ARM_HAS_GROUP_RELOCS
      arm64: Remove tautological LLVM Kconfig conditions
      mips: Unconditionally select ARCH_HAS_CURRENT_STACK_POINTER
      powerpc: Drop unnecessary initializations in __copy_inst_from_kernel_nofault()
      riscv: Remove version check for LTO_CLANG selects
      lib/Kconfig.debug: Drop CLANG_VERSION check from DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT
      objtool: Drop noinstr hack for KCSAN_WEAK_MEMORY
      KMSAN: Remove tautological checks

 Documentation/process/changes.rst |  2 +-
 arch/Kconfig                      |  1 -
 arch/arm/Kconfig                  | 11 ++++-------
 arch/arm64/Kconfig                |  5 +----
 arch/mips/Kconfig                 |  2 +-
 arch/powerpc/include/asm/inst.h   |  4 ----
 arch/riscv/Kconfig                |  5 ++---
 lib/Kconfig.debug                 |  2 +-
 lib/Kconfig.kcsan                 |  6 ------
 lib/Kconfig.kmsan                 | 11 +----------
 scripts/min-tool-version.sh       |  6 ++----
 tools/objtool/check.c             | 10 ----------
 12 files changed, 13 insertions(+), 52 deletions(-)
---
base-commit: 8f5ae30d69d7543eee0d70083daf4de8fe15d585
change-id: 20250710-bump-min-llvm-ver-15-95231f1eb655

Best regards,
--  
Nathan Chancellor <nathan@kernel.org>


^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PATCH 01/10] kbuild: Bump minimum version of LLVM for building the kernel to 15.0.0
  2025-08-18 18:57 [PATCH 00/10] Bump minimum supported version of LLVM for building the kernel to 15.0.0 Nathan Chancellor
@ 2025-08-18 18:57 ` Nathan Chancellor
  2025-08-21 16:48   ` Nicolas Schier
  2025-08-21 17:27   ` Arnd Bergmann
  2025-08-18 18:57 ` [PATCH 02/10] arch/Kconfig: Drop always true condition from RANDOMIZE_KSTACK_OFFSET Nathan Chancellor
                   ` (9 subsequent siblings)
  10 siblings, 2 replies; 21+ messages in thread
From: Nathan Chancellor @ 2025-08-18 18:57 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Arnd Bergmann, Kees Cook, Nick Desaulniers, Bill Wendling,
	Justin Stitt, linux-kernel, llvm, patches, Nathan Chancellor,
	linux-kbuild

s390 and x86 have required LLVM 15 since

  30d17fac6aae ("scripts/min-tool-version.sh: raise minimum clang version to 15.0.0 for s390")
  7861640aac52 ("x86/build: Raise the minimum LLVM version to 15.0.0")

respectively but most other architectures allow LLVM 13.0.1 or newer. In
accordance with the recent minimum supported version of GCC bump that
happened in

  118c40b7b503 ("kbuild: require gcc-8 and binutils-2.30")

do the same for LLVM to 15.0.0.

Of the supported releases of Arch Linux, Debian, Fedora, and OpenSUSE
surveyed in evaluating this bump, this only leaves behind Debian
Bookworm (14.0.6) and Ubuntu Jammy (14.0.0). Debian Trixie has 19.1.7
and Ubuntu Noble has 18.1.3 (so there are viable upgrade paths) or users
can use apt.llvm.org, which provides even newer packages for those
distributions.

Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
Cc: linux-kbuild@vger.kernel.org
---
 Documentation/process/changes.rst | 2 +-
 scripts/min-tool-version.sh       | 6 ++----
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/Documentation/process/changes.rst b/Documentation/process/changes.rst
index bccfa19b45df..b38622b0d525 100644
--- a/Documentation/process/changes.rst
+++ b/Documentation/process/changes.rst
@@ -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
diff --git a/scripts/min-tool-version.sh b/scripts/min-tool-version.sh
index 0d223b4a9445..99b5575c1ef7 100755
--- a/scripts/min-tool-version.sh
+++ b/scripts/min-tool-version.sh
@@ -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)

-- 
2.50.1


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH 02/10] arch/Kconfig: Drop always true condition from RANDOMIZE_KSTACK_OFFSET
  2025-08-18 18:57 [PATCH 00/10] Bump minimum supported version of LLVM for building the kernel to 15.0.0 Nathan Chancellor
  2025-08-18 18:57 ` [PATCH 01/10] kbuild: Bump minimum " Nathan Chancellor
@ 2025-08-18 18:57 ` Nathan Chancellor
  2025-08-18 18:57 ` [PATCH 03/10] ARM: Clean up definition of ARM_HAS_GROUP_RELOCS Nathan Chancellor
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 21+ messages in thread
From: Nathan Chancellor @ 2025-08-18 18:57 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Arnd Bergmann, Kees Cook, Nick Desaulniers, Bill Wendling,
	Justin Stitt, linux-kernel, llvm, patches, Nathan Chancellor,
	linux-hardening

Now that the minimum supported version of LLVM for building the kernel
has been bumped to 15.0.0, the second depends line in
RANDOMIZE_KSTACK_OFFSET is always true, so it can be removed.

Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
Cc: linux-hardening@vger.kernel.org
---
 arch/Kconfig | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/Kconfig b/arch/Kconfig
index d1b4ffd6e085..4935c4c26f09 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -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

-- 
2.50.1


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH 03/10] ARM: Clean up definition of ARM_HAS_GROUP_RELOCS
  2025-08-18 18:57 [PATCH 00/10] Bump minimum supported version of LLVM for building the kernel to 15.0.0 Nathan Chancellor
  2025-08-18 18:57 ` [PATCH 01/10] kbuild: Bump minimum " Nathan Chancellor
  2025-08-18 18:57 ` [PATCH 02/10] arch/Kconfig: Drop always true condition from RANDOMIZE_KSTACK_OFFSET Nathan Chancellor
@ 2025-08-18 18:57 ` Nathan Chancellor
  2025-08-18 18:57 ` [PATCH 04/10] arm64: Remove tautological LLVM Kconfig conditions Nathan Chancellor
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 21+ messages in thread
From: Nathan Chancellor @ 2025-08-18 18:57 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Arnd Bergmann, Kees Cook, Nick Desaulniers, Bill Wendling,
	Justin Stitt, linux-kernel, llvm, patches, Nathan Chancellor,
	Russell King, Ard Biesheuvel, linux-arm-kernel

Now that the minimum supported version of LLVM for building the kernel
has been bumped to 15.0.0, the first depends line of
ARM_HAS_GROUP_RELOCS is always true, so it can be safely removed.
Combine the !COMPILE_TEST dependency into the 'def_bool' line and update
the comment as well.

Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
Cc: Russell King <linux@armlinux.org.uk>
Cc: Ard Biesheuvel <ardb@kernel.org>
Cc: linux-arm-kernel@lists.infradead.org
---
 arch/arm/Kconfig | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index b1f3df39ed40..faf83015b961 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -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

-- 
2.50.1


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH 04/10] arm64: Remove tautological LLVM Kconfig conditions
  2025-08-18 18:57 [PATCH 00/10] Bump minimum supported version of LLVM for building the kernel to 15.0.0 Nathan Chancellor
                   ` (2 preceding siblings ...)
  2025-08-18 18:57 ` [PATCH 03/10] ARM: Clean up definition of ARM_HAS_GROUP_RELOCS Nathan Chancellor
@ 2025-08-18 18:57 ` Nathan Chancellor
  2025-08-19 11:35   ` Will Deacon
  2025-08-18 18:57 ` [PATCH 05/10] mips: Unconditionally select ARCH_HAS_CURRENT_STACK_POINTER Nathan Chancellor
                   ` (6 subsequent siblings)
  10 siblings, 1 reply; 21+ messages in thread
From: Nathan Chancellor @ 2025-08-18 18:57 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Arnd Bergmann, Kees Cook, Nick Desaulniers, Bill Wendling,
	Justin Stitt, linux-kernel, llvm, patches, Nathan Chancellor,
	Catalin Marinas, Will Deacon, linux-arm-kernel

Now that the minimum supported version of LLVM for building the kernel
has been bumped to 15.0.0, two sets of always true conditions can be
safely removed in the arm64 Kconfig file.

Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
---
 arch/arm64/Kconfig | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index e9bbfacc35a6..41c05562e9af 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -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

-- 
2.50.1


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH 05/10] mips: Unconditionally select ARCH_HAS_CURRENT_STACK_POINTER
  2025-08-18 18:57 [PATCH 00/10] Bump minimum supported version of LLVM for building the kernel to 15.0.0 Nathan Chancellor
                   ` (3 preceding siblings ...)
  2025-08-18 18:57 ` [PATCH 04/10] arm64: Remove tautological LLVM Kconfig conditions Nathan Chancellor
@ 2025-08-18 18:57 ` Nathan Chancellor
  2025-08-19 12:08   ` Thomas Bogendoerfer
  2025-08-18 18:57 ` [PATCH 06/10] powerpc: Drop unnecessary initializations in __copy_inst_from_kernel_nofault() Nathan Chancellor
                   ` (5 subsequent siblings)
  10 siblings, 1 reply; 21+ messages in thread
From: Nathan Chancellor @ 2025-08-18 18:57 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Arnd Bergmann, Kees Cook, Nick Desaulniers, Bill Wendling,
	Justin Stitt, linux-kernel, llvm, patches, Nathan Chancellor,
	Thomas Bogendoerfer, linux-mips

Now that the minimum supported version of LLVM for building the kernel
has been bumped to 15.0.0, the selection of
ARCH_HAS_CURRENT_STACK_POINTER can be made unconditional since it is
always true.

Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: linux-mips@vger.kernel.org
---
 arch/mips/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index caf508f6e9ec..bc7473505f4a 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -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

-- 
2.50.1


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH 06/10] powerpc: Drop unnecessary initializations in __copy_inst_from_kernel_nofault()
  2025-08-18 18:57 [PATCH 00/10] Bump minimum supported version of LLVM for building the kernel to 15.0.0 Nathan Chancellor
                   ` (4 preceding siblings ...)
  2025-08-18 18:57 ` [PATCH 05/10] mips: Unconditionally select ARCH_HAS_CURRENT_STACK_POINTER Nathan Chancellor
@ 2025-08-18 18:57 ` Nathan Chancellor
  2025-08-18 18:57 ` [PATCH 07/10] riscv: Remove version check for LTO_CLANG selects Nathan Chancellor
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 21+ messages in thread
From: Nathan Chancellor @ 2025-08-18 18:57 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Arnd Bergmann, Kees Cook, Nick Desaulniers, Bill Wendling,
	Justin Stitt, linux-kernel, llvm, patches, Nathan Chancellor,
	Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin,
	Christophe Leroy, linuxppc-dev

Now that the minimum supported version of LLVM for building the kernel
has been bumped to 15.0.0, the zero initializations of val and suffix
added by commit 0d76914a4c99 ("powerpc/inst: Optimise
copy_inst_from_kernel_nofault()") to avoid a bogus case of
-Wuninitialized can be dropped because the preprocessor condition is
always false.

Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
Cc: Madhavan Srinivasan <maddy@linux.ibm.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Nicholas Piggin <npiggin@gmail.com>
Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
Cc: linuxppc-dev@lists.ozlabs.org
---
 arch/powerpc/include/asm/inst.h | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/arch/powerpc/include/asm/inst.h b/arch/powerpc/include/asm/inst.h
index 684d3f453282..ffa82167c860 100644
--- a/arch/powerpc/include/asm/inst.h
+++ b/arch/powerpc/include/asm/inst.h
@@ -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);

-- 
2.50.1


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH 07/10] riscv: Remove version check for LTO_CLANG selects
  2025-08-18 18:57 [PATCH 00/10] Bump minimum supported version of LLVM for building the kernel to 15.0.0 Nathan Chancellor
                   ` (5 preceding siblings ...)
  2025-08-18 18:57 ` [PATCH 06/10] powerpc: Drop unnecessary initializations in __copy_inst_from_kernel_nofault() Nathan Chancellor
@ 2025-08-18 18:57 ` Nathan Chancellor
  2025-08-20  7:23   ` Alexandre Ghiti
  2025-08-18 18:57 ` [PATCH 08/10] lib/Kconfig.debug: Drop CLANG_VERSION check from DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT Nathan Chancellor
                   ` (3 subsequent siblings)
  10 siblings, 1 reply; 21+ messages in thread
From: Nathan Chancellor @ 2025-08-18 18:57 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Arnd Bergmann, Kees Cook, Nick Desaulniers, Bill Wendling,
	Justin Stitt, linux-kernel, llvm, patches, Nathan Chancellor,
	Palmer Dabbelt, Alexandre Ghiti, linux-riscv

Now that the minimum supported version of LLVM for building the kernel
has been bumped to 15.0.0, there is no need to check the LLD version
before selecting ARCH_SUPPORTS_LTO_CLANG{,_THIN} because it will always
be true.

Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
Cc: Palmer Dabbelt <palmer@dabbelt.com>
Cc: Alexandre Ghiti <alex@ghiti.fr>
Cc: linux-riscv@lists.infradead.org

Small note, this will conflict with
https://lore.kernel.org/20250710-riscv-restrict-lto-to-medany-v1-1-b1dac9871ecf@kernel.org/
but I think it is simple enough to deal with.
---
 arch/riscv/Kconfig | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
index a4b233a0659e..1d53bf02d0fa 100644
--- a/arch/riscv/Kconfig
+++ b/arch/riscv/Kconfig
@@ -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

-- 
2.50.1


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH 08/10] lib/Kconfig.debug: Drop CLANG_VERSION check from DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT
  2025-08-18 18:57 [PATCH 00/10] Bump minimum supported version of LLVM for building the kernel to 15.0.0 Nathan Chancellor
                   ` (6 preceding siblings ...)
  2025-08-18 18:57 ` [PATCH 07/10] riscv: Remove version check for LTO_CLANG selects Nathan Chancellor
@ 2025-08-18 18:57 ` Nathan Chancellor
  2025-08-18 18:57 ` [PATCH 09/10] objtool: Drop noinstr hack for KCSAN_WEAK_MEMORY Nathan Chancellor
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 21+ messages in thread
From: Nathan Chancellor @ 2025-08-18 18:57 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Arnd Bergmann, Kees Cook, Nick Desaulniers, Bill Wendling,
	Justin Stitt, linux-kernel, llvm, patches, Nathan Chancellor

Now that the minimum supported version of LLVM for building the kernel
has been bumped to 15.0.0, the CLANG_VERSION check for older than 14.0.0
is always false, so remove it.

Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
 lib/Kconfig.debug | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index dc0e0c6ed075..6c12852e77c8 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -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.

-- 
2.50.1


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH 09/10] objtool: Drop noinstr hack for KCSAN_WEAK_MEMORY
  2025-08-18 18:57 [PATCH 00/10] Bump minimum supported version of LLVM for building the kernel to 15.0.0 Nathan Chancellor
                   ` (7 preceding siblings ...)
  2025-08-18 18:57 ` [PATCH 08/10] lib/Kconfig.debug: Drop CLANG_VERSION check from DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT Nathan Chancellor
@ 2025-08-18 18:57 ` Nathan Chancellor
  2025-08-18 19:12   ` Peter Zijlstra
  2025-08-19 10:35   ` Marco Elver
  2025-08-18 18:57 ` [PATCH 10/10] KMSAN: Remove tautological checks Nathan Chancellor
  2025-08-19  0:55 ` [PATCH 00/10] Bump minimum supported version of LLVM for building the kernel to 15.0.0 Kees Cook
  10 siblings, 2 replies; 21+ messages in thread
From: Nathan Chancellor @ 2025-08-18 18:57 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Arnd Bergmann, Kees Cook, Nick Desaulniers, Bill Wendling,
	Justin Stitt, linux-kernel, llvm, patches, Nathan Chancellor,
	Josh Poimboeuf, Peter Zijlstra, Marco Elver, Dmitry Vyukov,
	kasan-dev

Now that the minimum supported version of LLVM for building the kernel
has been bumped to 15.0.0, __no_kcsan will always ensure that the thread
sanitizer functions are not generated, so remove the check for tsan
functions in is_profiling_func() and the always true depends and
unnecessary select lines in KCSAN_WEAK_MEMORY.

Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
Cc: Josh Poimboeuf <jpoimboe@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Marco Elver <elver@google.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: kasan-dev@googlegroups.com
---
 lib/Kconfig.kcsan     |  6 ------
 tools/objtool/check.c | 10 ----------
 2 files changed, 16 deletions(-)

diff --git a/lib/Kconfig.kcsan b/lib/Kconfig.kcsan
index 609ddfc73de5..4ce4b0c0109c 100644
--- a/lib/Kconfig.kcsan
+++ b/lib/Kconfig.kcsan
@@ -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.
diff --git a/tools/objtool/check.c b/tools/objtool/check.c
index d14f20ef1db1..efa4c060ff4e 100644
--- a/tools/objtool/check.c
+++ b/tools/objtool/check.c
@@ -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;
 }
 

-- 
2.50.1


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH 10/10] KMSAN: Remove tautological checks
  2025-08-18 18:57 [PATCH 00/10] Bump minimum supported version of LLVM for building the kernel to 15.0.0 Nathan Chancellor
                   ` (8 preceding siblings ...)
  2025-08-18 18:57 ` [PATCH 09/10] objtool: Drop noinstr hack for KCSAN_WEAK_MEMORY Nathan Chancellor
@ 2025-08-18 18:57 ` Nathan Chancellor
  2025-08-19 11:02   ` Marco Elver
  2025-08-19  0:55 ` [PATCH 00/10] Bump minimum supported version of LLVM for building the kernel to 15.0.0 Kees Cook
  10 siblings, 1 reply; 21+ messages in thread
From: Nathan Chancellor @ 2025-08-18 18:57 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Arnd Bergmann, Kees Cook, Nick Desaulniers, Bill Wendling,
	Justin Stitt, linux-kernel, llvm, patches, Nathan Chancellor,
	Alexander Potapenko, Marco Elver, Dmitry Vyukov, kasan-dev

Now that the minimum supported version of LLVM for building the kernel
has been bumped to 15.0.0, two KMSAN checks can be cleaned up.

CONFIG_HAVE_KMSAN_COMPILER will always be true when using clang so
remove the cc-option test and use a simple check for CONFIG_CC_IS_CLANG.

CONFIG_HAVE_KMSAN_PARAM_RETVAL will always be true so it can be removed
outright.

Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
Cc: Alexander Potapenko <glider@google.com>
Cc: Marco Elver <elver@google.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: kasan-dev@googlegroups.com
---
 lib/Kconfig.kmsan | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/lib/Kconfig.kmsan b/lib/Kconfig.kmsan
index 0541d7b079cc..7251b6b59e69 100644
--- a/lib/Kconfig.kmsan
+++ b/lib/Kconfig.kmsan
@@ -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

-- 
2.50.1


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* Re: [PATCH 09/10] objtool: Drop noinstr hack for KCSAN_WEAK_MEMORY
  2025-08-18 18:57 ` [PATCH 09/10] objtool: Drop noinstr hack for KCSAN_WEAK_MEMORY Nathan Chancellor
@ 2025-08-18 19:12   ` Peter Zijlstra
  2025-08-19 10:35   ` Marco Elver
  1 sibling, 0 replies; 21+ messages in thread
From: Peter Zijlstra @ 2025-08-18 19:12 UTC (permalink / raw)
  To: Nathan Chancellor
  Cc: Andrew Morton, Arnd Bergmann, Kees Cook, Nick Desaulniers,
	Bill Wendling, Justin Stitt, linux-kernel, llvm, patches,
	Josh Poimboeuf, Marco Elver, Dmitry Vyukov, kasan-dev

On Mon, Aug 18, 2025 at 11:57:25AM -0700, Nathan Chancellor wrote:
> Now that the minimum supported version of LLVM for building the kernel
> has been bumped to 15.0.0, __no_kcsan will always ensure that the thread
> sanitizer functions are not generated, so remove the check for tsan
> functions in is_profiling_func() and the always true depends and
> unnecessary select lines in KCSAN_WEAK_MEMORY.
> 
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>

Acked-by: Peter Zijlstra (Intel) <peterz@infraded.org>

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH 00/10] Bump minimum supported version of LLVM for building the kernel to 15.0.0
  2025-08-18 18:57 [PATCH 00/10] Bump minimum supported version of LLVM for building the kernel to 15.0.0 Nathan Chancellor
                   ` (9 preceding siblings ...)
  2025-08-18 18:57 ` [PATCH 10/10] KMSAN: Remove tautological checks Nathan Chancellor
@ 2025-08-19  0:55 ` Kees Cook
  10 siblings, 0 replies; 21+ messages in thread
From: Kees Cook @ 2025-08-19  0:55 UTC (permalink / raw)
  To: Nathan Chancellor
  Cc: Andrew Morton, Arnd Bergmann, Nick Desaulniers, Bill Wendling,
	Justin Stitt, linux-kernel, llvm, patches, linux-kbuild,
	linux-hardening, Russell King, Ard Biesheuvel, linux-arm-kernel,
	Catalin Marinas, Will Deacon, Thomas Bogendoerfer, linux-mips,
	Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin,
	Christophe Leroy, linuxppc-dev, Palmer Dabbelt, Alexandre Ghiti,
	linux-riscv, Josh Poimboeuf, Peter Zijlstra, Marco Elver,
	Dmitry Vyukov, kasan-dev, Alexander Potapenko

On Mon, Aug 18, 2025 at 11:57:16AM -0700, Nathan Chancellor wrote:
> s390 and x86 have required LLVM 15 since
>
>   30d17fac6aae ("scripts/min-tool-version.sh: raise minimum clang version to 15.0.0 for s390")
>   7861640aac52 ("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.

Looks good to me!

Reviewed-by: Kees Cook <kees@kernel.org>

> I think it makes sense for either Andrew to carry this via -mm on a
> nonmm branch or me to carry this via the Kbuild tree, with the
> appropriate acks.

I vote you carry it with Kbuild. :)

--
Kees Cook

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH 09/10] objtool: Drop noinstr hack for KCSAN_WEAK_MEMORY
  2025-08-18 18:57 ` [PATCH 09/10] objtool: Drop noinstr hack for KCSAN_WEAK_MEMORY Nathan Chancellor
  2025-08-18 19:12   ` Peter Zijlstra
@ 2025-08-19 10:35   ` Marco Elver
  1 sibling, 0 replies; 21+ messages in thread
From: Marco Elver @ 2025-08-19 10:35 UTC (permalink / raw)
  To: Nathan Chancellor
  Cc: Andrew Morton, Arnd Bergmann, Kees Cook, Nick Desaulniers,
	Bill Wendling, Justin Stitt, linux-kernel, llvm, patches,
	Josh Poimboeuf, Peter Zijlstra, Dmitry Vyukov, kasan-dev

On Mon, 18 Aug 2025 at 20:58, Nathan Chancellor <nathan@kernel.org> wrote:
>
> Now that the minimum supported version of LLVM for building the kernel
> has been bumped to 15.0.0, __no_kcsan will always ensure that the thread
> sanitizer functions are not generated, so remove the check for tsan
> functions in is_profiling_func() and the always true depends and
> unnecessary select lines in KCSAN_WEAK_MEMORY.
>
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>

Acked-by: Marco Elver <elver@google.com>

Good riddance.

> ---
> Cc: Josh Poimboeuf <jpoimboe@kernel.org>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Marco Elver <elver@google.com>
> Cc: Dmitry Vyukov <dvyukov@google.com>
> Cc: kasan-dev@googlegroups.com
> ---
>  lib/Kconfig.kcsan     |  6 ------
>  tools/objtool/check.c | 10 ----------
>  2 files changed, 16 deletions(-)
>
> diff --git a/lib/Kconfig.kcsan b/lib/Kconfig.kcsan
> index 609ddfc73de5..4ce4b0c0109c 100644
> --- a/lib/Kconfig.kcsan
> +++ b/lib/Kconfig.kcsan
> @@ -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.
> diff --git a/tools/objtool/check.c b/tools/objtool/check.c
> index d14f20ef1db1..efa4c060ff4e 100644
> --- a/tools/objtool/check.c
> +++ b/tools/objtool/check.c
> @@ -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;
>  }
>
>
> --
> 2.50.1
>

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH 10/10] KMSAN: Remove tautological checks
  2025-08-18 18:57 ` [PATCH 10/10] KMSAN: Remove tautological checks Nathan Chancellor
@ 2025-08-19 11:02   ` Marco Elver
  0 siblings, 0 replies; 21+ messages in thread
From: Marco Elver @ 2025-08-19 11:02 UTC (permalink / raw)
  To: Nathan Chancellor
  Cc: Andrew Morton, Arnd Bergmann, Kees Cook, Nick Desaulniers,
	Bill Wendling, Justin Stitt, linux-kernel, llvm, patches,
	Alexander Potapenko, Dmitry Vyukov, kasan-dev

On Mon, 18 Aug 2025 at 20:58, Nathan Chancellor <nathan@kernel.org> wrote:
>
> Now that the minimum supported version of LLVM for building the kernel
> has been bumped to 15.0.0, two KMSAN checks can be cleaned up.
>
> CONFIG_HAVE_KMSAN_COMPILER will always be true when using clang so
> remove the cc-option test and use a simple check for CONFIG_CC_IS_CLANG.
>
> CONFIG_HAVE_KMSAN_PARAM_RETVAL will always be true so it can be removed
> outright.
>
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>

Acked-by: Marco Elver <elver@google.com>

> ---
> Cc: Alexander Potapenko <glider@google.com>
> Cc: Marco Elver <elver@google.com>
> Cc: Dmitry Vyukov <dvyukov@google.com>
> Cc: kasan-dev@googlegroups.com
> ---
>  lib/Kconfig.kmsan | 11 +----------
>  1 file changed, 1 insertion(+), 10 deletions(-)
>
> diff --git a/lib/Kconfig.kmsan b/lib/Kconfig.kmsan
> index 0541d7b079cc..7251b6b59e69 100644
> --- a/lib/Kconfig.kmsan
> +++ b/lib/Kconfig.kmsan
> @@ -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
>
> --
> 2.50.1
>

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH 04/10] arm64: Remove tautological LLVM Kconfig conditions
  2025-08-18 18:57 ` [PATCH 04/10] arm64: Remove tautological LLVM Kconfig conditions Nathan Chancellor
@ 2025-08-19 11:35   ` Will Deacon
  0 siblings, 0 replies; 21+ messages in thread
From: Will Deacon @ 2025-08-19 11:35 UTC (permalink / raw)
  To: Nathan Chancellor
  Cc: Andrew Morton, Arnd Bergmann, Kees Cook, Nick Desaulniers,
	Bill Wendling, Justin Stitt, linux-kernel, llvm, patches,
	Catalin Marinas, linux-arm-kernel

On Mon, Aug 18, 2025 at 11:57:20AM -0700, Nathan Chancellor wrote:
> Now that the minimum supported version of LLVM for building the kernel
> has been bumped to 15.0.0, two sets of always true conditions can be
> safely removed in the arm64 Kconfig file.
> 
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>
> ---
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Will Deacon <will@kernel.org>
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: linux-kernel@vger.kernel.org
> ---
>  arch/arm64/Kconfig | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)

Acked-by: Will Deacon <will@kernel.org>

Will

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH 05/10] mips: Unconditionally select ARCH_HAS_CURRENT_STACK_POINTER
  2025-08-18 18:57 ` [PATCH 05/10] mips: Unconditionally select ARCH_HAS_CURRENT_STACK_POINTER Nathan Chancellor
@ 2025-08-19 12:08   ` Thomas Bogendoerfer
  0 siblings, 0 replies; 21+ messages in thread
From: Thomas Bogendoerfer @ 2025-08-19 12:08 UTC (permalink / raw)
  To: Nathan Chancellor
  Cc: Andrew Morton, Arnd Bergmann, Kees Cook, Nick Desaulniers,
	Bill Wendling, Justin Stitt, linux-kernel, llvm, patches,
	linux-mips

On Mon, Aug 18, 2025 at 11:57:21AM -0700, Nathan Chancellor wrote:
> Now that the minimum supported version of LLVM for building the kernel
> has been bumped to 15.0.0, the selection of
> ARCH_HAS_CURRENT_STACK_POINTER can be made unconditional since it is
> always true.
> 
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>
> ---
> Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
> Cc: linux-mips@vger.kernel.org
> ---
>  arch/mips/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
> index caf508f6e9ec..bc7473505f4a 100644
> --- a/arch/mips/Kconfig
> +++ b/arch/mips/Kconfig
> @@ -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
> 
> -- 
> 2.50.1

Acked-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>

-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea.                                                [ RFC1925, 2.3 ]

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH 07/10] riscv: Remove version check for LTO_CLANG selects
  2025-08-18 18:57 ` [PATCH 07/10] riscv: Remove version check for LTO_CLANG selects Nathan Chancellor
@ 2025-08-20  7:23   ` Alexandre Ghiti
  2025-08-20 16:11     ` Nathan Chancellor
  0 siblings, 1 reply; 21+ messages in thread
From: Alexandre Ghiti @ 2025-08-20  7:23 UTC (permalink / raw)
  To: Nathan Chancellor, Andrew Morton
  Cc: Arnd Bergmann, Kees Cook, Nick Desaulniers, Bill Wendling,
	Justin Stitt, linux-kernel, llvm, patches, Palmer Dabbelt,
	linux-riscv

Hi Nathan,

On 8/18/25 20:57, Nathan Chancellor wrote:
> Now that the minimum supported version of LLVM for building the kernel
> has been bumped to 15.0.0, there is no need to check the LLD version
> before selecting ARCH_SUPPORTS_LTO_CLANG{,_THIN} because it will always
> be true.
>
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>
> ---
> Cc: Palmer Dabbelt <palmer@dabbelt.com>
> Cc: Alexandre Ghiti <alex@ghiti.fr>
> Cc: linux-riscv@lists.infradead.org
>
> Small note, this will conflict with
> https://lore.kernel.org/20250710-riscv-restrict-lto-to-medany-v1-1-b1dac9871ecf@kernel.org/
> but I think it is simple enough to deal with.


FYI, I'll send this patch for some 6.17-rcX.


> ---
>   arch/riscv/Kconfig | 5 ++---
>   1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
> index a4b233a0659e..1d53bf02d0fa 100644
> --- a/arch/riscv/Kconfig
> +++ b/arch/riscv/Kconfig
> @@ -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
>

I found another bunch of LLD_VERSION check in this file that could be 
removed:

https://elixir.bootlin.com/linux/v6.17-rc2/source/arch/riscv/Kconfig#L253
https://elixir.bootlin.com/linux/v6.17-rc2/source/arch/riscv/Kconfig#L262
https://elixir.bootlin.com/linux/v6.17-rc2/source/arch/riscv/Kconfig#L630
https://elixir.bootlin.com/linux/v6.17-rc2/source/arch/riscv/Kconfig#L731
https://elixir.bootlin.com/linux/v6.17-rc2/source/arch/riscv/Kconfig#L746
https://elixir.bootlin.com/linux/v6.17-rc2/source/arch/riscv/Kconfig#L781
https://elixir.bootlin.com/linux/v6.17-rc2/source/arch/riscv/Kconfig#L804

Thanks,

Alex


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH 07/10] riscv: Remove version check for LTO_CLANG selects
  2025-08-20  7:23   ` Alexandre Ghiti
@ 2025-08-20 16:11     ` Nathan Chancellor
  0 siblings, 0 replies; 21+ messages in thread
From: Nathan Chancellor @ 2025-08-20 16:11 UTC (permalink / raw)
  To: Alexandre Ghiti
  Cc: Andrew Morton, Arnd Bergmann, Kees Cook, Nick Desaulniers,
	Bill Wendling, Justin Stitt, linux-kernel, llvm, patches,
	Palmer Dabbelt, linux-riscv

On Wed, Aug 20, 2025 at 09:23:08AM +0200, Alexandre Ghiti wrote:
> Hi Nathan,
> 
> On 8/18/25 20:57, Nathan Chancellor wrote:
> > Now that the minimum supported version of LLVM for building the kernel
> > has been bumped to 15.0.0, there is no need to check the LLD version
> > before selecting ARCH_SUPPORTS_LTO_CLANG{,_THIN} because it will always
> > be true.
> > 
> > Signed-off-by: Nathan Chancellor <nathan@kernel.org>
> > ---
> > Cc: Palmer Dabbelt <palmer@dabbelt.com>
> > Cc: Alexandre Ghiti <alex@ghiti.fr>
> > Cc: linux-riscv@lists.infradead.org
> > 
> > Small note, this will conflict with
> > https://lore.kernel.org/20250710-riscv-restrict-lto-to-medany-v1-1-b1dac9871ecf@kernel.org/
> > but I think it is simple enough to deal with.
> 
> FYI, I'll send this patch for some 6.17-rcX.

Thanks, that would help.

> I found another bunch of LLD_VERSION check in this file that could be
> removed:

Huh, I am very surprised that I missed those :/ thanks a lot for
catching that!

> https://elixir.bootlin.com/linux/v6.17-rc2/source/arch/riscv/Kconfig#L253

I have added a patch removing CONFIG_RISCV_USE_LINKER_RELAXATION.

> https://elixir.bootlin.com/linux/v6.17-rc2/source/arch/riscv/Kconfig#L262

I don't think this one can be currently cleaned up since it won't always
be either true or false.

> https://elixir.bootlin.com/linux/v6.17-rc2/source/arch/riscv/Kconfig#L630
> https://elixir.bootlin.com/linux/v6.17-rc2/source/arch/riscv/Kconfig#L731
> https://elixir.bootlin.com/linux/v6.17-rc2/source/arch/riscv/Kconfig#L746
> https://elixir.bootlin.com/linux/v6.17-rc2/source/arch/riscv/Kconfig#L781
> https://elixir.bootlin.com/linux/v6.17-rc2/source/arch/riscv/Kconfig#L804

I have added a patch converting those version checks to just LD_IS_LLD.

Cheers,
Nathan

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH 01/10] kbuild: Bump minimum version of LLVM for building the kernel to 15.0.0
  2025-08-18 18:57 ` [PATCH 01/10] kbuild: Bump minimum " Nathan Chancellor
@ 2025-08-21 16:48   ` Nicolas Schier
  2025-08-21 17:27   ` Arnd Bergmann
  1 sibling, 0 replies; 21+ messages in thread
From: Nicolas Schier @ 2025-08-21 16:48 UTC (permalink / raw)
  To: Nathan Chancellor
  Cc: Andrew Morton, Arnd Bergmann, Kees Cook, Nick Desaulniers,
	Bill Wendling, Justin Stitt, linux-kernel, llvm, patches,
	linux-kbuild

On Mon, Aug 18, 2025 at 11:57:17AM -0700, Nathan Chancellor wrote:
> s390 and x86 have required LLVM 15 since
> 
>   30d17fac6aae ("scripts/min-tool-version.sh: raise minimum clang version to 15.0.0 for s390")
>   7861640aac52 ("x86/build: Raise the minimum LLVM version to 15.0.0")
> 
> respectively but most other architectures allow LLVM 13.0.1 or newer. In
> accordance with the recent minimum supported version of GCC bump that
> happened in
> 
>   118c40b7b503 ("kbuild: require gcc-8 and binutils-2.30")
> 
> do the same for LLVM to 15.0.0.
> 
> Of the supported releases of Arch Linux, Debian, Fedora, and OpenSUSE
> surveyed in evaluating this bump, this only leaves behind Debian
> Bookworm (14.0.6) and Ubuntu Jammy (14.0.0). Debian Trixie has 19.1.7
> and Ubuntu Noble has 18.1.3 (so there are viable upgrade paths) or users
> can use apt.llvm.org, which provides even newer packages for those
> distributions.
> 
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>
> ---
> Cc: linux-kbuild@vger.kernel.org
> ---
>  Documentation/process/changes.rst | 2 +-
>  scripts/min-tool-version.sh       | 6 ++----
>  2 files changed, 3 insertions(+), 5 deletions(-)
> 

Acked-by: Nicolas Schier <nsc@kernel.org>

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH 01/10] kbuild: Bump minimum version of LLVM for building the kernel to 15.0.0
  2025-08-18 18:57 ` [PATCH 01/10] kbuild: Bump minimum " Nathan Chancellor
  2025-08-21 16:48   ` Nicolas Schier
@ 2025-08-21 17:27   ` Arnd Bergmann
  1 sibling, 0 replies; 21+ messages in thread
From: Arnd Bergmann @ 2025-08-21 17:27 UTC (permalink / raw)
  To: Nathan Chancellor, Andrew Morton
  Cc: Kees Cook, Nick Desaulniers, Bill Wendling, Justin Stitt,
	linux-kernel, llvm, patches, linux-kbuild

On Mon, Aug 18, 2025, at 20:57, Nathan Chancellor wrote:
> s390 and x86 have required LLVM 15 since
>
>   30d17fac6aae ("scripts/min-tool-version.sh: raise minimum clang 
> version to 15.0.0 for s390")
>   7861640aac52 ("x86/build: Raise the minimum LLVM version to 15.0.0")
>
> respectively but most other architectures allow LLVM 13.0.1 or newer. In
> accordance with the recent minimum supported version of GCC bump that
> happened in
>
>   118c40b7b503 ("kbuild: require gcc-8 and binutils-2.30")
>
> do the same for LLVM to 15.0.0.
>
> Of the supported releases of Arch Linux, Debian, Fedora, and OpenSUSE
> surveyed in evaluating this bump, this only leaves behind Debian
> Bookworm (14.0.6) and Ubuntu Jammy (14.0.0). Debian Trixie has 19.1.7
> and Ubuntu Noble has 18.1.3 (so there are viable upgrade paths) or users
> can use apt.llvm.org, which provides even newer packages for those
> distributions.
>
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>
> ---

Acked-by: Arnd Bergmann <arnd@arndb.de>

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2025-08-21 17:27 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-18 18:57 [PATCH 00/10] Bump minimum supported version of LLVM for building the kernel to 15.0.0 Nathan Chancellor
2025-08-18 18:57 ` [PATCH 01/10] kbuild: Bump minimum " Nathan Chancellor
2025-08-21 16:48   ` Nicolas Schier
2025-08-21 17:27   ` Arnd Bergmann
2025-08-18 18:57 ` [PATCH 02/10] arch/Kconfig: Drop always true condition from RANDOMIZE_KSTACK_OFFSET Nathan Chancellor
2025-08-18 18:57 ` [PATCH 03/10] ARM: Clean up definition of ARM_HAS_GROUP_RELOCS Nathan Chancellor
2025-08-18 18:57 ` [PATCH 04/10] arm64: Remove tautological LLVM Kconfig conditions Nathan Chancellor
2025-08-19 11:35   ` Will Deacon
2025-08-18 18:57 ` [PATCH 05/10] mips: Unconditionally select ARCH_HAS_CURRENT_STACK_POINTER Nathan Chancellor
2025-08-19 12:08   ` Thomas Bogendoerfer
2025-08-18 18:57 ` [PATCH 06/10] powerpc: Drop unnecessary initializations in __copy_inst_from_kernel_nofault() Nathan Chancellor
2025-08-18 18:57 ` [PATCH 07/10] riscv: Remove version check for LTO_CLANG selects Nathan Chancellor
2025-08-20  7:23   ` Alexandre Ghiti
2025-08-20 16:11     ` Nathan Chancellor
2025-08-18 18:57 ` [PATCH 08/10] lib/Kconfig.debug: Drop CLANG_VERSION check from DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT Nathan Chancellor
2025-08-18 18:57 ` [PATCH 09/10] objtool: Drop noinstr hack for KCSAN_WEAK_MEMORY Nathan Chancellor
2025-08-18 19:12   ` Peter Zijlstra
2025-08-19 10:35   ` Marco Elver
2025-08-18 18:57 ` [PATCH 10/10] KMSAN: Remove tautological checks Nathan Chancellor
2025-08-19 11:02   ` Marco Elver
2025-08-19  0:55 ` [PATCH 00/10] Bump minimum supported version of LLVM for building the kernel to 15.0.0 Kees Cook

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).