On Sun, 18 Nov 2007 00:23:59 +0000
Colin Watson <[EMAIL PROTECTED]> wrote:

> On Sat, Nov 17, 2007 at 09:29:35PM +0000, Neil Williams wrote:
> > Despite any changes made in 3.5.14, passing --build and --host does not
> > cause base-passwd to set $(CC) correctly, instead it insists on using cc
> > which is a symlink to gcc. The build log ends with:
> 
> So, I don't have a cross-compiler installed here, but as a test I ran:
> 
>   $ sudo ln -s gcc /usr/bin/x86_64-linux-gnu-gcc
>   $ ./configure --build i486-linux-gnu --host x86_64-linux-gnu
>   checking for x86_64-linux-gnu-gcc... x86_64-linux-gnu-gcc
>   checking for C compiler default output file name... a.out
>   checking whether the C compiler works... yes
>   checking whether we are cross compiling... yes

In 3.5.14, the error was just before this point but 3.5.15 removed the
$(CC) setting and left it all to ./configure which is the best
solution overall.

>   $ grep CC Makefile
>   CC              = x86_64-linux-gnu-gcc
>           $(CC) $(LDFLAGS) -o $@ $^
> 
> This looks just fine. What am I missing?

dpkg-source: building base-passwd in base-passwd_3.5.14em1.dsc
 debian/rules build
CC=cc CFLAGS="-g -O2 -Wall" ./configure --build x86_64-linux-gnu --host
arm-linux-gnu
configure: loading site script /etc/dpkg-cross/cross-config.arm
checking for arm-linux-gnu-gcc... cc

3.5.15 changed that to:

CFLAGS="-g -O2 -Wall" ./configure --build x86_64-linux-gnu --host
arm-linux-gnu

Hence, the autotools-dev snippet worked fine. What I didn't realise
initially was that you were going to change the CC=cc bit on the same
line as the CFLAGS ... ./configure ... I thought you were just changing
the ifeq () check lines.

It wasn't until I saw the 3.5.15 code that I realised - hence the
confusion.

> > Then base-passwd has upstream bugs because it does not work.
> 
> When there is no "-" in the version number, that is known as a native
> package, which means that the Debian maintainer to whom you are talking
> *is* the upstream.

Mea culpa. I should have noticed that - I'm very sorry.
 
> > dpkg-source: warning: source directory './base-passwd-3.5.14' is not
> > <sourcepackage>-<upstreamversion> 'base-passwd-3.5.14em1'
> > dpkg-source: building base-passwd in base-passwd_3.5.14em1.tar.gz
> > dpkg-source: building base-passwd in base-passwd_3.5.14em1.dsc
> >  debian/rules build
> > CC=cc CFLAGS="-g -O2 -Wall" ./configure --build x86_64-linux-gnu --host
> > arm-linux-gnu

CC=cc was the error that necessitated setting CC elsewhere, removed in
3.5.15.

> > You can see here that CC is being set BEFORE configure is run, therefore
> > the effect of --build and --host is limited only to values interpreted
> > by ./configure and stored in config.h.
> 
> Your source package might do this, but my source package does not set CC
> to anything before configure is run.

3.5.14 did, 3.5.15 does not. I'm happy with 3.5.15.
 
> > If base-passwd is going to continue setting $(CC) in advance of running
> > ./configure,
> 
> base-passwd does no such thing, unless your changes in 3.5.14em1 do it.

I did test carefully with 3.5.14 - the process involves a progression
of changes in the cross build tree in trunk/ to get a usable package for
Emdebian, then create a debian build tree in ../branches/ and port
specific changes into a patch that is tested with the Debian build.

I chose not to remove CC=cc in the rule that also set CFLAGS in order
to not disrupt any intentional effects of setting CC like that for the
Debian build - I didn't know that this was not necessary. Instead, I put
in the override only when cross building in order to preserve the
existing config - much like an NMU. By removing it, you solved the same
problem in a better way - it wasn't clear to me that this was how you
proposed to implement the autotools recommendation until I tested the
3.5.15 upload from incoming.d.o

> > If base-passwd just ran:
> > ./configure ($CROSS)
> > (as the autools docs recommend),
> 
> Which is what it does do! It overrides CFLAGS, not CC. The only version
> of base-passwd that sets CC before running configure is the one in
> Emdebian itself.

3.5.14 (until the mirrors update and I upload 3.5.15)
 
> I believe I am also reasonably familiar with the autotools
> (notwithstanding that base-passwd used a very old version until
> recently; I simply hadn't got around to upgrading it), and I believe
> that it is generally incorrect to set CC in debian/rules since configure
> is perfectly capable of doing so itself.

I agree.

> I won't apply the original patch, but am entirely happy to look into
> fixing base-passwd's use of the autotools if you can point out further
> problems.

3.5.15 is fine. Any remaining issues will only arise when there is a
method for removing man pages for Emdebian but that's not an autotools
or cross-build issue, it's a debhelper / dpkg issue that needs to be
solved for all packages in one go.

> Please take native packages into account when giving recommendations in
> future; it feels terribly patronising to be told that it's an upstream
> bug when I *am* upstream and am trying to extract the necessary
> information I need to fix it.

I do apologise - that was not my intention.

-- 

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

Attachment: pgpT4gZfqF2Bj.pgp
Description: PGP signature

Reply via email to