[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#1057649: sane-backends FTCBFS: confuses build/host compiler flags



Source: sane-backends
Version: 1.2.1-6
Tags: patch
User: debian-cross@lists.debian.org
Usertags: ftcbfs
X-Debbugs-CC: debian-cross@lists.debian.org

Dear Maintainer,

some compiler flags are architecture specific and should not leak when
cross-building.

As an example, -fcf-protection is x86-specific, and the following fails:

 aarch64-linux-gnu-gcc-13 -fcf-protection

Similarly, -mbranch-protection=standard is aarch64-specific, and the
following fails:

 x86_64-linux-gnu-gcc-13 -mbranch-protection=standard

For this reason, we must tell dh_auto_configure to pass the right flags
explicitly when changing the architecture. With the attached patch
sane-backends cleanly cross-builds from source.

Thanks!
  Emanuele
diff -Nru sane-backends-1.2.1/debian/rules sane-backends-1.2.1/debian/rules
--- sane-backends-1.2.1/debian/rules	2023-11-25 16:20:54.000000000 +0100
+++ sane-backends-1.2.1/debian/rules	2023-11-25 19:52:57.000000000 +0100
@@ -26,7 +26,7 @@
 override_dh_auto_configure:
 	autoconf
 ifneq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))
-	dpkg-architecture -f "-a$(DEB_BUILD_ARCH)" -c dh_auto_configure
+	dpkg-architecture -f "-a$(DEB_BUILD_ARCH)" -c dh_auto_configure --reload-all-buildenv-variables
 	$(MAKE) -C $(CURDIR)/lib liblib.la
 	$(MAKE) -C $(CURDIR)/sanei libsanei.la
 	$(MAKE) -C $(CURDIR)/tools sane-desc

Reply to: