Debian Bug report logs - #450483
cdbs: Stop setting DEB_CONFIGURE_SCRIPT_ENV in order to enable cross-building

version graph

Package: cdbs; Maintainer for cdbs is CDBS Hackers <build-common-hackers@lists.alioth.debian.org>; Source for cdbs is src:cdbs.

Reported by: Neil Williams <codehelp@debian.org>

Date: Wed, 7 Nov 2007 14:57:01 UTC

Severity: normal

Tags: confirmed, patch

Found in version cdbs/0.4.50

Fixed in version cdbs/0.4.77

Done: Jonas Smedegaard <dr@jones.dk>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, CDBS Hackers <build-common-hackers@lists.alioth.debian.org>:
Bug#450483; Package cdbs. Full text and rfc822 format available.

Acknowledgement sent to Neil Williams <codehelp@debian.org>:
New Bug report received and forwarded. Copy sent to CDBS Hackers <build-common-hackers@lists.alioth.debian.org>. Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Neil Williams <codehelp@debian.org>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: cdbs: Stop setting DEB_CONFIGURE_SCRIPT_ENV in order to enable cross-building
Date: Wed, 07 Nov 2007 14:55:55 +0000
[Message part 1 (text/plain, inline)]
Package: cdbs
Version: 0.4.50
Severity: normal
Tags: patch

The cross building support in Debian has been rewritten and part of the
changes included stopping the tools from overriding the MAKEFLAGS
variable in order to allow CC_FOR_BUILD to identify the correct compiler
to use for internal build tools during a cross compile.

The effect of this in CDBS packages is that DEB_CONFIGURE_SCRIPT_ENV now
prevents cross compilation because it sets CC etc. and the tools no
longer set an override.

Please can DEB_CONFIGURE_SCRIPT_ENV be set to empty in CDBS so that CDBS
packages can be cross-built successfully?

Patch for 1/class/autotools-vars.mk.in attached that unsets
DEB_CONFIGURE_SCRIPT_ENV if cross compiling.


-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.22-2-amd64 (SMP w/1 CPU core)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages cdbs depends on:
ii  debhelper                     5.0.60     helper programs for debian/rules

Versions of packages cdbs recommends:
ii  autotools-dev                 20070725.1 Update infrastructure for config.{

-- no debconf information
[cdbs.diff (text/plain, attachment)]

Information forwarded to debian-bugs-dist@lists.debian.org, CDBS Hackers <build-common-hackers@lists.alioth.debian.org>:
Bug#450483; Package cdbs. Full text and rfc822 format available.

Acknowledgement sent to Peter Eisentraut <peter_e@gmx.net>:
Extra info received and forwarded to list. Copy sent to CDBS Hackers <build-common-hackers@lists.alioth.debian.org>. Full text and rfc822 format available.

Message #10 received at 450483@bugs.debian.org (full text, mbox):

From: Peter Eisentraut <peter_e@gmx.net>
To: Neil Williams <codehelp@debian.org>, 450483@bugs.debian.org
Subject: Re: [Build-common-hackers] Bug#450483: cdbs: Stop setting DEB_CONFIGURE_SCRIPT_ENV in order to enable cross-building
Date: Wed, 7 Nov 2007 16:14:13 +0100
Am Mittwoch, 7. November 2007 schrieb Neil Williams:
> Please can DEB_CONFIGURE_SCRIPT_ENV be set to empty in CDBS so that CDBS
> packages can be cross-built successfully?

Um, well, no, because this would break all packages that rely on the settings 
of the environment variables that are transported this way.




Information forwarded to debian-bugs-dist@lists.debian.org, CDBS Hackers <build-common-hackers@lists.alioth.debian.org>:
Bug#450483; Package cdbs. Full text and rfc822 format available.

Acknowledgement sent to Neil Williams <codehelp@debian.org>:
Extra info received and forwarded to list. Copy sent to CDBS Hackers <build-common-hackers@lists.alioth.debian.org>. Full text and rfc822 format available.

Message #15 received at 450483@bugs.debian.org (full text, mbox):

From: Neil Williams <codehelp@debian.org>
To: Peter Eisentraut <peter_e@gmx.net>
Cc: 450483@bugs.debian.org
Subject: Re: [Build-common-hackers] Bug#450483: cdbs: Stop setting DEB_CONFIGURE_SCRIPT_ENV in order to enable cross-building
Date: Wed, 7 Nov 2007 16:16:36 +0000
[Message part 1 (text/plain, inline)]
On Wed, 7 Nov 2007 16:14:13 +0100
Peter Eisentraut <peter_e@gmx.net> wrote:

> Am Mittwoch, 7. November 2007 schrieb Neil Williams:
> > Please can DEB_CONFIGURE_SCRIPT_ENV be set to empty in CDBS so that CDBS
> > packages can be cross-built successfully?
> 
> Um, well, no, because this would break all packages that rely on the settings 
> of the environment variables that are transported this way.
 
It is only when cross-compiling and all those packages need to be fixed
anyway because the cross compiling support no longer provides anything
useful for CDBS to pass to this variable.

Please check the patch - it only sets DEB_CONFIGURE_SCRIPT_ENV to empty
when cross-compiling.

-- 


Neil Williams
=============
http://www.data-freedom.org/
http://www.nosoftwarepatents.com/
http://www.linux.codehelp.co.uk/

[Message part 2 (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, CDBS Hackers <build-common-hackers@lists.alioth.debian.org>:
Bug#450483; Package cdbs. Full text and rfc822 format available.

Acknowledgement sent to Peter Eisentraut <peter_e@gmx.net>:
Extra info received and forwarded to list. Copy sent to CDBS Hackers <build-common-hackers@lists.alioth.debian.org>. Full text and rfc822 format available.

Message #20 received at 450483@bugs.debian.org (full text, mbox):

From: Peter Eisentraut <peter_e@gmx.net>
To: Neil Williams <codehelp@debian.org>
Cc: 450483@bugs.debian.org
Subject: Re: [Build-common-hackers] Bug#450483: cdbs: Stop setting DEB_CONFIGURE_SCRIPT_ENV in order to enable cross-building
Date: Wed, 7 Nov 2007 17:53:38 +0100
Am Mittwoch, 7. November 2007 schrieb Neil Williams:
> It is only when cross-compiling and all those packages need to be fixed
> anyway because the cross compiling support no longer provides anything
> useful for CDBS to pass to this variable.

But there are many other situations in which useful things are passed around 
that way, which packages need in order to build properly.

> Please check the patch - it only sets DEB_CONFIGURE_SCRIPT_ENV to empty
> when cross-compiling.

Thus making the affected packages fail to build properly when cross-compiling, 
which appears to be contrary to your intentions.

Which part of the contents of DEB_CONFIGURE_SCRIPT_ENV are you objecting to, 
specifically?




Information forwarded to debian-bugs-dist@lists.debian.org, CDBS Hackers <build-common-hackers@lists.alioth.debian.org>:
Bug#450483; Package cdbs. Full text and rfc822 format available.

Acknowledgement sent to Neil Williams <codehelp@debian.org>:
Extra info received and forwarded to list. Copy sent to CDBS Hackers <build-common-hackers@lists.alioth.debian.org>. Full text and rfc822 format available.

Message #25 received at 450483@bugs.debian.org (full text, mbox):

From: Neil Williams <codehelp@debian.org>
To: Peter Eisentraut <peter_e@gmx.net>
Cc: 450483@bugs.debian.org
Subject: Re: [Build-common-hackers] Bug#450483: cdbs: Stop setting DEB_CONFIGURE_SCRIPT_ENV in order to enable cross-building
Date: Wed, 7 Nov 2007 17:48:36 +0000
[Message part 1 (text/plain, inline)]
On Wed, 7 Nov 2007 17:53:38 +0100
Peter Eisentraut <peter_e@gmx.net> wrote:

> Am Mittwoch, 7. November 2007 schrieb Neil Williams:
> > It is only when cross-compiling and all those packages need to be fixed
> > anyway because the cross compiling support no longer provides anything
> > useful for CDBS to pass to this variable.
> 
> But there are many other situations in which useful things are passed around 
> that way, which packages need in order to build properly.

No. MAKEFLAGS should not be overwritten by the build tools. *packages*
may need MAKEFLAGS and the package should ensure that MAKEFLAGS is
suitably set. The build tools cannot take over MAKEFLAGS and set it in
a generalised manner. Keep it package specific.

You appear to be confused here because CDBS IS clobbering MAKEFLAGS and
yet you're saying that packages need it - yet CDBS tramples all over it!
 
Let the packages set the environment and everything is good.

Please note: I have rewritten the cross building support in Debian
(about 75% of it) and I specifically *removed* these overrides because
they break packages in a way that cannot be overridden.

> > Please check the patch - it only sets DEB_CONFIGURE_SCRIPT_ENV to empty
> > when cross-compiling.
> 
> Thus making the affected packages fail to build properly when cross-compiling, 

Actually, packages fail to cross compile with it set because CDBS sets
'gcc' when I need to set arm-linux-gnu-gcc etc. That is set by
dpkg-architecture and debian/rules but CDBS goes and tramples all over
it.

When CDBS sets CC=gcc I cannot unset or override that anymore because
the cross compiling tools (like CDBS) must *NOT* override it or things
like CC_FOR_BUILD will fail.

That's where this whole thing started: libx11
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=425445

> which appears to be contrary to your intentions.
> 
> Which part of the contents of DEB_CONFIGURE_SCRIPT_ENV are you objecting to, 
> specifically?

All of it.

CDBS has no business setting DEB_CONFIGURE_SCRIPT_ENV.

Any package that "needs" it is simply broken because there is no way of
providing useful information by that method.

CDBS already sets DEB_HOST_GNU_TYPE when specified by dpkg-architecture
- as set by the cross build itself - but then DEB_CONFIGURE_SCRIPT_ENV
goes and CLOBBERS IT!

Only if DEB_CONFIGURE_SCRIPT_ENV is empty can DEB_HOST_GNU_TYPE
actually get passed on to the package build.

-- 


Neil Williams
=============
http://www.data-freedom.org/
http://www.nosoftwarepatents.com/
http://www.linux.codehelp.co.uk/

[Message part 2 (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, CDBS Hackers <build-common-hackers@lists.alioth.debian.org>:
Bug#450483; Package cdbs. Full text and rfc822 format available.

Acknowledgement sent to Peter Eisentraut <peter_e@gmx.net>:
Extra info received and forwarded to list. Copy sent to CDBS Hackers <build-common-hackers@lists.alioth.debian.org>. Full text and rfc822 format available.

Message #30 received at 450483@bugs.debian.org (full text, mbox):

From: Peter Eisentraut <peter_e@gmx.net>
To: Neil Williams <codehelp@debian.org>
Cc: 450483@bugs.debian.org
Subject: Re: [Build-common-hackers] Bug#450483: cdbs: Stop setting DEB_CONFIGURE_SCRIPT_ENV in order to enable cross-building
Date: Wed, 7 Nov 2007 19:07:28 +0100
Neil Williams wrote:
> No. MAKEFLAGS should not be overwritten by the build tools.

Huh?  This discussion is about DEB_CONFIGURE_SCRIPT_ENV.  How do you get 
from that to MAKEFLAGS?  AFAICS, nothing in cdbs touches MAKEFLAGS.

> CDBS has no business setting DEB_CONFIGURE_SCRIPT_ENV.
>
> Any package that "needs" it is simply broken because there is no way
> of providing useful information by that method.

Explain that to all the packages that are making use of it.




Information forwarded to debian-bugs-dist@lists.debian.org, CDBS Hackers <build-common-hackers@lists.alioth.debian.org>:
Bug#450483; Package cdbs. Full text and rfc822 format available.

Acknowledgement sent to Peter Eisentraut <peter_e@gmx.net>:
Extra info received and forwarded to list. Copy sent to CDBS Hackers <build-common-hackers@lists.alioth.debian.org>. Full text and rfc822 format available.

Message #35 received at 450483@bugs.debian.org (full text, mbox):

From: Peter Eisentraut <peter_e@gmx.net>
To: Neil Williams <codehelp@debian.org>
Cc: 450483@bugs.debian.org
Subject: Re: [Build-common-hackers] Bug#450483: cdbs: Stop setting DEB_CONFIGURE_SCRIPT_ENV in order to enable cross-building
Date: Wed, 7 Nov 2007 19:09:01 +0100
Neil Williams wrote:
> Actually, packages fail to cross compile with it set because CDBS
> sets 'gcc'

It does no such thing.




Information forwarded to debian-bugs-dist@lists.debian.org, CDBS Hackers <build-common-hackers@lists.alioth.debian.org>:
Bug#450483; Package cdbs. Full text and rfc822 format available.

Acknowledgement sent to Neil Williams <codehelp@debian.org>:
Extra info received and forwarded to list. Copy sent to CDBS Hackers <build-common-hackers@lists.alioth.debian.org>. Full text and rfc822 format available.

Message #40 received at 450483@bugs.debian.org (full text, mbox):

From: Neil Williams <codehelp@debian.org>
To: 450483@bugs.debian.org
Subject: Re: [Build-common-hackers] Bug#450483: cdbs: Stop setting DEB_CONFIGURE_SCRIPT_ENV in order to enable cross-building
Date: Wed, 7 Nov 2007 19:03:13 +0000
[Message part 1 (text/plain, inline)]
On Wed, 7 Nov 2007 19:07:28 +0100
Peter Eisentraut <peter_e@gmx.net> wrote:

Forgot to CC the bug report.

> Neil Williams wrote:
> > No. MAKEFLAGS should not be overwritten by the build tools.
> 
> Huh?  This discussion is about DEB_CONFIGURE_SCRIPT_ENV.  How do you get 
> from that to MAKEFLAGS?  AFAICS, nothing in cdbs touches MAKEFLAGS.

Setting CC= overrides MAKEFLAGS, that is why this needs to be removed.

I need CDBS to NOT set CC - that is the sum of it.

> > CDBS has no business setting DEB_CONFIGURE_SCRIPT_ENV.
> >
> > Any package that "needs" it is simply broken because there is no way
> > of providing useful information by that method.
> 
> Explain that to all the packages that are making use of it.

I will - because it only matters in cross-builds (because that is how I
have framed the patch) and the cross build tools explain why this is so
and what needs to be done. In the case of CDBS, if this patch is
implemented, nothing needs to be done.


-- 


Neil Williams
=============
http://www.data-freedom.org/
http://www.nosoftwarepatents.com/
http://www.linux.codehelp.co.uk/


[Message part 2 (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, CDBS Hackers <build-common-hackers@lists.alioth.debian.org>:
Bug#450483; Package cdbs. Full text and rfc822 format available.

Acknowledgement sent to Neil Williams <codehelp@debian.org>:
Extra info received and forwarded to list. Copy sent to CDBS Hackers <build-common-hackers@lists.alioth.debian.org>. Full text and rfc822 format available.

Message #45 received at 450483@bugs.debian.org (full text, mbox):

From: Neil Williams <codehelp@debian.org>
To: 450483@bugs.debian.org
Subject: Re: [Build-common-hackers] Bug#450483: cdbs: Stop setting DEB_CONFIGURE_SCRIPT_ENV in order to enable cross-building
Date: Wed, 7 Nov 2007 19:02:56 +0000
[Message part 1 (text/plain, inline)]
On Wed, 7 Nov 2007 19:09:01 +0100
Peter Eisentraut <peter_e@gmx.net> wrote:

Forgot to keep the bug report in CC. Sorry.

> Neil Williams wrote:
> > Actually, packages fail to cross compile with it set because CDBS
> > sets 'gcc'
> 
> It does no such thing.

It does - CC=gcc

The effect of DEB_CONFIGURE_SCRIPT_ENV is that the package tries to
cross build using gcc which simply breaks.

Unset DEB_CONFIGURE_SCRIPT_ENV for the crossbuild and gcc gets the
value from --host and works fine.

This is ONLY relevant for cross building and cross building support has
been entirely rewritten recently. The main change was to stop passing
CC to all packages so that certain packages could get a sensible
setting for CC_FOR_BUILD. The $(CC) setting should come from --host, NOT
from DEB_CONFIGURE_SCRIPT_ENV.

Unset DEB_CONFIGURE_SCRIPT_ENV and the cross build gets $(CC) from --host
as it should.

-- 


Neil Williams
=============
http://www.data-freedom.org/
http://www.nosoftwarepatents.com/
http://www.linux.codehelp.co.uk/


[Message part 2 (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, CDBS Hackers <build-common-hackers@lists.alioth.debian.org>:
Bug#450483; Package cdbs. Full text and rfc822 format available.

Acknowledgement sent to Peter Eisentraut <peter_e@gmx.net>:
Extra info received and forwarded to list. Copy sent to CDBS Hackers <build-common-hackers@lists.alioth.debian.org>. Full text and rfc822 format available.

Message #50 received at 450483@bugs.debian.org (full text, mbox):

From: Peter Eisentraut <peter_e@gmx.net>
To: Neil Williams <codehelp@debian.org>, 450483@bugs.debian.org
Subject: Re: [Build-common-hackers] Bug#450483: Bug#450483: cdbs: Stop setting DEB_CONFIGURE_SCRIPT_ENV in order to enable cross-building
Date: Wed, 7 Nov 2007 20:38:39 +0100
Neil Williams wrote:
> I need CDBS to NOT set CC - that is the sum of it.

I think what you need is something like this:

Index: 1/class/autotools-vars.mk.in
===================================================================
--- 1/class/autotools-vars.mk.in        (Revision 175)
+++ 1/class/autotools-vars.mk.in        (Arbeitskopie)
@@ -31,7 +31,13 @@
 DEB_AC_AUX_DIR = $(DEB_SRCDIR)

 DEB_CONFIGURE_SCRIPT = $(CURDIR)/$(DEB_SRCDIR)/configure
-DEB_CONFIGURE_SCRIPT_ENV = CC="$(CC)" CXX="$(CXX)" CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)"
+DEB_CONFIGURE_SCRIPT_ENV = CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)"
+ifdef CC
+DEB_CONFIGURE_SCRIPT_ENV += CC="$(CC)"
+endif
+ifdef CXX
+DEB_CONFIGURE_SCRIPT_ENV += CXX="$(CXX)"
+endif
 DEB_CONFIGURE_NORMAL_ARGS = --build=$(DEB_BUILD_GNU_TYPE) --prefix=$(DEB_CONFIGURE_PREFIX) --includedir=$(DEB_CONFIGURE_INCLUDEDIR) --mandir=$(DEB_CONFIGURE_MANDIR) --infodir=$(DEB_CONFIGURE_INFODIR) --sysconfdir=$(DEB_CONFIGURE_SYSCONFDIR) --localstatedir=$(DEB_CONFIGURE_LOCALSTATEDIR) --libexecdir=$(DEB_CONFIGURE_LIBEXECDIR) --disable-maintainer-mode --disable-dependency-tracking

 # Provide --host only if different from --build, as recommended in




Information forwarded to debian-bugs-dist@lists.debian.org, CDBS Hackers <build-common-hackers@lists.alioth.debian.org>:
Bug#450483; Package cdbs. Full text and rfc822 format available.

Acknowledgement sent to Neil Williams <codehelp@debian.org>:
Extra info received and forwarded to list. Copy sent to CDBS Hackers <build-common-hackers@lists.alioth.debian.org>. Full text and rfc822 format available.

Message #55 received at 450483@bugs.debian.org (full text, mbox):

From: Neil Williams <codehelp@debian.org>
To: Peter Eisentraut <peter_e@gmx.net>
Cc: 450483@bugs.debian.org
Subject: Re: [Build-common-hackers] Bug#450483: cdbs: Stop setting DEB_CONFIGURE_SCRIPT_ENV in order to enable cross-building
Date: Wed, 7 Nov 2007 20:32:34 +0000
[Message part 1 (text/plain, inline)]
On Wed, 7 Nov 2007 20:27:11 +0100
Peter Eisentraut <peter_e@gmx.net> wrote:

(must remember the bug report CC!)
;-)

> Neil Williams wrote:
> > Setting CC= overrides MAKEFLAGS, that is why this needs to be
> > removed.
> 
> DEB_CONFIGURE_SCRIPT_ENV sets the environment for the configure run.  
> How this gets into MAKEFLAGS is beyond me.
> 
> > I need CDBS to NOT set CC - that is the sum of it.
> 
> I think we can arrange that.  But not the way you propose.

I've tried your patch:
(The bug is the very first two characters).

 cc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -DG_DISABLE_DEPRECATED -DATK_LOCALEDIR=\"/usr/share/locale\" -pthread -I/usr/arm-linux-gnu/include/glib-2.0 -I/usr/arm-linux-gnu/lib/glib-2.0/include -g -Wall -O2 -c atk-enum-types.c  -fPIC -DPIC -o .libs/atk-enum-types.o
...
/usr/arm-linux-gnu/lib/libgobject-2.0.so: could not read symbols: File in wrong format
collect2: ld returned 1 exit status
make[4]: *** [libatk-1.0.la] Error 1
make[4]: Leaving directory `/opt/emdebian/trunk/a/atk1.0/trunk/atk1.0-1.20.0/atk'

I've attached the complete build log, gzipped.

The problem is that $(CC) is still being set.

chmod a+x /opt/emdebian/trunk/a/atk1.0/trunk/atk1.0-1.20.0/./configure
cd . && CFLAGS="-g -Wall -O2" CXXFLAGS="-g -Wall -O2" CPPFLAGS="" LDFLAGS="-Wl,-O1 -Wl,-z,defs -Wl,--as-needed" CC="cc" CXX="g++" /opt/emdebian/trunk/a/atk1.0/trunk/atk1.0-1.20.0/./configure --build=x86_64-linux-gnu --prefix=/usr --includedir="\${prefix}/include" --mandir="\${prefix}/share/man" --infodir="\${prefix}/share/info" --sysconfdir=/etc --localstatedir=/var --libexecdir="\${prefix}/lib/atk1.0" --disable-maintainer-mode --disable-dependency-tracking --host=arm-linux-gnu --srcdir=.   --enable-static 
configure: loading site script /etc/dpkg-cross/cross-config.arm

CC=cc - simply not good enough.

That snippet should indicate the problem - CC is set to a symlink to
gcc and THEN --host is passed.

Setting $(CC) ensures that the Makefile gets CC=gcc and the build breaks.

> Note that DEB_CONFIGURE_SCRIPT_ENV is not only used for passing CC, so 
> you can't just delete it altogether.

Actually, I think - for cross-building only - that is exactly what must
be done. Other packages will get the wrong CXX in the same manner. 

Restore my original patch and the package builds perfectly.

There are more packages to build, yes, but I've tested with a native
build and my patch does not affect it. Your patch does not check
whether the package is in a crossbuild environment so the changes are
more tricky.

For completeness, I'm also attaching a successful build log (with the
-good suffix and also compressed).

Again, it is worth restating that all of this cross-build stuff has
been completely rewritten and a lot of the previous behaviour (like
$(CC) and $(CXX) as well as $(LD), $(AR) and others) have been
completely overhauled.

Support is likely to change again as dpkg-cross finally migrates back
into dpkg but by making these changes now, I can ensure that the final
dpkg changes can be handled entirely within the cross building tools
and not affect the packages again.

Whatever package X did when cross-building before September 2007 is
just historical - it's a whole new frontier. Well, almost.

I struggled with the previous structure all through DebConf7 and got
absolutely nowhere. It was just impossible to build packages sanely if
there were any build tools compiled during the run. As this becomes
more common and as cross-building for Emdebian gets increasingly into
GUI packages, it has become ever more important to get the support in
place.

-- 


Neil Williams
=============
http://www.data-freedom.org/
http://www.nosoftwarepatents.com/
http://www.linux.codehelp.co.uk/

[atk1.0_1.20.0-1em1_arm.build.gz (application/octet-stream, attachment)]
[atk1.0_1.20.0-1em1_arm.build-good.gz (application/octet-stream, attachment)]
[Message part 4 (application/pgp-signature, inline)]

Message sent on to Neil Williams <codehelp@debian.org>:
Bug#450483. Full text and rfc822 format available.

Message #58 received at 450483-submitter@bugs.debian.org (full text, mbox):

From: Peter Eisentraut <peter_e@gmx.net>
To: 450483-submitter@bugs.debian.org
Subject: Re: Bug#450483: cdbs: Stop setting DEB_CONFIGURE_SCRIPT_ENV in order to enable cross-building
Date: Fri, 23 Nov 2007 15:55:12 +0100
Sorry, the last patch couldn't have worked, because CC and CXX are never
undefined.  Try this patch instead; the logic is the same.

Index: 1/class/autotools-vars.mk.in
===================================================================
--- 1/class/autotools-vars.mk.in        (Revision 175)
+++ 1/class/autotools-vars.mk.in        (Arbeitskopie)
@@ -31,7 +31,13 @@
 DEB_AC_AUX_DIR = $(DEB_SRCDIR)

 DEB_CONFIGURE_SCRIPT = $(CURDIR)/$(DEB_SRCDIR)/configure
-DEB_CONFIGURE_SCRIPT_ENV = CC="$(CC)" CXX="$(CXX)" CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)"
+DEB_CONFIGURE_SCRIPT_ENV = CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)"
+ifeq "" "$(findstring $(origin CC),empty default)"
+DEB_CONFIGURE_SCRIPT_ENV += CC="$(CC)"
+endif
+ifeq "" "$(findstring $(origin CXX),empty default)"
+DEB_CONFIGURE_SCRIPT_ENV += CXX="$(CXX)"
+endif
 DEB_CONFIGURE_NORMAL_ARGS = --build=$(DEB_BUILD_GNU_TYPE) --prefix=$(DEB_CONFIGURE_PREFIX) --includedir=$(DEB_CONFIGURE_INCLUDEDIR) --mandir=$(DEB_CONFIGURE_MANDIR) --infodir=$(DEB_CONFIGURE_INFODIR) --sysconfdir=$(DEB_CONFIGURE_SYSCONFDIR) --localstatedir=$(DEB_CONFIGURE_LOCALSTATEDIR) --libexecdir=$(DEB_CONFIGURE_LIBEXECDIR) --disable-maintainer-mode --disable-dependency-tracking

 # Provide --host only if different from --build, as recommended in




Information forwarded to debian-bugs-dist@lists.debian.org, CDBS Hackers <build-common-hackers@lists.alioth.debian.org>:
Bug#450483; Package cdbs. Full text and rfc822 format available.

Acknowledgement sent to Neil Williams <codehelp@debian.org>:
Extra info received and forwarded to list. Copy sent to CDBS Hackers <build-common-hackers@lists.alioth.debian.org>. Full text and rfc822 format available.

Message #63 received at 450483@bugs.debian.org (full text, mbox):

From: Neil Williams <codehelp@debian.org>
To: Peter Eisentraut <peter_e@gmx.net>, 450483@bugs.debian.org
Subject: Re: Bug#450483: cdbs: Stop setting DEB_CONFIGURE_SCRIPT_ENV in order to enable cross-building
Date: Sat, 24 Nov 2007 11:49:29 +0000
[Message part 1 (text/plain, inline)]
Peter Eisentraut wrote:
> Sorry, the last patch couldn't have worked, because CC and CXX are never
> undefined.  Try this patch instead; the logic is the same.
> 
> Index: 1/class/autotools-vars.mk.in
> ===================================================================
> --- 1/class/autotools-vars.mk.in        (Revision 175)
> +++ 1/class/autotools-vars.mk.in        (Arbeitskopie)
> @@ -31,7 +31,13 @@
>  DEB_AC_AUX_DIR = $(DEB_SRCDIR)
> 
>  DEB_CONFIGURE_SCRIPT = $(CURDIR)/$(DEB_SRCDIR)/configure
> -DEB_CONFIGURE_SCRIPT_ENV = CC="$(CC)" CXX="$(CXX)" CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)"
> +DEB_CONFIGURE_SCRIPT_ENV = CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)"
> +ifeq "" "$(findstring $(origin CC),empty default)"
> +DEB_CONFIGURE_SCRIPT_ENV += CC="$(CC)"
> +endif
> +ifeq "" "$(findstring $(origin CXX),empty default)"
> +DEB_CONFIGURE_SCRIPT_ENV += CXX="$(CXX)"
> +endif
>  DEB_CONFIGURE_NORMAL_ARGS = --build=$(DEB_BUILD_GNU_TYPE) --prefix=$(DEB_CONFIGURE_PREFIX) --includedir=$(DEB_CONFIGURE_INCLUDEDIR) --mandir=$(DEB_CONFIGURE_MANDIR) --infodir=$(DEB_CONFIGURE_INFODIR) --sysconfdir=$(DEB_CONFIGURE_SYSCONFDIR) --localstatedir=$(DEB_CONFIGURE_LOCALSTATEDIR) --libexecdir=$(DEB_CONFIGURE_LIBEXECDIR) --disable-maintainer-mode --disable-dependency-tracking
> 
>  # Provide --host only if different from --build, as recommended in
> 

Excellent - this is fine.

Thanks for your help with this one.

Before you make an upload to fix this one though, I've come across a
different perspective on the same issue, when not using autotools, just
using the CDBS make support (/usr/share/cdbs/1/class/makefile.mk). I
need to add this rule:

ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
DEB_MAKE_ENVVARS=CC=$(DEB_HOST_GNU_TYPE)-gcc
endif

This change is needed with or without any patch to autotools-vars.mk.in
so I'm thinking of reporting a new bug and there's probably a similar
fix that can be made in makefile-vars.mk.in ?

It could be as simple as the attached patch.

What do you think - do both in the same hit or would you prefer a new
bug report and fix it separately?

With these two patches, I'm able to cross build all the CDBS packages
that I need for Emdebian.

-- 


Neil Williams
=============
http://www.data-freedom.org/
http://www.nosoftwarepatents.com/
http://www.linux.codehelp.co.uk/

[supplementary.diff (text/x-patch, inline)]
--- cdbs.old/1/class/makefile-vars.mk.in	2007-05-18 17:01:14.000000000 +0100
+++ cdbs-0.4.50/1/class/makefile-vars.mk.in	2007-11-24 11:43:20.000000000 +0000
@@ -25,7 +25,11 @@
 include $(_cdbs_class_path)/langcore.mk$(_cdbs_makefile_suffix)
 
 DEB_MAKE_MAKEFILE =
+ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
+DEB_MAKE_ENVVARS=CC=$(DEB_HOST_GNU_TYPE)-gcc
+else
 DEB_MAKE_ENVVARS = 
+endif
 DEB_MAKE_INVOKE = $(DEB_MAKE_ENVVARS) $(MAKE) $(if $(DEB_MAKE_MAKEFILE), -f $(DEB_MAKE_MAKEFILE),) -C $(DEB_BUILDDIR) CFLAGS=$(if $(CFLAGS_$(cdbs_curpkg)),"$(CFLAGS_$(cdbs_curpkg))","$(CFLAGS)") CXXFLAGS=$(if $(CXXFLAGS_$(cdbs_curpkg)),"$(CXXFLAGS_$(cdbs_curpkg))","$(CXXFLAGS)") CPPFLAGS=$(if $(CPPFLAGS_$(cdbs_curpkg)),"$(CPPFLAGS_$(cdbs_curpkg))","$(CPPFLAGS)") LDFLAGS=$(if $(LDFLAGS_$(cdbs_curpkg)),"$(LDFLAGS_$(cdbs_curpkg))","$(LDFLAGS)") 
 
 # This variable is deprecated.
[signature.asc (application/pgp-signature, attachment)]

Information forwarded to debian-bugs-dist@lists.debian.org, CDBS Hackers <build-common-hackers@lists.alioth.debian.org>:
Bug#450483; Package cdbs. Full text and rfc822 format available.

Acknowledgement sent to Loïc Minier <lool@dooz.org>:
Extra info received and forwarded to list. Copy sent to CDBS Hackers <build-common-hackers@lists.alioth.debian.org>. Full text and rfc822 format available.

Message #68 received at 450483@bugs.debian.org (full text, mbox):

From: Loïc Minier <lool@dooz.org>
To: Neil Williams <codehelp@debian.org>, 450483@bugs.debian.org
Cc: Peter Eisentraut <peter_e@gmx.net>
Subject: Re: [Build-common-hackers] Bug#450483: cdbs: Stop setting DEB_CONFIGURE_SCRIPT_ENV in order to enable cross-building
Date: Sun, 25 Nov 2007 17:11:55 +0100
On Sat, Nov 24, 2007, Neil Williams wrote:
> ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
> DEB_MAKE_ENVVARS=CC=$(DEB_HOST_GNU_TYPE)-gcc
> endif

 Why set CC in cdbs instead of setting it in the cross build env?

-- 
Loïc Minier




Information forwarded to debian-bugs-dist@lists.debian.org, CDBS Hackers <build-common-hackers@lists.alioth.debian.org>:
Bug#450483; Package cdbs. Full text and rfc822 format available.

Acknowledgement sent to Neil Williams <codehelp@debian.org>:
Extra info received and forwarded to list. Copy sent to CDBS Hackers <build-common-hackers@lists.alioth.debian.org>. Full text and rfc822 format available.

Message #73 received at 450483@bugs.debian.org (full text, mbox):

From: Neil Williams <codehelp@debian.org>
To: Loïc Minier <lool@dooz.org>
Cc: 450483@bugs.debian.org, Peter Eisentraut <peter_e@gmx.net>
Subject: Re: [Build-common-hackers] Bug#450483: cdbs: Stop setting DEB_CONFIGURE_SCRIPT_ENV in order to enable cross-building
Date: Sun, 25 Nov 2007 17:56:26 +0000
[Message part 1 (text/plain, inline)]
Loïc Minier wrote:
> On Sat, Nov 24, 2007, Neil Williams wrote:
>> ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
>> DEB_MAKE_ENVVARS=CC=$(DEB_HOST_GNU_TYPE)-gcc
>> endif
> 
>  Why set CC in cdbs instead of setting it in the cross build env?

Please read the rest of the bug report, CC was set in the cross build
environment before the cross build support was rewritten. The rewrite
was done because if CC *is* set in the environment, it prevents
CC_FOR_BUILD from operating and therefore packages that need to build
tools during the cross build fail to build - like libx11.

The rewritten cross building support now allows all packages to cross
build successfully.

This change in CDBS is because the same change is needed in *all* CDBS
packages that use a makefile without a ./configure and I would rather
fix the problem in CDBS than have to apply precisely the same patch to
each package in this situation.

Therefore, CC must NOT be set by the cross build environment because CC
will break more packages than it fixes. Those CDBS packages that use
only a Makefile without ./configure, there is no way of passing the
correct CC from the cross build environment - it needs to come from CDBS.

-- 


Neil Williams
=============
http://www.data-freedom.org/
http://www.nosoftwarepatents.com/
http://www.linux.codehelp.co.uk/


[signature.asc (application/pgp-signature, attachment)]

Tags added: confirmed Request was from Peter Eisentraut <petere@debian.org> to control@bugs.debian.org. (Tue, 27 Nov 2007 12:18:04 GMT) Full text and rfc822 format available.

Blocking bugs of 480521 added: 450483 Request was from Neil Williams <codehelp@debian.org> to control@bugs.debian.org. (Sat, 10 May 2008 15:57:03 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, CDBS Hackers <build-common-hackers@lists.alioth.debian.org>:
Bug#450483; Package cdbs. Full text and rfc822 format available.

Acknowledgement sent to Neil Williams <codehelp@debian.org>:
Extra info received and forwarded to list. Copy sent to CDBS Hackers <build-common-hackers@lists.alioth.debian.org>. Full text and rfc822 format available.

Message #82 received at 450483@bugs.debian.org (full text, mbox):

From: Neil Williams <codehelp@debian.org>
To: 450483@bugs.debian.org
Subject: ping? DEB_CONFIGURE_SCRIPT_ENV and cross-building
Date: Sat, 17 May 2008 20:54:53 +0100
[Message part 1 (text/plain, inline)]
I'm just checking on progress on this bug as it is hampering my efforts
to create a sane autobuilder for Emdebian.

If this bug could be closed, many packages in Emdebian would cross build
cleanly without patches, making it possible for Emdebian to make a root
filesystem release alongside Debian Lenny (kernels are device-specific
for many embedded situations).

I've been patching all relevant packages in Emdebian to remove all
settings in DEB_CONFIGURE_SCRIPT_ENV and even making the same setting in
the equivalent Debian packages that I maintain. I have not found any
problems with removing the entire configure script ENV for those
packages. Retaining the script ENV causes the cross-build to prepare
binaries of the wrong architecture (BUILD_ARCH not HOST_ARCH).
Considering the difficulties in debugging on an embedded device, this
can be a major problem for packages involved in the boot / X startup
process.

The relevant change for CDBS packages not using ./configure, just
$(MAKE) is also tested:

ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
DEB_MAKE_ENVVARS=CC=$(DEB_HOST_GNU_TYPE)-gcc
endif

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=450483#63

(Setting CC on a package-specific basis to allow for packages that need
internal CC_FOR_BUILD settings in the upstream package.)

I'd be grateful if this bug could be reviewed and the changes
implemented - it is important to get these changes into Lenny.

-- 


Neil Williams
=============
http://www.data-freedom.org/
http://www.nosoftwarepatents.com/
http://www.linux.codehelp.co.uk/


[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, CDBS Hackers <build-common-hackers@lists.alioth.debian.org>:
Bug#450483; Package cdbs. (Sat, 03 Apr 2010 22:57:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to 450483@bugs.debian.org:
Extra info received and forwarded to list. Copy sent to CDBS Hackers <build-common-hackers@lists.alioth.debian.org>. (Sat, 03 Apr 2010 22:57:03 GMT) Full text and rfc822 format available.

Message #87 received at 450483@bugs.debian.org (full text, mbox):

From: Jonas Smedegaard <dr@jones.dk>
To: Neil Williams <codehelp@debian.org>, 450483@bugs.debian.org
Cc: debian-embedded@lists.debian.org
Subject: Re: Bug#450483: Pending! DEB_CONFIGURE_SCRIPT_ENV and cross-building
Date: Sun, 4 Apr 2010 00:44:44 +0200
[Message part 1 (text/plain, inline)]
tags 450483 pending
thanks

On Sat, May 17, 2008 at 08:54:53PM +0100, Neil Williams wrote:
>I'm just checking on progress on this bug as it is hampering my efforts 
>to create a sane autobuilder for Emdebian.
>
>If this bug could be closed, many packages in Emdebian would cross 
>build cleanly without patches, making it possible for Emdebian to make 
>a root filesystem release alongside Debian Lenny (kernels are 
>device-specific for many embedded situations).


Apologies for the loooong wait.


I have now improved CDBS to support cross-building, based on the 
discussions in this bugreport.

CDBS now also provides a few convenience variables to ease crossbuild 
support for other classes than makefile.mk and autotools.mk.

I noticed that qmake.mk, cmake.mk and scons.mk all explicitly set CC, 
and wonder if if would make sense to do a similar hack as with the 
DEB_MAKE_ENVVARS.


Kind regards,

 - Jonas

-- 
* Jonas Smedegaard - idealist & Internet-arkitekt
* Tlf.: +45 40843136  Website: http://dr.jones.dk/

  [x] quote me freely  [ ] ask before reusing  [ ] keep private
[signature.asc (application/pgp-signature, inline)]

Added tag(s) pending. Request was from Jonas Smedegaard <dr@jones.dk> to control@bugs.debian.org. (Sat, 03 Apr 2010 22:57:06 GMT) Full text and rfc822 format available.

Reply sent to Jonas Smedegaard <dr@jones.dk>:
You have taken responsibility. (Sun, 04 Apr 2010 07:45:14 GMT) Full text and rfc822 format available.

Notification sent to Neil Williams <codehelp@debian.org>:
Bug acknowledged by developer. (Sun, 04 Apr 2010 07:45:14 GMT) Full text and rfc822 format available.

Message #94 received at 450483-close@bugs.debian.org (full text, mbox):

From: Jonas Smedegaard <dr@jones.dk>
To: 450483-close@bugs.debian.org
Subject: Bug#450483: fixed in cdbs 0.4.77
Date: Sun, 04 Apr 2010 07:43:53 +0000
Source: cdbs
Source-Version: 0.4.77

We believe that the bug you reported is fixed in the latest version of
cdbs, which is due to be installed in the Debian FTP archive:

cdbs_0.4.77.dsc
  to main/c/cdbs/cdbs_0.4.77.dsc
cdbs_0.4.77.tar.gz
  to main/c/cdbs/cdbs_0.4.77.tar.gz
cdbs_0.4.77_all.deb
  to main/c/cdbs/cdbs_0.4.77_all.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 450483@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Jonas Smedegaard <dr@jones.dk> (supplier of updated cdbs package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160

Format: 1.8
Date: Sun, 04 Apr 2010 00:26:12 +0200
Source: cdbs
Binary: cdbs
Architecture: source all
Version: 0.4.77
Distribution: unstable
Urgency: low
Maintainer: CDBS Hackers <build-common-hackers@lists.alioth.debian.org>
Changed-By: Jonas Smedegaard <dr@jones.dk>
Description: 
 cdbs       - common build system for Debian packages
Closes: 450483
Changes: 
 cdbs (0.4.77) unstable; urgency=low
 .
   * Fail the fail-source-not-repackaged rule (in addition to get-orig-
     source) if old DEB_UPSTREAM_REPACKAGE_EXCLUDE is declared, in
     upstream-tarball.mk.
   * Fix check excluded directories (not files twice) in the fail-source-
     not-repackaged rule, in upstream-tarball.mk.
   * Support cross-building: Avoid setting CC or CXX in autotools.mk
     except if explicitly declared, and set CC="-gcc" in makefile.mk when
     cross-building. Closes: bug#450483, thanks to Neil Williams
Checksums-Sha1: 
 d580d5087ffa772b19db94f19f6f8195ce74ce2f 1285 cdbs_0.4.77.dsc
 6053f44337d592c865c05d5c53a55eeb4b1131fe 250847 cdbs_0.4.77.tar.gz
 9ccf4c6b7f1113aa3258f1ef639af09303791fe5 1240506 cdbs_0.4.77_all.deb
Checksums-Sha256: 
 1647dffcd0560d69efc27809526b3b8d7b1654bcb4e99904949d10bf11199470 1285 cdbs_0.4.77.dsc
 5136de50c2213ddebacfcbc80db2e017a5c642ab3039515591d694a1829e68e0 250847 cdbs_0.4.77.tar.gz
 af54a38242a29f9ac0264371c43954863d89b93d29ac723180e6adcef5ff9c57 1240506 cdbs_0.4.77_all.deb
Files: 
 94d8da8d37d02f8d235dbda6348c49ee 1285 devel optional cdbs_0.4.77.dsc
 a0388e8d8be6e7c40020fe24eabb6019 250847 devel optional cdbs_0.4.77.tar.gz
 1ba7e4d03da04e02f57405530b91aa94 1240506 devel optional cdbs_0.4.77_all.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEAREDAAYFAku3yAcACgkQn7DbMsAkQLjpJACeK5DohWN2vhAZEnXRmoPOt5kP
2gIAn14g7PcoaAHqYVfXg65BIC647XhD
=c/nB
-----END PGP SIGNATURE-----





Information forwarded to debian-bugs-dist@lists.debian.org, CDBS Hackers <build-common-hackers@lists.alioth.debian.org>:
Bug#450483; Package cdbs. (Sun, 04 Apr 2010 08:27:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Neil Williams <codehelp@debian.org>:
Extra info received and forwarded to list. Copy sent to CDBS Hackers <build-common-hackers@lists.alioth.debian.org>. (Sun, 04 Apr 2010 08:27:03 GMT) Full text and rfc822 format available.

Message #99 received at 450483@bugs.debian.org (full text, mbox):

From: Neil Williams <codehelp@debian.org>
To: 450483@bugs.debian.org
Cc: Jonas Smedegaard <dr@jones.dk>, debian-embedded@lists.debian.org
Subject: Re: Bug#450483: Pending! DEB_CONFIGURE_SCRIPT_ENV and cross-building
Date: Sun, 4 Apr 2010 09:15:22 +0100
[Message part 1 (text/plain, inline)]
On Sun, 4 Apr 2010 00:44:44 +0200
Jonas Smedegaard <dr@jones.dk> wrote:

> tags 450483 pending
> thanks

:-)
 
> Apologies for the loooong wait.
> 
> 
> I have now improved CDBS to support cross-building, based on the 
> discussions in this bugreport.
> 
> CDBS now also provides a few convenience variables to ease crossbuild 
> support for other classes than makefile.mk and autotools.mk.
> 
> I noticed that qmake.mk, cmake.mk and scons.mk all explicitly set CC, 
> and wonder if if would make sense to do a similar hack as with the 
> DEB_MAKE_ENVVARS.

I've only got experience of CMake out of that list and it tends to need
more than just DEB_MAKE_ENVVARS to cross-build properly. It can work
but we need to use a CMakeListsCross.txt file to get CMake to
understand how to find the cross libraries etc. 

There's some discussion about this upstream with CMake:

http://www.cmake.org/pipermail/cmake/2008-July/022581.html

Wookey?

-- 


Neil Williams
=============
http://www.data-freedom.org/
http://www.nosoftwarepatents.com/
http://www.linux.codehelp.co.uk/

[Message part 2 (application/pgp-signature, inline)]

Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Fri, 07 May 2010 07:38:49 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Sun Apr 20 23:54:00 2014; Machine Name: beach.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.