Bug#866522: mdadm FTCBFS: upstream buildsystem ignores CROSS_COMPILE variable

Helmut Grohne helmut at subdivi.de
Thu Jun 29 20:05:53 UTC 2017


Source: mdadm
Version: 4.0-1
Tags: patch upstream
User: helmutg at debian.org
Usertags: rebootstrap

mdadm fails to cross build from source, because it uses the build
architecture compiler. Its Makefile assigns:

    CC ?= $(CROSS_COMPILE)gcc

Since CC is a builtin variable. Such an assignment is ignored. After
fixing the assignment mdadm cross builds successfully. Please consider
applying the attached patch.

Helmut
-------------- next part --------------
diff --minimal -Nru mdadm-4.0/debian/changelog mdadm-4.0/debian/changelog
--- mdadm-4.0/debian/changelog	2017-06-22 14:23:10.000000000 +0200
+++ mdadm-4.0/debian/changelog	2017-06-29 22:01:05.000000000 +0200
@@ -1,3 +1,10 @@
+mdadm (4.0-1.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix FTCBFS: cross.patch (Closes: #-1)
+
+ -- Helmut Grohne <helmut at subdivi.de>  Thu, 29 Jun 2017 22:01:05 +0200
+
 mdadm (4.0-1) unstable; urgency=medium
 
   * New upstream release. LP: #1668128
diff --minimal -Nru mdadm-4.0/debian/patches/cross.patch mdadm-4.0/debian/patches/cross.patch
--- mdadm-4.0/debian/patches/cross.patch	1970-01-01 01:00:00.000000000 +0100
+++ mdadm-4.0/debian/patches/cross.patch	2017-06-29 22:01:02.000000000 +0200
@@ -0,0 +1,20 @@
+From: Helmut Grohne <helmut at subdivi.de>
+Subject: properly assign CC
+
+A ?= assignment to a builtin variable is useless.
+
+Index: mdadm-4.0/Makefile
+===================================================================
+--- mdadm-4.0.orig/Makefile
++++ mdadm-4.0/Makefile
+@@ -41,7 +41,9 @@
+ 
+ KLIBC_GCC = gcc -nostdinc -iwithprefix include -I$(KLIBC)/klibc/include -I$(KLIBC)/linux/include -I$(KLIBC)/klibc/arch/i386/include -I$(KLIBC)/klibc/include/bits32
+ 
+-CC ?= $(CROSS_COMPILE)gcc
++ifeq ($(origin CC),default)
++CC := $(CROSS_COMPILE)gcc
++endif
+ CXFLAGS ?= -ggdb
+ CWFLAGS = -Wall -Wstrict-prototypes -Wextra -Wno-unused-parameter
+ ifdef WARN_UNUSED
diff --minimal -Nru mdadm-4.0/debian/patches/series mdadm-4.0/debian/patches/series
--- mdadm-4.0/debian/patches/series	2017-05-12 13:28:13.000000000 +0200
+++ mdadm-4.0/debian/patches/series	2017-06-29 22:00:05.000000000 +0200
@@ -3,3 +3,4 @@
 sha1-includes.diff
 readlink-path.patch
 mdmonitor-service-simplify.diff
+cross.patch


More information about the pkg-mdadm-devel mailing list