Source: memtester
Version: 4.3.0-3
Tags: patch
User: helm...@debian.org
Usertags: rebootstrap

memtester FTCFBS, because it uses the build architecture compiler. The
build actually fails when dh_strip uses the host architecture strip on
the build architecture binary.

I am attaching a patch that forces the triplet-prefixed compiler upon
the wicked build system that hides the compiler invocations and fails to
use hardened build flags. I didn't find a simpler way to do that.

Helmut
diff --minimal -Nru memtester-4.3.0/debian/changelog 
memtester-4.3.0/debian/changelog
--- memtester-4.3.0/debian/changelog    2013-04-01 12:06:33.000000000 +0200
+++ memtester-4.3.0/debian/changelog    2015-09-12 20:03:05.000000000 +0200
@@ -1,3 +1,10 @@
+memtester (4.3.0-3.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Export CC to support cross compilation. (Closes: #-1)
+
+ -- Helmut Grohne <hel...@subdivi.de>  Sat, 12 Sep 2015 20:02:51 +0200
+
 memtester (4.3.0-3) unstable; urgency=low
 
   * New maintainer (closes: #704327).
diff --minimal -Nru memtester-4.3.0/debian/patches/02-cross.patch 
memtester-4.3.0/debian/patches/02-cross.patch
--- memtester-4.3.0/debian/patches/02-cross.patch       1970-01-01 
01:00:00.000000000 +0100
+++ memtester-4.3.0/debian/patches/02-cross.patch       2015-09-12 
20:52:44.000000000 +0200
@@ -0,0 +1,34 @@
+Author: Helmut Grohne <hel...@subdivi.de>
+Description: make the build system honor $CC to facilitate cross builds
+
+Index: memtester-4.3.0/conf-cc
+===================================================================
+--- memtester-4.3.0.orig/conf-cc       2012-06-09 23:45:22.000000000 +0200
++++ memtester-4.3.0/conf-cc    2015-09-12 20:36:27.000000000 +0200
+@@ -1,3 +1,3 @@
+-cc -O2 -DPOSIX -D_POSIX_C_SOURCE=200809L -D_FILE_OFFSET_BITS=64 
-DTEST_NARROW_WRITES -c
++$CC -O2 -DPOSIX -D_POSIX_C_SOURCE=200809L -D_FILE_OFFSET_BITS=64 
-DTEST_NARROW_WRITES -c
+ 
+ This will be used to compile .c files.
+Index: memtester-4.3.0/conf-ld
+===================================================================
+--- memtester-4.3.0.orig/conf-ld       2012-06-09 23:45:22.000000000 +0200
++++ memtester-4.3.0/conf-ld    2015-09-12 20:36:33.000000000 +0200
+@@ -1,3 +1,3 @@
+-cc -s
++$CC -s
+ 
+ This will be used to link .o files into an executable.
+Index: memtester-4.3.0/Makefile
+===================================================================
+--- memtester-4.3.0.orig/Makefile      2015-09-12 20:01:06.000000000 +0200
++++ memtester-4.3.0/Makefile   2015-09-12 20:50:40.000000000 +0200
+@@ -10,8 +10,6 @@
+ # You don't need to edit these; change the contents of the conf-cc and conf-ld
+ # files if you need to change the compile/link commands.  See the README for
+ # more information.
+-CC                    = $(shell head -n 1 conf-cc)
+-LD                    = $(shell head -n 1 conf-ld)
+ 
+ SOURCES               = memtester.c tests.c
+ OBJECTS               = $(SOURCES:.c=.o)
diff --minimal -Nru memtester-4.3.0/debian/patches/series 
memtester-4.3.0/debian/patches/series
--- memtester-4.3.0/debian/patches/series       2013-04-01 12:06:46.000000000 
+0200
+++ memtester-4.3.0/debian/patches/series       2015-09-12 20:12:09.000000000 
+0200
@@ -1 +1,2 @@
 01-manpage.patch
+02-cross.patch
diff --minimal -Nru memtester-4.3.0/debian/rules memtester-4.3.0/debian/rules
--- memtester-4.3.0/debian/rules        2012-11-23 10:29:43.000000000 +0100
+++ memtester-4.3.0/debian/rules        2015-09-12 20:51:56.000000000 +0200
@@ -1,5 +1,12 @@
 #!/usr/bin/make -f
 
+DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
+
+ifeq ($(origin CC),default)
+CC = $(DEB_HOST_GNU_TYPE)-gcc
+endif
+export CC
+
 %:
        dh ${@}
 

Reply via email to