Bug#605038: Typos in rules prevent gmp cross build (using xdeb)

Steve Langasek steve.langasek at canonical.com
Fri Mar 11 00:53:43 UTC 2011


Package: gmp
Version: 2:4.3.2+dfsg-1
Severity: normal
Tags: patch
User: ubuntu-devel at lists.ubuntu.com
Usertags: origin-ubuntu natty ubuntu-patch

Hi Steve,

Attached is a more targeted patch fixing the cross compilation issues with
gmp.  It seems the only significant whitespace issue here was with the
dpkg-architecture calls; this construction left embedded whitespace at the
front of the variable value, which means it gets included in the name of the
compiler called as CC, etc.

But a more detailed examination shows there's no reason for this $(subst)
call anyway, because dpkg-architecture -qDEB_HOST_GNU_TYPE doesn't spit out
anything with 'i386' in it, on any distro, for several years.  (In Debian,
it's been i486-linux-gnu for 3 release cycles or so; in Ubuntu, it's been
i586 or i686 for near to that.)  So I think it makes sense to just drop
this.

The other point is that cross-building for armel fails (under some
circumstances?) unless --target is also set.

The attached patch implements both of these changes.  I've just uploaded
these changes to Ubuntu with the following changelog entry:

  [ Peter Pearse ]
  * For cross builds, strip GNU_TYPES & pass --target

  [ Steve Langasek ]
  * We don't need to use $(strip), just avoid having whitespace in the first
    place.
  * For that matter, this s/i386/i486/ substitution is entirely unnecessary
    to begin with; the DEB_HOST_GNU_TYPE is already i486 on Debian, and i686
    on Ubuntu.  So as long as we're modifying this line, let's simplify it
    some more.

Thanks,
-- 
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
Ubuntu Developer                                    http://www.debian.org/
slangasek at ubuntu.com                                     vorlon at debian.org
-------------- next part --------------
=== modified file 'debian/rules'
--- debian/rules	2011-03-04 19:01:00 +0000
+++ debian/rules	2011-03-11 00:29:16 +0000
@@ -16,8 +16,8 @@
 endif
 
 DEB_HOST_ARCH  ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
-export DEB_HOST_GNU_TYPE  := $(subst i386,i486, $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE))
-export DEB_BUILD_GNU_TYPE := $(subst i386,i486, $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE))
+export DEB_HOST_GNU_TYPE  := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
+export DEB_BUILD_GNU_TYPE := $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
 
 MAKE_CHECK = : disabled make check
 ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
@@ -55,7 +55,7 @@
   confflags_build += --build $(DEB_BUILD_GNU_TYPE)
 else
   AR = $(DEB_HOST_GNU_TYPE)-ar
-  confflags_build += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
+  confflags_build += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE) --target $(DEB_HOST_GNU_TYPE)
 endif
 
 ifneq (,$(findstring $(DEB_HOST_ARCH), amd64 ppc64 kfreebsd-amd64))



More information about the debian-science-maintainers mailing list