aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
authorLinus Torvalds <torvalds@linux-foundation.org>2026-06-15 05:01:15 +0530
committerLinus Torvalds <torvalds@linux-foundation.org>2026-06-15 05:01:15 +0530
commit73f399414a84d715bb1794182aaea852b11d0962 (patch)
tree91a7d6656d3d93dfb77a40c7b5763048ce9c61c1 /arch
parentde02909ae81aa4fda213d16915adb5e1b088a7db (diff)
parent1a1e62a5a48494cdf33e3bfb82fb8f408da7c4cc (diff)
downloadath-73f399414a84d715bb1794182aaea852b11d0962.tar.gz
Merge tag 'kbuild-7.2-1' of git://git.kernel.org/pub/scm/linux/kernel/git/kbuild/linux
Pull Kbuild / Kconfig updates from Nathan Chancellor: "Kbuild: - Remove broken module linking exclusion for BTF - Add documentation around how offset header files work - Include unstripped vDSO libraries in pacman packages - Bump minimum version of LLVM for building the kernel to 17.0.1 and clean up unnecessary workarounds - Use a context manager in run-clang-tools - Add dist macro value if present to release tag for RPM packages - Detect and report truncated buf_printf() output in modpost - Add __llvm_covfun and __llvm_covmap to section whitelist in modpost - Support Clang's distributed ThinLTO mode - Remove architecture specific configurations for AutoFDO and Propeller to ease individual architecture maintenance Kconfig: - Add kconfig-sym-check target to look for dangling Kconfig symbol references and invalid tristate literal values - Harden against potential NULL pointer dereference - Fix typo in Kconfig test comment" * tag 'kbuild-7.2-1' of git://git.kernel.org/pub/scm/linux/kernel/git/kbuild/linux: (31 commits) kconfig: tests: fix typo in comment kconfig: Remove the architecture specific config for Propeller kconfig: Remove the architecture specific config for AutoFDO modpost: Add __llvm_covfun and __llvm_covmap to section_white_list kconfig: add kconfig-sym-check static checker kbuild: Remove unnecessary 'T' modifier in cmd_ar_builtin_fixup kbuild: distributed build support for Clang ThinLTO kbuild: move vmlinux.a build rule to scripts/Makefile.vmlinux_a scripts: modpost: detect and report truncated buf_printf() output kbuild: rpm-pkg: append %{?dist} macro to Release tag run-clang-tools: run multiprocessing.Pool as context manager compiler-clang.h: Drop explicit version number from "all" diagnostic macro compiler-clang.h: Remove __cleanup -Wunused-variable workaround kbuild: Remove check for broken scoping with clang < 17 in CC_HAS_ASM_GOTO_OUTPUT x86/entry/vdso32: Remove conditional omission of '.cfi_offset eflags' x86/module: Revert "Deal with GOT based stack cookie load on Clang < 17" x86/build: Drop unnecessary '-ffreestanding' addition to KBUILD_CFLAGS scripts/Makefile.warn: Drop -Wformat handling for clang < 16 riscv: Drop tautological condition from TOOLCHAIN_NEEDS_OLD_ISA_SPEC riscv: Remove tautological condition from selection of ARCH_SUPPORTS_CFI ...
Diffstat (limited to 'arch')
-rw-r--r--arch/Kconfig33
-rw-r--r--arch/arm/Kconfig.platforms4
-rw-r--r--arch/arm64/kernel/vmlinux.lds.S1
-rw-r--r--arch/riscv/Kconfig16
-rw-r--r--arch/x86/Kconfig2
-rw-r--r--arch/x86/Makefile5
-rw-r--r--arch/x86/entry/vdso/vdso32/sigreturn.S10
-rw-r--r--arch/x86/include/asm/elf.h5
-rw-r--r--arch/x86/kernel/module.c15
-rw-r--r--arch/x86/kernel/vmlinux.lds.S5
10 files changed, 32 insertions, 64 deletions
diff --git a/arch/Kconfig b/arch/Kconfig
index e86880045158e..99c2017eb5157 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -806,9 +806,6 @@ config HAS_LTO_CLANG
depends on $(success,$(AR) --help | head -n 1 | grep -qi llvm)
depends on ARCH_SUPPORTS_LTO_CLANG
depends on !FTRACE_MCOUNT_USE_RECORDMCOUNT
- # https://github.com/ClangBuiltLinux/linux/issues/1721
- depends on (!KASAN || KASAN_HW_TAGS || CLANG_VERSION >= 170000) || !DEBUG_INFO
- depends on (!KCOV || CLANG_VERSION >= 170000) || !DEBUG_INFO
depends on !GCOV_KERNEL
help
The compiler and Kconfig options support building with Clang's
@@ -861,15 +858,30 @@ config LTO_CLANG_THIN
https://clang.llvm.org/docs/ThinLTO.html
If unsure, say Y.
-endchoice
-config ARCH_SUPPORTS_AUTOFDO_CLANG
- bool
+config LTO_CLANG_THIN_DIST
+ bool "Clang ThinLTO in distributed mode (EXPERIMENTAL)"
+ depends on HAS_LTO_CLANG && ARCH_SUPPORTS_LTO_CLANG_THIN
+ select LTO_CLANG
+ help
+ This option enables Clang's ThinLTO in distributed build mode.
+ In this mode, the linker performs the thin-link, generating
+ ThinLTO index files. Subsequently, the build system explicitly
+ invokes ThinLTO backend compilation using these index files
+ and pre-linked IR objects. The resulting native object files
+ are with the .thinlto-native.o suffix.
+
+ This build mode offers improved visibility into the ThinLTO
+ process through explicit subcommand exposure. It also makes
+ final native object files directly available, benefiting
+ tools like objtool and kpatch. Additionally, it provides
+ crucial granular control over back-end options, enabling
+ module-specific compiler options, and simplifies debugging.
+endchoice
config AUTOFDO_CLANG
bool "Enable Clang's AutoFDO build (EXPERIMENTAL)"
- depends on ARCH_SUPPORTS_AUTOFDO_CLANG
- depends on CC_IS_CLANG && CLANG_VERSION >= 170000
+ depends on CC_IS_CLANG
help
This option enables Clang’s AutoFDO build. When
an AutoFDO profile is specified in variable
@@ -883,13 +895,10 @@ config AUTOFDO_CLANG
If unsure, say N.
-config ARCH_SUPPORTS_PROPELLER_CLANG
- bool
-
config PROPELLER_CLANG
bool "Enable Clang's Propeller build"
- depends on ARCH_SUPPORTS_PROPELLER_CLANG
depends on CC_IS_CLANG && CLANG_VERSION >= 190000
+ depends on $(cc-option,-fbasic-block-sections=list=/dev/null)
help
This option enables Clang’s Propeller build. When the Propeller
profiles is specified in variable CLANG_PROPELLER_PROFILE_PREFIX
diff --git a/arch/arm/Kconfig.platforms b/arch/arm/Kconfig.platforms
index 5c19c1f2cff61..386eccc818683 100644
--- a/arch/arm/Kconfig.platforms
+++ b/arch/arm/Kconfig.platforms
@@ -8,16 +8,12 @@ comment "CPU Core family selection"
config ARCH_MULTI_V4
bool "ARMv4 based platforms (FA526, StrongARM)"
depends on !ARCH_MULTI_V6_V7
- # https://github.com/llvm/llvm-project/issues/50764
- depends on !LD_IS_LLD || LLD_VERSION >= 160000
select ARCH_MULTI_V4_V5
select CPU_FA526 if !(CPU_SA110 || CPU_SA1100)
config ARCH_MULTI_V4T
bool "ARMv4T based platforms (ARM720T, ARM920T, ...)"
depends on !ARCH_MULTI_V6_V7
- # https://github.com/llvm/llvm-project/issues/50764
- depends on !LD_IS_LLD || LLD_VERSION >= 160000
select ARCH_MULTI_V4_V5
select CPU_ARM920T if !(CPU_ARM7TDMI || CPU_ARM720T || \
CPU_ARM740T || CPU_ARM9TDMI || CPU_ARM922T || \
diff --git a/arch/arm64/kernel/vmlinux.lds.S b/arch/arm64/kernel/vmlinux.lds.S
index e1ac876200a3d..8aaf404980a72 100644
--- a/arch/arm64/kernel/vmlinux.lds.S
+++ b/arch/arm64/kernel/vmlinux.lds.S
@@ -368,6 +368,7 @@ SECTIONS
STABS_DEBUG
DWARF_DEBUG
+ PROPELLER_DATA
MODINFO
ELF_DETAILS
diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
index c5754942cf85a..1a2fadccd4c4f 100644
--- a/arch/riscv/Kconfig
+++ b/arch/riscv/Kconfig
@@ -61,8 +61,7 @@ config RISCV
select ARCH_OPTIONAL_KERNEL_RWX_DEFAULT
select ARCH_STACKWALK
select ARCH_SUPPORTS_ATOMIC_RMW
- # clang >= 17: https://github.com/llvm/llvm-project/commit/62fa708ceb027713b386c7e0efda994f8bdc27e2
- select ARCH_SUPPORTS_CFI if (!CC_IS_CLANG || CLANG_VERSION >= 170000)
+ select ARCH_SUPPORTS_CFI
select ARCH_SUPPORTS_DEBUG_PAGEALLOC if MMU
select ARCH_SUPPORTS_HUGE_PFNMAP if TRANSPARENT_HUGEPAGE
select ARCH_SUPPORTS_HUGETLBFS if MMU
@@ -874,19 +873,18 @@ config TOOLCHAIN_NEEDS_EXPLICIT_ZICSR_ZIFENCEI
and Zifencei are supported in binutils from version 2.36 onwards.
To make life easier, and avoid forcing toolchains that default to a
newer ISA spec to version 2.2, relax the check to binutils >= 2.36.
- For clang < 17 or GCC < 11.3.0, for which this is not possible or need
- special treatment, this is dealt with in TOOLCHAIN_NEEDS_OLD_ISA_SPEC.
+ For GCC < 11.3.0, for which this is not possible or need special
+ treatment, this is dealt with in TOOLCHAIN_NEEDS_OLD_ISA_SPEC.
config TOOLCHAIN_NEEDS_OLD_ISA_SPEC
def_bool y
depends on TOOLCHAIN_NEEDS_EXPLICIT_ZICSR_ZIFENCEI
- # https://github.com/llvm/llvm-project/commit/22e199e6afb1263c943c0c0d4498694e15bf8a16
# https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=d29f5d6ab513c52fd872f532c492e35ae9fd6671
- depends on (CC_IS_CLANG && CLANG_VERSION < 170000) || (CC_IS_GCC && GCC_VERSION < 110300)
+ depends on CC_IS_GCC && GCC_VERSION < 110300
help
- Certain versions of clang and GCC do not support zicsr and zifencei via
- -march. This option causes an older ISA spec compatible with these older
- versions of clang and GCC to be passed to GAS, which has the same result
+ Certain versions of GCC do not support zicsr and zifencei via -march.
+ This option causes an older ISA spec compatible with these older
+ versions of GCC to be passed to GAS, which has the same result
as passing zicsr and zifencei to -march.
config FPU
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index f3f7cb01d69d0..b875d2f27e48c 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -130,8 +130,6 @@ config X86
select ARCH_SUPPORTS_LTO_CLANG
select ARCH_SUPPORTS_LTO_CLANG_THIN
select ARCH_SUPPORTS_RT
- select ARCH_SUPPORTS_AUTOFDO_CLANG
- select ARCH_SUPPORTS_PROPELLER_CLANG if X86_64
select ARCH_USE_BUILTIN_BSWAP
select ARCH_USE_CMPXCHG_LOCKREF if X86_CX8
select ARCH_USE_MEMTEST
diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index 1d526a5d2a831..1e5457a9a4cdc 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -128,11 +128,6 @@ ifeq ($(CONFIG_X86_32),y)
include $(srctree)/arch/x86/Makefile_32.cpu
KBUILD_CFLAGS += $(cflags-y)
- ifneq ($(call clang-min-version, 160000),y)
- # https://github.com/llvm/llvm-project/issues/53645
- KBUILD_CFLAGS += -ffreestanding
- endif
-
percpu_seg := fs
else
BITS := 64
diff --git a/arch/x86/entry/vdso/vdso32/sigreturn.S b/arch/x86/entry/vdso/vdso32/sigreturn.S
index b33fcc501ba30..328bd3a4ef513 100644
--- a/arch/x86/entry/vdso/vdso32/sigreturn.S
+++ b/arch/x86/entry/vdso/vdso32/sigreturn.S
@@ -22,17 +22,7 @@
CFI_OFFSET cs, IA32_SIGCONTEXT_cs
CFI_OFFSET ss, IA32_SIGCONTEXT_ss
CFI_OFFSET ds, IA32_SIGCONTEXT_ds
-/*
- * .cfi_offset eflags requires LLVM 16 or newer:
- *
- * https://github.com/llvm/llvm-project/commit/67bd3c58c0c7389e39c5a2f4d3b1a30459ccf5b7
- *
- * Check for 16.0.1 to ensure the support is present, as 16.0.0 may be a
- * prerelease version.
- */
-#if defined(CONFIG_AS_IS_GNU) || (defined(CONFIG_AS_IS_LLVM) && CONFIG_AS_VERSION >= 160001)
CFI_OFFSET eflags, IA32_SIGCONTEXT_flags
-#endif
.endm
/*
diff --git a/arch/x86/include/asm/elf.h b/arch/x86/include/asm/elf.h
index c7f98977663ca..0de9df759c99a 100644
--- a/arch/x86/include/asm/elf.h
+++ b/arch/x86/include/asm/elf.h
@@ -54,9 +54,8 @@ typedef struct user_i387_struct elf_fpregset_t;
#define R_X86_64_GLOB_DAT 6 /* Create GOT entry */
#define R_X86_64_JUMP_SLOT 7 /* Create PLT entry */
#define R_X86_64_RELATIVE 8 /* Adjust by program base */
-#define R_X86_64_GOTPCREL 9 /* 32 bit signed pc relative offset to GOT */
-#define R_X86_64_GOTPCRELX 41
-#define R_X86_64_REX_GOTPCRELX 42
+#define R_X86_64_GOTPCREL 9 /* 32 bit signed pc relative
+ offset to GOT */
#define R_X86_64_32 10 /* Direct 32 bit zero extended */
#define R_X86_64_32S 11 /* Direct 32 bit sign extended */
#define R_X86_64_16 12 /* Direct 16 bit zero extended */
diff --git a/arch/x86/kernel/module.c b/arch/x86/kernel/module.c
index 11c45ce42694c..b5b4de4f08e6c 100644
--- a/arch/x86/kernel/module.c
+++ b/arch/x86/kernel/module.c
@@ -19,7 +19,6 @@
#include <linux/jump_label.h>
#include <linux/random.h>
#include <linux/memory.h>
-#include <linux/stackprotector.h>
#include <asm/text-patching.h>
#include <asm/page.h>
@@ -132,20 +131,6 @@ static int __write_relocate_add(Elf64_Shdr *sechdrs,
goto overflow;
size = 4;
break;
-#if defined(CONFIG_STACKPROTECTOR) && \
- defined(CONFIG_CC_IS_CLANG) && CONFIG_CLANG_VERSION < 170000
- case R_X86_64_REX_GOTPCRELX: {
- static unsigned long __percpu *const addr = &__stack_chk_guard;
-
- if (sym->st_value != (u64)addr) {
- pr_err("%s: Unsupported GOTPCREL relocation\n", me->name);
- return -ENOEXEC;
- }
-
- val = (u64)&addr + rel[i].r_addend;
- fallthrough;
- }
-#endif
case R_X86_64_PC32:
case R_X86_64_PLT32:
val -= (u64)loc;
diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S
index 4711a35e706cd..74e336d7f9dd2 100644
--- a/arch/x86/kernel/vmlinux.lds.S
+++ b/arch/x86/kernel/vmlinux.lds.S
@@ -423,10 +423,7 @@ SECTIONS
STABS_DEBUG
DWARF_DEBUG
-#ifdef CONFIG_PROPELLER_CLANG
- .llvm_bb_addr_map : { *(.llvm_bb_addr_map) }
-#endif
-
+ PROPELLER_DATA
MODINFO
ELF_DETAILS