[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#840891: apr FTCBFS: wrong architecture python, fails to execute gen_test_char



Source: apr
Version: 1.5.2-4
Tags: patch
User: helmutg@debian.org
Usertags: rebootstrap

apr fails to cross build from source for two reasons.
 * It Build-Depends on python, thus selecting the host architecture
   python, which cannot be installed nor executed. Since python is only
   used as a build tool, we really want the build architecture python
   here.
 * It compiles gen_test_char with the host architecture compiler and
   then executes it. The tool needs to be built with the build
   architecture compiler to be able to run it.

The attached patch fixes both issues. Please consider applying it.

Helmut
diff --minimal -Nru apr-1.5.2/debian/changelog apr-1.5.2/debian/changelog
--- apr-1.5.2/debian/changelog	2016-05-29 15:44:28.000000000 +0200
+++ apr-1.5.2/debian/changelog	2016-10-15 21:06:49.000000000 +0200
@@ -1,3 +1,12 @@
+apr (1.5.2-4.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix FTCBFS: (Closes: #-1)
+    + Annotate Build-Depends: python with :any
+    + cross.patch: Build gen_test_char with the build arch compiler
+
+ -- Helmut Grohne <helmut@subdivi.de>  Sat, 15 Oct 2016 19:45:34 +0200
+
 apr (1.5.2-4) unstable; urgency=medium
 
   [ Jean-Michel Vourgère ]
diff --minimal -Nru apr-1.5.2/debian/control apr-1.5.2/debian/control
--- apr-1.5.2/debian/control	2016-05-28 17:05:39.000000000 +0200
+++ apr-1.5.2/debian/control	2016-10-15 19:45:31.000000000 +0200
@@ -3,7 +3,7 @@
 Priority: optional
 Maintainer: Debian Apache Maintainers <debian-apache@lists.debian.org>
 Uploaders: Peter Samuelson <peter@p12n.org>, Stefan Fritsch <sf@debian.org>
-Build-Depends: debhelper (>= 9), autoconf, autotools-dev, mawk, uuid-dev, doxygen, netbase, net-tools, libtool (>= 2), python, libsctp-dev [linux-any]
+Build-Depends: debhelper (>= 9), autoconf, autotools-dev, mawk, uuid-dev, doxygen, netbase, net-tools, libtool (>= 2), python:any, libsctp-dev [linux-any]
 Standards-Version: 3.9.8
 Vcs-Browser: https://anonscm.debian.org/cgit/pkg-apache/apr.git
 Vcs-Git: git://anonscm.debian.org/pkg-apache/apr.git
diff --minimal -Nru apr-1.5.2/debian/patches/cross.patch apr-1.5.2/debian/patches/cross.patch
--- apr-1.5.2/debian/patches/cross.patch	1970-01-01 01:00:00.000000000 +0100
+++ apr-1.5.2/debian/patches/cross.patch	2016-10-15 21:04:31.000000000 +0200
@@ -0,0 +1,39 @@
+From: Helmut Grohne <helmut@subdivi.de>
+Subject: compile gen_test_char with the build architecture compiler
+
+Index: apr-1.5.2/Makefile.in
+===================================================================
+--- apr-1.5.2.orig/Makefile.in
++++ apr-1.5.2/Makefile.in
+@@ -8,6 +8,7 @@
+ # APR (Apache Portable Runtime) library Makefile.
+ #
+ CPP = @CPP@
++CC_FOR_BUILD ?= cc
+ 
+ # get substituted into some targets
+ APR_MAJOR_VERSION=@APR_MAJOR_VERSION@
+@@ -46,7 +47,6 @@
+ 
+ CLEAN_TARGETS = apr-config.out apr.exp exports.c export_vars.c .make.dirs \
+ 	build/apr_rules.out tools/gen_test_char@EXEEXT@ \
+-	tools/gen_test_char.o tools/gen_test_char.lo \
+ 	include/private/apr_escape_test_char.h
+ DISTCLEAN_TARGETS = config.cache config.log config.status \
+ 	include/apr.h include/arch/unix/apr_private.h \
+@@ -138,13 +138,9 @@
+ etags:
+ 	etags `find . -name '*.[ch]'`
+ 
+-OBJECTS_gen_test_char = tools/gen_test_char.lo $(LOCAL_LIBS)
+-tools/gen_test_char.lo: tools/gen_test_char.c
++tools/gen_test_char@EXEEXT@: tools/gen_test_char.c
+ 	$(APR_MKDIR) tools
+-	$(LT_COMPILE)
+-
+-tools/gen_test_char@EXEEXT@: $(OBJECTS_gen_test_char)
+-	$(LINK_PROG) $(OBJECTS_gen_test_char) $(ALL_LIBS)
++	$(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) -o $@ $<
+ 
+ include/private/apr_escape_test_char.h: tools/gen_test_char@EXEEXT@
+ 	$(APR_MKDIR) include/private
diff --minimal -Nru apr-1.5.2/debian/patches/series apr-1.5.2/debian/patches/series
--- apr-1.5.2/debian/patches/series	2015-08-21 19:57:29.000000000 +0200
+++ apr-1.5.2/debian/patches/series	2016-10-15 20:49:37.000000000 +0200
@@ -10,3 +10,4 @@
 apr_mcast_v6.patch
 debug_testpoll_failure.patch
 use_fcntl_locking.patch
+cross.patch

Reply to: