Source: sloccount
Version: 2.26+ds-1
Tags: patch
User: debian-cr...@lists.debian.org
Usertags: ftcbfs

thanks for using dh_auto_build. Unfortunately, the invocation also
gained an assignment of CC nullifying the intended effect. What is being
passed here is the make default of CC being cc and that's the build
architecture compiler. That's wrong for cross builds. I'm attaching
another patch that makes it use a suitable CC.

Helmut
diff --minimal -Nru sloccount-2.26+ds/debian/changelog 
sloccount-2.26+ds/debian/changelog
--- sloccount-2.26+ds/debian/changelog  2024-09-07 14:23:18.000000000 +0200
+++ sloccount-2.26+ds/debian/changelog  2025-05-26 23:31:20.000000000 +0200
@@ -1,3 +1,10 @@
+sloccount (2.26+ds-1.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix FTCBFS: Override CC with a triplet-prefixed compiler. (Closes: #-1)
+
+ -- Helmut Grohne <hel...@subdivi.de>  Mon, 26 May 2025 23:31:20 +0200
+
 sloccount (2.26+ds-1) unstable; urgency=medium
 
   * Team upload.
diff --minimal -Nru sloccount-2.26+ds/debian/rules 
sloccount-2.26+ds/debian/rules
--- sloccount-2.26+ds/debian/rules      2024-09-07 14:23:18.000000000 +0200
+++ sloccount-2.26+ds/debian/rules      2025-05-26 23:31:18.000000000 +0200
@@ -5,15 +5,11 @@
 # export DH_VERBOSE=1
 
 export DEB_BUILD_MAINT_OPTIONS=hardening=+all
+DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
+DEB_CFLAGS_MAINT_APPEND = -Wall
 
-LDFLAGS  = $(shell dpkg-buildflags --get LDFLAGS)
-LDFLAGS += -Wl,--as-needed
-
-CPPFLAGS = $(shell dpkg-buildflags --get CPPFLAGS)
-CFLAGS   = $(shell dpkg-buildflags --get CFLAGS)
-CFLAGS  += -Wall $(CPPFLAGS)
-
-CC := $(CC) -Wall $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)
+include /usr/share/dpkg/buildtools.mk
+include /usr/share/dpkg/buildflags.mk
 
 LINKMANPAGES= \
    break_filelist \
@@ -74,7 +70,7 @@
        rm -f pascal_count ml_count c_count xml_count.c
 
 override_dh_auto_build:
-       dh_auto_build -- CC="$(CC)"
+       dh_auto_build -- CC="$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS)"
 
 override_dh_auto_install:
        dh_auto_install -- PREFIX=$(CURDIR)/debian/`dh_listpackages`/usr

Reply via email to