Package: libgfortran5
Version: 15.2.0-11

Hi,

on arm64 libgfortran.so.5.0.0 is currently built without PAC/BTI/GCS
support.

Please consider the attached patch to add -mbranch-protection=standard
to FCFLAGS where appropriate.

Thanks,
  Emanuele
commit 17401abb36f9c46b9584b09b1132a9e05fdfa616
Author: Emanuele Rocca <[email protected]>
Date:   Tue Dec 16 13:43:04 2025 +0100

    Enable PAC/BTI/GCS support in libgfortran

diff --git a/debian/rules2 b/debian/rules2
index 8c78e32..aa78f85 100644
--- a/debian/rules2
+++ b/debian/rules2
@@ -217,6 +217,10 @@ ifeq ($(DEB_TARGET_ARCH),arm64)
     CFLAGS_SECURE =
   endif
 
+  ifneq (,$(findstring -mbranch-protection=standard,$(shell DEB_HOST_ARCH=$(DEB_TARGET_ARCH) dpkg-buildflags --get FCFLAGS)))
+    FCFLAGS += -mbranch-protection=standard
+  endif
+
   ifeq ($(DEB_CROSS),yes)
     # Building cross compilers
     CFLAGS_FOR_TARGET += $(CFLAGS_SECURE)
@@ -255,7 +259,7 @@ endif
 # set CFLAGS/LDFLAGS for the configure step only, maybe be modifed for some target
 # all other flags are passed to the make step.
 pass_vars = $(foreach v,$(1),$(if $($(v)),$(v)="$($(v))"))
-flags_to_pass := CFLAGS CXXFLAGS LIBCFLAGS LIBCXXFLAGS LDFLAGS
+flags_to_pass := CFLAGS CXXFLAGS LIBCFLAGS LIBCXXFLAGS LDFLAGS FCFLAGS
 
 docdir		= usr/share/doc
 
@@ -1208,6 +1212,7 @@ endif
 	@echo "CPPFLAGS: $(CPPFLAGS)"
 	@echo "CFLAGS: $(CFLAGS)"
 	@echo "LDFLAGS: $(LDFLAGS)"
+	@echo "FCFLAGS: $(FCFLAGS)"
 	@echo "BOOT_CFLAGS: $(BOOT_CFLAGS)"
 	@echo "DEBIAN_BUILDARCH: $(DEBIAN_BUILDARCH)"
 	@echo "Install prefix: /$(PF)"

Reply via email to