Source: dmidecode
Version: 3.0-3
Tags: patch
User: [email protected]
Usertags: rebootstrap

dmidecode fails to cross build from source, because it defaults to using
plain "gcc" which is wrong for cross building. I am attaching a patch
that passes a suitable CC for both native and cross builds. It also
makes building with clang work.

Helmut
diff --minimal -Nru dmidecode-3.0/debian/changelog 
dmidecode-3.0/debian/changelog
--- dmidecode-3.0/debian/changelog      2016-05-15 18:33:17.000000000 +0200
+++ dmidecode-3.0/debian/changelog      2016-08-29 12:00:46.000000000 +0200
@@ -1,3 +1,10 @@
+dmidecode (3.0-3.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix FTCBFS: Pass suitable CC to make. (Closes: #-1)
+
+ -- Helmut Grohne <[email protected]>  Mon, 29 Aug 2016 12:00:27 +0200
+
 dmidecode (3.0-3) unstable; urgency=medium
 
   * Rename patches.
diff --minimal -Nru dmidecode-3.0/debian/rules dmidecode-3.0/debian/rules
--- dmidecode-3.0/debian/rules  2015-04-27 11:51:03.000000000 +0200
+++ dmidecode-3.0/debian/rules  2016-08-29 12:00:23.000000000 +0200
@@ -2,11 +2,16 @@
 
 export DEB_BUILD_MAINT_OPTIONS = hardening=+all
 
+include /usr/share/dpkg/architecture.mk
+ifeq ($(origin CC),default)
+CC = $(DEB_HOST_GNU_TYPE)-gcc
+endif
+
 %:
        dh ${@}
 
 override_dh_auto_build:
-       dh_auto_build -- CFLAGS="$(CFLAGS) $(CPPFLAGS) -Os -ansi" 
LDFLAGS="$(LDFLAGS)"
+       dh_auto_build -- CC=$(CC) CFLAGS="$(CFLAGS) $(CPPFLAGS) -Os -ansi" 
LDFLAGS="$(LDFLAGS)"
 
 override_dh_auto_install:
        dh_auto_install -- prefix=/usr

Reply via email to