linux/arch
Nathan Chancellor 005873743f powerpc: Adjust adding stack protector flags to KBUILD_CLAGS for clang
commit bee08a9e6a upstream.

After fixing the HAVE_STACKPROTECTER checks for clang's in-progress
per-task stack protector support [1], the build fails during prepare0
because '-mstack-protector-guard-offset' has not been added to
KBUILD_CFLAGS yet but the other '-mstack-protector-guard' flags have.

  clang: error: '-mstack-protector-guard=tls' is used without '-mstack-protector-guard-offset', and there is no default
  clang: error: '-mstack-protector-guard=tls' is used without '-mstack-protector-guard-offset', and there is no default
  make[4]: *** [scripts/Makefile.build:229: scripts/mod/empty.o] Error 1
  make[4]: *** [scripts/Makefile.build:102: scripts/mod/devicetable-offsets.s] Error 1

Mirror other architectures and add all '-mstack-protector-guard' flags
to KBUILD_CFLAGS atomically during stack_protector_prepare, which
resolves the issue and allows clang's implementation to fully work with
the kernel.

Cc: stable@vger.kernel.org # 6.1+
Link: https://github.com/llvm/llvm-project/pull/110928 [1]
Reviewed-by: Keith Packard <keithp@keithp.com>
Tested-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://patch.msgid.link/20241009-powerpc-fix-stackprotector-test-clang-v2-2-12fb86b31857@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2024-12-14 19:54:17 +01:00
..
alpha mm: remove kern_addr_valid() completely 2024-11-08 16:26:39 +01:00
arc mm: remove kern_addr_valid() completely 2024-11-08 16:26:39 +01:00
arm ARM: 9431/1: mm: Pair atomic_set_release() with _read_acquire() 2024-12-14 19:54:14 +01:00
arm64 arm64: dts: freescale: imx8mp-verdin: Fix SD regulator startup delay 2024-12-14 19:54:11 +01:00
csky mm: remove kern_addr_valid() completely 2024-11-08 16:26:39 +01:00
hexagon mm: remove kern_addr_valid() completely 2024-11-08 16:26:39 +01:00
ia64 mm: remove kern_addr_valid() completely 2024-11-08 16:26:39 +01:00
loongarch LoongArch: BPF: Sign-extend return values 2024-12-14 19:53:49 +01:00
m68k m68k: coldfire/device.c: only build FEC when HW macros are defined 2024-12-14 19:53:46 +01:00
microblaze microblaze: Export xmb_manager functions 2024-12-14 19:53:20 +01:00
mips mips: asm: fix warning when disabling MIPS_FP_SUPPORT 2024-12-14 19:53:14 +01:00
nios2 mm: remove kern_addr_valid() completely 2024-11-08 16:26:39 +01:00
openrisc mm: remove kern_addr_valid() completely 2024-11-08 16:26:39 +01:00
parisc parisc/ftrace: Fix function graph tracing disablement 2024-12-14 19:54:02 +01:00
powerpc powerpc: Adjust adding stack protector flags to KBUILD_CLAGS for clang 2024-12-14 19:54:17 +01:00
riscv riscv/purgatory: align riscv_kernel_entry 2024-11-14 13:15:17 +01:00
s390 s390/entry: Mark IRQ entries to fix stack depot warnings 2024-12-14 19:54:14 +01:00
sh sh: cpuinfo: Fix a warning for CONFIG_CPUMASK_OFFSTACK 2024-12-14 19:54:03 +01:00
sparc mm: remove kern_addr_valid() completely 2024-11-08 16:26:39 +01:00
um um: Always dump trace for specified task in show_stack 2024-12-14 19:54:07 +01:00
x86 KVM: x86/mmu: Skip the "try unsync" path iff the old SPTE was a leaf SPTE 2024-12-14 19:53:58 +01:00
xtensa mm: remove kern_addr_valid() completely 2024-11-08 16:26:39 +01:00
.gitignore .gitignore: prefix local generated files with a slash 2021-05-02 00:43:35 +09:00
Kconfig Revert "mm: mmap: allow for the maximum number of bits for randomizing mmap_base by default" 2024-06-27 13:46:24 +02:00