Source: squid
Version: 4.4-1
Tags: patch
User: helm...@debian.org
Usertags: rebootstrap

squid fails to cross build from source for a number of reasons. The
immediate failure is with the g++ build dependency as that conflicts
with the build architecture g++. For properly expressing the dependency,
we'd need "toolchain dependency translation", which isn't a thing yet.
However, the relevant dependencies are always satisfied since stretch.
Therefore, we can simply drop them.

During a amd64 -> arm64 cross build, somehow the -m64 flag leaks into
CFLAGS. Unfortunately, the arm64 cross compiler doesn't like that flag
and the build fails. It turns out that the flag originates from getconf,
which is called while figuring out LFS flags. By passing
--with-build-environment=default, we bypass getconf and tell squid to
simpy use _FILE_OFFSET_BITS and that always works on Debian.

Lateron, running cf_gen fails, because it was built with the wrong
compiler. squid's configure doesn't correctly figure out the build
architecture compiler, so it needs to be told explicitly via BUILDCXX.

The attached patch fixes all of these problems and makes squid cross
buildable. Please consider applying it.

Helmut
diff --minimal -Nru squid-4.4/debian/changelog squid-4.4/debian/changelog
--- squid-4.4/debian/changelog  2018-10-30 14:57:15.000000000 +0100
+++ squid-4.4/debian/changelog  2018-12-15 15:00:46.000000000 +0100
@@ -1,3 +1,14 @@
+squid (4.4-1.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix FTCBFS: (Closes: #-1)
+    + Drop compiler Build-Depends: always satisfied since stretch.
+    + Pass --with-build-environment=default to ./configure to avoid leaking
+      getconf results into CFLAGS.
+    + Pass BUILDCXX to ./configure.
+
+ -- Helmut Grohne <hel...@subdivi.de>  Sat, 15 Dec 2018 15:00:46 +0100
+
 squid (4.4-1) unstable; urgency=high
 
   * Urgency high due to security fixes
diff --minimal -Nru squid-4.4/debian/control squid-4.4/debian/control
--- squid-4.4/debian/control    2018-10-30 14:57:15.000000000 +0100
+++ squid-4.4/debian/control    2018-12-15 15:00:46.000000000 +0100
@@ -8,8 +8,6 @@
 Vcs-Git: https://salsa.debian.org/squid-team/squid.git
 Vcs-Browser: https://salsa.debian.org/squid-team/squid
 Build-Depends: ed, libltdl-dev, pkg-config
-       , g++ (>= 4.9) | clang (>= 3.7)
-       , gcc (>= 4.9) | clang (>= 3.7)
        , cdbs, debhelper (>=10), dpkg-dev (>= 1.17.11~), lsb-release
        , libcppunit-dev
        , libcap2-dev [linux-any]
diff --minimal -Nru squid-4.4/debian/rules squid-4.4/debian/rules
--- squid-4.4/debian/rules      2018-10-30 14:57:15.000000000 +0100
+++ squid-4.4/debian/rules      2018-12-15 15:00:46.000000000 +0100
@@ -11,6 +11,8 @@
 
 export DEB_BUILD_PARALLEL = yes
 include /usr/share/dpkg/buildflags.mk
+-include /usr/share/dpkg/buildtools.mk
+CXX_FOR_BUILD ?= $(CXX)
 
 include /usr/share/cdbs/1/rules/debhelper.mk
 include /usr/share/cdbs/1/class/autotools.mk
@@ -24,6 +26,7 @@
 BUILDINFO := $(shell lsb_release -si 2>/dev/null)
 
 DEB_CONFIGURE_EXTRA_FLAGS := BUILDCXXFLAGS="$(CXXFLAGS) $(CPPFLAGS) 
$(LDFLAGS)" \
+               BUILDCXX=$(CXX_FOR_BUILD) \
                --enable-build-info="$(BUILDINFO) $(DEB_HOST_ARCH_OS)" \
                --datadir=/usr/share/squid \
                --sysconfdir=/etc/squid \
@@ -57,6 +60,7 @@
                --with-pidfile=/var/run/squid.pid \
                --with-filedescriptors=65536 \
                --with-large-files \
+               --with-build-environment=default \
                --with-default-user=proxy \
                --with-gnutls
 

Reply via email to