Files
besser/danctnix-besser-pkgbuild/kernel/0003-arm64-xor-neon-ffixed-x18-build-fix.patch
T
claude-noether 122582e270 danctnix-besser: pkgrel=3 — refine Patch I, add SCS-off + GCC15 workaround
Three things bundled because they were verified together in the same
deploy cycle on ohm (kernel built fresh on boltzmann 2026-05-18):

1. 0002 (Patch I) refined: refuse only multi-channel 5 GHz scans
   (n_channels > 1).  Original Patch I refused everything, which
   blocked NM's per-frequency BSS discovery and made 5 GHz association
   impossible.  Tighter guard preserves the storm fix and unblocks
   5 GHz attachment via NM 802-11-wireless.band=a profiles.

   Verified on ohm with pkgrel=3: associated to BSSID
   c0:25:06:e6:5b:33 on 5240 MHz (ch.48), TX 150 Mbit/s MCS 7
   HT40 short-GI vs 72.2 Mbit/s on 2.4 GHz.  Pattern A still 0.

   Source-of-truth: marfrit/bes2600-dkms branch bes2600/scan-filter-5ghz
   commits 093a503 + 8cd10f4 (squashed into this single 0002 file).

2. 0003 (new): arm64 xor-neon Makefile workaround for GCC 15.2.1
   strict pragma validator vs arm_neon.h target() blocks losing
   -ffixed-x18 under SCS=y.  This is a defensive workaround;
   currently dead-coded (SCS=n below) but in place for the day SCS
   re-enable becomes possible (tracked in besser#20).

3. config: CONFIG_SHADOW_CALL_STACK=n override for the current GCC
   15.2.1 toolchain issue.  Restore to =y once GCC upstream fixes
   the arm_neon.h pragma interaction (besser#20).

pkgrel bumped 2 -> 3.

Refs: besser#1 (closed), besser#20, kernel-agent#25 (PR mirroring
this into the kernel-agent patch tree — needs follow-up to pick
up the refinement).
2026-05-18 15:57:05 +02:00

37 lines
1.5 KiB
Diff

From: Markus Fritsche <fritsche.markus@gmail.com>
Date: Mon, 18 May 2026 11:42:00 +0200
Subject: [PATCH] arm64: xor-neon: restore -ffixed-x18 when SHADOW_CALL_STACK=y
(GCC 15+ build fix)
GCC 15.2.1 enforces that -fsanitize=shadow-call-stack requires
-ffixed-x18 inside arm_neon.h's #pragma GCC target() blocks. The
existing CFLAGS_REMOVE_xor-neon.o line strips the kernel-wide
-ffixed-x18 (it's part of CC_FLAGS_NO_FPU) and CC_FLAGS_FPU does not
restore it, so xor-neon.c fails to build on stricter GCC versions
when CONFIG_SHADOW_CALL_STACK=y.
Add an explicit -ffixed-x18 just for this object, gated on the
SCS config so non-SCS builds are unaffected.
Build environment workaround; not a kernel-runtime bug.
---
arch/arm64/lib/Makefile | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/arch/arm64/lib/Makefile b/arch/arm64/lib/Makefile
index 1234567..2345678 100644
--- a/arch/arm64/lib/Makefile
+++ b/arch/arm64/lib/Makefile
@@ -9,6 +9,10 @@ ifeq ($(CONFIG_KERNEL_MODE_NEON), y)
obj-$(CONFIG_XOR_BLOCKS) += xor-neon.o
CFLAGS_xor-neon.o += $(CC_FLAGS_FPU)
CFLAGS_REMOVE_xor-neon.o += $(CC_FLAGS_NO_FPU)
+# GCC 15+ enforces that -fsanitize=shadow-call-stack requires -ffixed-x18
+# even after a #pragma GCC pop_options inside arm_neon.h. CC_FLAGS_REMOVE
+# above strips the kernel-wide -ffixed-x18 (part of CC_FLAGS_NO_FPU); add
+# it back here so xor-neon.c still compiles when SHADOW_CALL_STACK=y.
+CFLAGS_xor-neon.o += $(if $(CONFIG_SHADOW_CALL_STACK),-ffixed-x18)
endif
lib-$(CONFIG_ARCH_HAS_UACCESS_FLUSHCACHE) += uaccess_flushcache.o