Source: binutils-gold
Version: 2.44-3
User: [email protected]
Usertags: pac-bti, gcs

Hi Matthias,

similarly to the work already done for binutils (#1127747), please
consider the attached patch to build binutils-gold with PAC/BTI/GCS too.

Thanks,
  ema
From: Emanuele Rocca <[email protected]>
Date: Tue, 2 Jun 2026 09:30:16 +0200
Subject: [PATCH] Enable PAC/BTI/GCS on arm64

---
 debian/changelog | 6 ++++++
 debian/rules     | 8 ++++++++
 2 files changed, 14 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index dc4e1d13..4139e88c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+binutils-gold (2.44-4) unstable; urgency=medium
+
+  * Enable PAC/BTI/GCS on arm64.
+
+ -- Emanuele Rocca <[email protected]>  Tue, 02 Jun 2026 09:29:43 +0200
+
 binutils-gold (2.44-3) unstable; urgency=medium
 
   * Ignore regression in the test suite. Closes: #1114064.
diff --git a/debian/rules b/debian/rules
index 0eb70098..e7ac60fc 100755
--- a/debian/rules
+++ b/debian/rules
@@ -278,6 +278,14 @@ ifneq (,$(shell dpkg-buildflags | grep '^CFLAGS=.*-mbackchain'))
   CFLAGS += -mbackchain
   CXXFLAGS += -mbackchain
 endif
+ifeq ($(DEB_HOST_ARCH),arm64)
+  ifneq (,$(findstring -mbranch-protection=standard,$(shell dpkg-buildflags --get CFLAGS)))
+    CFLAGS += -mbranch-protection=standard
+  endif
+  ifneq (,$(findstring -mbranch-protection=standard,$(shell dpkg-buildflags --get CXXFLAGS)))
+    CXXFLAGS += -mbranch-protection=standard
+  endif
+endif
 STRIP  = $(CROSS)strip -R .comment -R .note
 STRIP_LTO = $(CROSS)strip -R .gnu.lto_* -R .gnu.debuglto_* -N __gnu_lto_slim -N __gnu_lto_v1
 
-- 
2.47.3

Reply via email to