Source: fossil
Version: 1:2.25-4
Tags: patch
X-Debbugs-Cc: debian-...@lists.debian.org
User: debian-...@lists.debian.org
Usertags: arm64
User: debian-cr...@lists.debian.org
Usertags: ftcbfs

fossil fails to cross build from source for arm64, because arm64
includes -mbranch-protection=standard in CFLAGS and fossil passes this
flag for building native tools. The amd64 gcc does not like that. The
upstream makefiles seed BCCFLAGS from the detected host's CFLAGS while
they should not. I suggest overriding BCCFLAGS in debian/rules. Please
consider applying the attached patch.

Helmut
diff --minimal -Nru fossil-2.25/debian/changelog fossil-2.25/debian/changelog
--- fossil-2.25/debian/changelog        2025-04-10 21:15:20.000000000 +0200
+++ fossil-2.25/debian/changelog        2025-04-22 22:14:37.000000000 +0200
@@ -1,3 +1,10 @@
+fossil (1:2.25-4.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix FTCBFS: override BCCFLAGS. (Closes: #-1)
+
+ -- Helmut Grohne <hel...@subdivi.de>  Tue, 22 Apr 2025 22:14:37 +0200
+
 fossil (1:2.25-4) unstable; urgency=medium
 
   * Patch upstream riscv64-recent-GCC-breaking (1<<31) print issue
diff --minimal -Nru fossil-2.25/debian/rules fossil-2.25/debian/rules
--- fossil-2.25/debian/rules    2025-04-10 21:13:35.000000000 +0200
+++ fossil-2.25/debian/rules    2025-04-22 22:14:30.000000000 +0200
@@ -3,6 +3,7 @@
 DEB_BUILD_MAINT_OPTIONS=hardening=+all
 export DEB_BUILD_MAINT_OPTIONS
 include /usr/share/dpkg/architecture.mk
+include /usr/share/dpkg/buildflags.mk
 
 %:
        dh $@ --with bash-completion
@@ -48,6 +49,9 @@
                             --with-tcl-stubs \
                             --with-tcl-private-stubs
 
+override_dh_auto_build:
+       dh_auto_build -- 'BCCFLAGS=$(CPPFLAGS_FOR_BUIL) $(CFLAGS_FOR_BUILD)'
+
 execute_after_dh_installdocs:
        mv debian/fossil/usr/share/doc/fossil/changes.wiki \
           debian/fossil/usr/share/doc/fossil/changelog

Reply via email to