diff mbox series

[2/3] debian: Pass --build and --host to configure

Message ID 20210928002552.10517-3-bage@debian.org (mailing list archive)
State Superseded
Headers show
Series debian updates | expand

Commit Message

Bastian Germann Sept. 28, 2021, 12:25 a.m. UTC
xfsprogs fails to cross build because it fails to pass --host to configure.
Thus it selects the build architecture as host architecture and fails
configure, because the requested libraries are only installed for the host
architecture.

Link: https://bugs.debian.org/794158
Reported-by: Helmut Grohne <helmut@subdivi.de>
Signed-off-by: Bastian Germann <bage@debian.org>
---
 debian/changelog | 8 ++++++++
 debian/rules     | 9 +++++++--
 2 files changed, 15 insertions(+), 2 deletions(-)

Comments

Darrick J. Wong Oct. 4, 2021, 6:27 p.m. UTC | #1
On Tue, Sep 27, 2021 at 02:25:51AM +0200, Bastian Germann wrote:
> xfsprogs fails to cross build because it fails to pass --host to configure.
> Thus it selects the build architecture as host architecture and fails
> configure, because the requested libraries are only installed for the host
> architecture.
> 
> Link: https://bugs.debian.org/794158
> Reported-by: Helmut Grohne <helmut@subdivi.de>
> Signed-off-by: Bastian Germann <bage@debian.org>

Thanks for fixing this longstanding bug. :/

/me has had a similar patch (that keeps falling out of my tree because I
don't do cross builds all that often) so...

Reviewed-by: Darrick J. Wong <djwong@kernel.org>

--D

> ---
>  debian/changelog | 8 ++++++++
>  debian/rules     | 9 +++++++--
>  2 files changed, 15 insertions(+), 2 deletions(-)
> 
> diff --git a/debian/changelog b/debian/changelog
> index 4f09e2ca..8b5c6037 100644
> --- a/debian/changelog
> +++ b/debian/changelog
> @@ -1,3 +1,11 @@
> +xfsprogs (5.13.0-2) unstable; urgency=medium
> +
> +  [ Helmut Grohne ]
> +  * Fix FTCBFS (Closes: #794158)
> +    + Pass --build and --host to configure
> +
> + -- Bastian Germann <bage@debian.org>  Tue, 28 Sep 2021 00:42:50 +0200
> +
>  xfsprogs (5.13.0-1) unstable; urgency=medium
>  
>    * New upstream release
> diff --git a/debian/rules b/debian/rules
> index fe9a1c3a..e12814b3 100755
> --- a/debian/rules
> +++ b/debian/rules
> @@ -11,6 +11,9 @@ package = xfsprogs
>  develop = xfslibs-dev
>  bootpkg = xfsprogs-udeb
>  
> +DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
> +DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
> +
>  version = $(shell dpkg-parsechangelog | grep ^Version: | cut -d ' ' -f 2 | cut -d '-' -f 1)
>  target ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
>  udebpkg = $(bootpkg)_$(version)_$(target).udeb
> @@ -23,11 +26,13 @@ pkgdev = DIST_ROOT=`pwd`/$(dirdev); export DIST_ROOT;
>  pkgdi  = DIST_ROOT=`pwd`/$(dirdi); export DIST_ROOT;
>  stdenv = @GZIP=-q; export GZIP;
>  
> +configure_options = --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
> +
>  options = export DEBUG=-DNDEBUG DISTRIBUTION=debian \
>  	  INSTALL_USER=root INSTALL_GROUP=root \
> -	  LOCAL_CONFIGURE_OPTIONS="--enable-editline=yes --enable-blkid=yes --disable-ubsan --disable-addrsan --disable-threadsan --enable-lto" ;
> +	  LOCAL_CONFIGURE_OPTIONS="$(configure_options) --enable-editline=yes --enable-blkid=yes --disable-ubsan --disable-addrsan --disable-threadsan --enable-lto" ;
>  diopts  = $(options) \
> -	  export OPTIMIZER=-Os LOCAL_CONFIGURE_OPTIONS="--enable-gettext=no --disable-ubsan --disable-addrsan --disable-threadsan --enable-lto" ;
> +	  export OPTIMIZER=-Os LOCAL_CONFIGURE_OPTIONS="$(configure_options) --enable-gettext=no --disable-ubsan --disable-addrsan --disable-threadsan --enable-lto" ;
>  checkdir = test -f debian/rules
>  
>  build: build-arch build-indep
> -- 
> 2.33.0
>
diff mbox series

Patch

diff --git a/debian/changelog b/debian/changelog
index 4f09e2ca..8b5c6037 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@ 
+xfsprogs (5.13.0-2) unstable; urgency=medium
+
+  [ Helmut Grohne ]
+  * Fix FTCBFS (Closes: #794158)
+    + Pass --build and --host to configure
+
+ -- Bastian Germann <bage@debian.org>  Tue, 28 Sep 2021 00:42:50 +0200
+
 xfsprogs (5.13.0-1) unstable; urgency=medium
 
   * New upstream release
diff --git a/debian/rules b/debian/rules
index fe9a1c3a..e12814b3 100755
--- a/debian/rules
+++ b/debian/rules
@@ -11,6 +11,9 @@  package = xfsprogs
 develop = xfslibs-dev
 bootpkg = xfsprogs-udeb
 
+DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
+DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
+
 version = $(shell dpkg-parsechangelog | grep ^Version: | cut -d ' ' -f 2 | cut -d '-' -f 1)
 target ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
 udebpkg = $(bootpkg)_$(version)_$(target).udeb
@@ -23,11 +26,13 @@  pkgdev = DIST_ROOT=`pwd`/$(dirdev); export DIST_ROOT;
 pkgdi  = DIST_ROOT=`pwd`/$(dirdi); export DIST_ROOT;
 stdenv = @GZIP=-q; export GZIP;
 
+configure_options = --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
+
 options = export DEBUG=-DNDEBUG DISTRIBUTION=debian \
 	  INSTALL_USER=root INSTALL_GROUP=root \
-	  LOCAL_CONFIGURE_OPTIONS="--enable-editline=yes --enable-blkid=yes --disable-ubsan --disable-addrsan --disable-threadsan --enable-lto" ;
+	  LOCAL_CONFIGURE_OPTIONS="$(configure_options) --enable-editline=yes --enable-blkid=yes --disable-ubsan --disable-addrsan --disable-threadsan --enable-lto" ;
 diopts  = $(options) \
-	  export OPTIMIZER=-Os LOCAL_CONFIGURE_OPTIONS="--enable-gettext=no --disable-ubsan --disable-addrsan --disable-threadsan --enable-lto" ;
+	  export OPTIMIZER=-Os LOCAL_CONFIGURE_OPTIONS="$(configure_options) --enable-gettext=no --disable-ubsan --disable-addrsan --disable-threadsan --enable-lto" ;
 checkdir = test -f debian/rules
 
 build: build-arch build-indep