On 2026-03-13 01:42, Emanuele Rocca wrote:
> diff --git a/debian/rules2 b/debian/rules2
> index ae18668..74acb8d 100644
> --- a/debian/rules2
> +++ b/debian/rules2
> @@ -233,6 +233,7 @@ ifeq ($(DEB_TARGET_ARCH),arm64)
>      # Native build
>      CFLAGS += $(CFLAGS_SECURE)
>      CXXFLAGS += $(CFLAGS_SECURE)
> +    BOOT_CFLAGS += $(CFLAGS_SECURE)
>    endif
>  endif

The above ended up accidentally overriding the default BOOT_CFLAGS set
in the upstream Makefile (-g -O2). Fixed patch attached.
>From d293ad7e150d7c3b5a6fe2123556fd349b23b11a Mon Sep 17 00:00:00 2001
From: Emanuele Rocca <[email protected]>
Date: Fri, 13 Mar 2026 08:45:39 +0100
Subject: [PATCH] Set branch-protection on arm64, explicit BOOT_CFLAGS defaults

---
 debian/changelog | 8 ++++++++
 debian/rules2    | 4 ++++
 2 files changed, 12 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index cd4bf18..dc7232c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+gcc-15 (15.2.0-16) UNRELEASED; urgency=medium
+
+  * Set BOOT_CFLAGS explicitly instead of relying on upstream defaults.
+  * Build gcc itself with branch-protection on arm64 by appending CFLAGS_SECURE
+    to BOOT_CFLAGS.
+
+ -- Emanuele Rocca <[email protected]>  Tue, 24 Mar 2026 08:58:13 +0100
+
 gcc-15 (15.2.0-15) unstable; urgency=medium
 
   * Update to git 20260307 from the gcc-15 branch.
diff --git a/debian/rules2 b/debian/rules2
index ae18668..3f29b2c 100644
--- a/debian/rules2
+++ b/debian/rules2
@@ -181,6 +181,7 @@ ifneq (,$(filter $(build_type), build-cross cross-build-cross))
     LDFLAGS += -Wl,--no-relax
   endif
 else
+  BOOT_CFLAGS	= -g -O2
   BOOT_LDFLAGS	= -Wl,-z,relro
   ifeq ($(DEB_TARGET_ARCH),alpha)
     BOOT_LDFLAGS += -Wl,--no-relax
@@ -233,6 +234,7 @@ ifeq ($(DEB_TARGET_ARCH),arm64)
     # Native build
     CFLAGS += $(CFLAGS_SECURE)
     CXXFLAGS += $(CFLAGS_SECURE)
+    BOOT_CFLAGS += $(CFLAGS_SECURE)
   endif
 endif
 
@@ -1215,7 +1217,9 @@ endif
 	@echo "CFLAGS: $(CFLAGS)"
 	@echo "LDFLAGS: $(LDFLAGS)"
 	@echo "FCFLAGS: $(FCFLAGS)"
+	@echo "STAGE1_CFLAGS: $(STAGE1_CFLAGS)"
 	@echo "BOOT_CFLAGS: $(BOOT_CFLAGS)"
+	@echo "BOOT_LDFLAGS: $(BOOT_LDFLAGS)"
 	@echo "DEBIAN_BUILDARCH: $(DEBIAN_BUILDARCH)"
 	@echo "Install prefix: /$(PF)"
 ifeq ($(biarchn32)-$(biarch64),yes-yes)
-- 
2.43.0

Reply via email to