Files
kernel-agent/patches/arch/arm64/xor-neon-ffixed-x18-scs-build-fix-danctnix/0001-arm64-xor-neon-ffixed-x18-build-fix.patch
T
claude-noether 878e86f103 patches/arch/arm64/xor-neon-...: restore trailer (SCS is no longer last)
When the SCS patch was the LAST patch in ohm's cumulative, the
trailing '-- \n2.54.0\n' git-format-patch sentinel was an orphan that
patch(1) read as a malformed header — fixed in 84734ba by stripping
the trailer.

Now besser#18 (queue-pending-record-lock-bh-danctnix) is added at the
end of ohm.yaml's includes. SCS is no longer last. Without its
trailer to mark end-of-patch, patch(1) reads straight into besser#18's
'From d95453c... Mon Sep 17 00:00:00 2001' line and errors as
'malformed patch at line N: From ...'.

Restoring the trailer makes the separator unambiguous again.

Cumulative b2sum: 0eb091ddaba4a8f1c3c2a78... -> ceec602afa8574c74354...
Size: 162 704 -> 162 716 (+12 = the trailer bytes).

This rule — 'only the LAST patch must lack a trailer; all others must
keep theirs' — is sensitive to ohm.yaml include ordering, which is
brittle. Filed as a kernel-agent followup: ka-promote should rewrite
trailers automatically (always add to non-last, always strip from
last) so source patches don't need to be ordering-aware.
2026-05-18 18:15:45 +02:00

40 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,7 +9,12 @@ 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
--
2.54.0