Bug#1024244: highway FTCBFS: multiple reasons

Helmut Grohne helmut at subdivi.de
Wed Nov 16 06:42:33 GMT 2022


Source: highway
Version: 1.0.3~git20221102.4899d11-2
Tags: patch
User: debian-cross at lists.debian.org
Usertags: ftcbfs

highway fails to cross build from source for multiple reasons. The
immediate failure is forcing a build architecture compiler by exporting
the make defaults for CC and CXX. Those values are wrong for cross
compilation and seeding them from dpkg's buildtools.mk is the easiest
way to fix that without overriding user choices. Next is failure to run
tests despite DEB_BUILD_OPTIONS containing nocheck. I'm attaching a
patch fixing both of these for your convenience. It also fixes some
build vs host confusions to fix specific cross build combinations.

Helmut
-------------- next part --------------
diff --minimal -Nru highway-1.0.3~git20221102.4899d11/debian/changelog highway-1.0.3~git20221102.4899d11/debian/changelog
--- highway-1.0.3~git20221102.4899d11/debian/changelog	2022-11-03 12:50:53.000000000 +0100
+++ highway-1.0.3~git20221102.4899d11/debian/changelog	2022-11-14 14:17:59.000000000 +0100
@@ -1,3 +1,13 @@
+highway (1.0.3~git20221102.4899d11-2.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix FTCBFS: (Closes: #-1)
+    + Honour DEB_BUILD_OPTIONS=nocheck.
+    + Default CC to a cross compiler via buildtools.mk.
+  * Fix a pile of build vs host confusions.
+
+ -- Helmut Grohne <helmut at subdivi.de>  Mon, 14 Nov 2022 14:17:59 +0100
+
 highway (1.0.3~git20221102.4899d11-2) experimental; urgency=medium
 
   * d/patches: Fix atomic support
diff --minimal -Nru highway-1.0.3~git20221102.4899d11/debian/rules highway-1.0.3~git20221102.4899d11/debian/rules
--- highway-1.0.3~git20221102.4899d11/debian/rules	2022-11-03 12:49:30.000000000 +0100
+++ highway-1.0.3~git20221102.4899d11/debian/rules	2022-11-14 14:17:59.000000000 +0100
@@ -12,19 +12,21 @@
 # Let's pretend to know what we are doing:
 DEB_CXXFLAGS_MAINT_APPEND += -DHWY_BROKEN_EMU128=0
 
-ifneq (,$(filter $(DEB_BUILD_ARCH), armhf armel))
+ifneq (,$(filter $(DEB_HOST_ARCH), armhf armel))
   # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77728
   DEB_CXXFLAGS_MAINT_APPEND += -Wno-psabi
 endif
 
-ifeq ($(DEB_BUILD_ARCH),$(filter $(DEB_BUILD_ARCH),armhf))
+ifeq ($(DEB_HOST_ARCH),$(filter $(DEB_HOST_ARCH),armhf))
   # highway implement dynamic dipatch:
   # https://github.com/google/highway/issues/891
   CMAKE_EXTRA_FLAGS += -DHWY_CMAKE_ARM7:BOOL=ON
 endif
 
+include /usr/share/dpkg/buildtools.mk
+
 # HWY_RVV requires `-march=rv64gcv1p0 -menable-experimental-extensions`
-ifeq ($(DEB_BUILD_ARCH),$(filter $(DEB_BUILD_ARCH),riscv64))
+ifeq ($(DEB_HOST_ARCH),$(filter $(DEB_HOST_ARCH),riscv64))
   CC=clang
   CXX=clang++
 endif
@@ -39,10 +41,14 @@
  -DBUILD_SHARED_LIBS:BOOL=ON \
  -DHWY_WARNINGS_ARE_ERRORS:BOOL=ON \
  -DHWY_SYSTEM_GTEST:BOOL=ON
+ifneq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
+CMAKE_EXTRA_FLAGS += -DBUILD_TESTING=OFF
+endif
 
 override_dh_auto_configure-arch:
 	dh_auto_configure -- $(CMAKE_EXTRA_FLAGS)
 
+ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
 # run default example to check compilation ok:
 override_dh_install-arch:
 ifeq (,$(filter $(DEB_BUILD_ARCH),hurd-i386))
@@ -51,6 +57,7 @@
 	echo "CPU 'QEMU Virtual CPU version 2.5+' does not support RDTSCP, skipping benchmark."
 endif
 	dh_install
+endif
 
 override_dh_clean-indep:
 	dh_clean debian_docs/


More information about the Pkg-phototools-devel mailing list