Bug#712000: marked as done (dpkg-architecture: Compares the wrong architectures when using 'gcc -m32')

"Debian Bug Tracking System" <[email protected]> Sun, 07 Jun 2026 00:59:01 +0000
Newsgroups gmane.linux.debian.devel.dpkg.bugs
Message-ID <[email protected]>
This is a multi-part message in MIME format...

------------=_1780793941-1187742-0
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="utf-8"

Your message dated Sun, 7 Jun 2026 02:57:20 +0200
with message-id <[email protected]>
and subject line Re: Bug#712000: dpkg-dev: dpkg-architecture compares the w=
rong architectures when using 'gcc -m32'
has caused the Debian Bug report #712000,
regarding dpkg-architecture: Compares the wrong architectures when using 'g=
cc -m32'
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


--=20
712000: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=3D712000
Debian Bug Tracking System
Contact [email protected] with problems

------------=_1780793941-1187742-0
Content-Type: message/rfc822
Content-Disposition: inline
Content-Transfer-Encoding: 7bit

Received: (at submit) by bugs.debian.org; 11 Jun 2013 22:19:26 +0000
X-Spam-Checker-Version: SpamAssassin 3.3.2-bugs.debian.org_2005_01_02
	(2011-06-06) on buxtehude.debian.org
X-Spam-Level: 
X-Spam-Status: No, score=-11.9 required=4.0 tests=BAYES_00,FOURLA,
	FREEMAIL_FROM,FVGT_m_MULTI_ODD,HAS_PACKAGE,MURPHY_DRUGS_REL8,
	RCVD_IN_DNSWL_NONE,XMAILER_REPORTBUG autolearn=ham
	version=3.3.2-bugs.debian.org_2005_01_02
X-Spam-Bayes: score:0.0000 Tokens: new, 14; hammy, 151; neutral, 191; spammy,
	0. spammytokens: hammytokens:0.000-+--H*r:2a01, 0.000-+--H*M:reportbug,
	0.000-+--H*MI:reportbug, 0.000-+--H*RU:2a01, 0.000-+--H*x:reportbug
Return-path: <[email protected]>
Received: from smtp1-g21.free.fr ([212.27.42.1])
	by buxtehude.debian.org with esmtp (Exim 4.80)
	(envelope-from <[email protected]>)
	id 1UmWuT-0001os-LZ
	for [email protected]; Tue, 11 Jun 2013 22:19:26 +0000
Received: from amboise.dolphin (unknown [IPv6:2a01:e35:2f31:ab50:21d:7dff:fe02:e9e2])
	by smtp1-g21.free.fr (Postfix) with ESMTP id 58683940155
	for <[email protected]>; Wed, 12 Jun 2013 00:19:17 +0200 (CEST)
Received: from fgouget by amboise.dolphin with local (Exim 4.80)
	(envelope-from <[email protected]>)
	id 1UmWuK-00083w-0I; Wed, 12 Jun 2013 00:19:16 +0200
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
From: Francois Gouget <[email protected]>
To: Debian Bug Tracking System <[email protected]>
Subject: dpkg-dev: dpkg-architecture compares the wrong architectures when using 'gcc
 -m32'
Message-ID: <[email protected]>
X-Mailer: reportbug 6.4.4
Date: Wed, 12 Jun 2013 00:19:15 +0200
Delivered-To: [email protected]

Package: dpkg-dev
Version: 1.16.10
Severity: normal

Dear Maintainer,

I work on an i386 package which I build on an amd64 host. To do so I use CC='gcc -m32' which produces binaries of the right type. Yet dpkg-architecture gives me the following warning:

dpkg-architecture: warning: specified GNU system type i486-linux-gnu does not match gcc system type x86_64-linux-gnu, try setting a correct CC environment variable

As far as I can tell this comes from the following line in get_gcc_host_gnu_type() of /usr/share/perl5/Dpkg/Arch.pm:

   my $gcc_host_gnu_type = `\${CC:-gcc} -dumpmachine`;

My understanding is that '-dumpmachine' always prints the compiler's default target machine. Indeed:

   $ gcc -dumpmachine
   x86_64-linux-gnu
   $ gcc -m32 -dumpmachine
   x86_64-linux-gnu

That's even probably the appropriate result for get_gcc_host_gnu_type(). However I don't think that's what dpkg-architecture should be comparing to the package's target architecture, particularly not when suggesting to fix $CC.

I think checking the value of '$CC -print-multiarch' would be more appropriate:

   $ gcc -print-multiarch
   x86_64-linux-gnu
   $ gcc -m32 -print-multiarch
   i386-linux-gnu

That will  leave the issue of i386 vs. i486 which should not cause a warning if I read bug #302033 correctly.

#302033 dpkg-architecture: Specified GNU system type i386-linux does not match gcc system type i486-linux-gnu
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=302033


I have uploaded a test package there:
http://fgouget.free.fr/bugs/testarch_1.0-1.tar.gz


-- System Information:
Debian Release: jessie/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.2.0-4-amd64 (SMP w/4 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages dpkg-dev depends on:
ii  base-files    7.2
ii  binutils      2.22-8
ii  bzip2         1.0.6-4
ii  libdpkg-perl  1.16.10
ii  make          3.81-8.2
ii  patch         2.6.1-3
ii  xz-utils      5.1.1alpha+20120614-2

Versions of packages dpkg-dev recommends:
ii  build-essential          11.6
ii  fakeroot                 1.18.4-2
ii  gcc [c-compiler]         4:4.7.2-1
ii  gcc-4.6 [c-compiler]     4.6.4-2
ii  gcc-4.7 [c-compiler]     4.7.3-4
ii  gnupg                    1.4.12-7
ii  gpgv                     1.4.12-7
ii  libalgorithm-merge-perl  0.08-2

Versions of packages dpkg-dev suggests:
ii  debian-keyring  2013.04.21

-- no debconf information

------------=_1780793941-1187742-0
Content-Type: message/rfc822
Content-Disposition: inline
Content-Transfer-Encoding: 7bit

Received: (at 712000-done) by bugs.debian.org; 7 Jun 2026 00:57:29 +0000
X-Spam-Checker-Version: SpamAssassin 4.0.1-bugs.debian.org_2005_01_02
	(2024-03-25) on buxtehude.debian.org
X-Spam-Level: 
X-Spam-Status: No, score=-110.5 required=4.0 tests=ALL_TRUSTED,BAYES_00,
	DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FROMDEVELOPER,
	HAS_BUG_NUMBER,SPF_HELO_NONE,SPF_NONE,USER_IN_DKIM_WELCOMELIST
	autolearn=ham autolearn_force=no
	version=4.0.1-bugs.debian.org_2005_01_02
X-Spam-Bayes: score:0.0000 Tokens: new, 47; hammy, 150; neutral, 171; spammy,
	0. spammytokens: hammytokens:0.000-+--UD:tar.xz,
	0.000-+--Hx-spam-relays-external:36ff, 0.000-+--H*r:36ff,
	0.000-+--H*RT:sk:master., 0.000-+--H*RT:fe40
Return-path: <[email protected]>
Received: from master.debian.org ([2001:41b8:202:deb:216:36ff:fe40:4001]:60852)
	by buxtehude.debian.org with esmtps (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256)
	(Exim 4.96)
	(envelope-from <[email protected]>)
	id 1wW1pQ-004ye3-3C
	for [email protected];
	Sun, 07 Jun 2026 00:57:29 +0000
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debian.org;
	s=smtpauto.master; h=In-Reply-To:Content-Type:MIME-Version:References:
	Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-Transfer-Encoding:
	Content-ID:Content-Description;
	bh=JjwXfZd93/bE/19wICnLKmgcU1cUcLYw7/OMlZxkzfM=; b=glMeTAwyrB+8Gs0UOqmRdwWEfP
	lncH2EXABhsu9lEjbOwboOC3h31OY1jUjYOB8+tJQONus7lSLPp9rhWU3zYWSchb9kpObIaxEcbvR
	7v0DtF9A5BCqg2M5LIzfLlvd9b/BNY5Fo0a5p6DtzCgPPNA+AIbasWwf52KIfx0FaYCRbQ9ELh9YF
	8vJc+/E+Icbp+ywOO7+rCeUL5acqVYMHS51Q+/JXfvHqbsLkHwtczs16edaXoMEBvfp01z6aaJFXo
	Vj5spz//fOAccgy2mBCOBzHPcdjpwf/kkmv+jI1KPNxunPmns0fVo+UY4UV+zfqLm2ODK810JddZ6
	7hvSsAaA==;
Received: from guillem by master.debian.org with local (Exim 4.96)
	(envelope-from <[email protected]>)
	id 1wW1pJ-00CQ4S-2y;
	Sun, 07 Jun 2026 00:57:21 +0000
Date: Sun, 7 Jun 2026 02:57:20 +0200
From: Guillem Jover <[email protected]>
To: [email protected]
Cc: Francois Gouget <[email protected]>
Subject: Re: Bug#712000: dpkg-dev: dpkg-architecture compares the wrong
 architectures when using 'gcc -m32'
Message-ID: <[email protected]>
References: <[email protected]>
 <[email protected]>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <[email protected]>

Hi!

On Wed, 2013-06-12 at 06:48:38 +0200, Guillem Jover wrote:
> On Wed, 2013-06-12 at 00:19:15 +0200, Francois Gouget wrote:
> > Package: dpkg-dev
> > Version: 1.16.10
> > Severity: normal
> 
> > I work on an i386 package which I build on an amd64 host. To do so I
> > use CC='gcc -m32' which produces binaries of the right type. Yet
> > dpkg-architecture gives me the following warning:
> > 
> > dpkg-architecture: warning: specified GNU system type i486-linux-gnu does not match gcc system type x86_64-linux-gnu, try setting a correct CC environment variable
> > 
> > As far as I can tell this comes from the following line in
> > get_gcc_host_gnu_type() of /usr/share/perl5/Dpkg/Arch.pm:
> > 
> >    my $gcc_host_gnu_type = `\${CC:-gcc} -dumpmachine`;
> > 
> > My understanding is that '-dumpmachine' always prints the compiler's
> > default target machine. Indeed:
> > 
> >    $ gcc -dumpmachine
> >    x86_64-linux-gnu
> >    $ gcc -m32 -dumpmachine
> >    x86_64-linux-gnu
> > 
> > That's even probably the appropriate result for get_gcc_host_gnu_type().
> > However I don't think that's what dpkg-architecture should be comparing
> > to the package's target architecture, particularly not when suggesting
> > to fix $CC.
> > 
> > I think checking the value of '$CC -print-multiarch' would be more
> > appropriate:
> > 
> >    $ gcc -print-multiarch
> >    x86_64-linux-gnu
> >    $ gcc -m32 -print-multiarch
> >    i386-linux-gnu
> 
> There's several problems with that. First -print-multiarch is pretty
> recent, even if it has been backported way back to gcc 4.6, but before
> that it's not supported. The result from -print-multiarch is not the
> host triplet, so it cannot be used on the configure command line for
> the --host option, because autotools will prefix that to the build
> tools when it detects it's in cross-compilation mode, and those
> cross-tools will not be found. You might need to override other
> variables so that everything gets built for the host (and not build)
> triplet, but that should be handled by the packaging, not the builder.
> 
> In any case I think the multilib approach is bogus, and its support
> should just end. A better solution, is to use an actual cross-toolchain,
> or something I was planning on posting to debian-devel is to use some
> kind of fake cross toolchain in the interim, internally using the
> multilib support, and later on they could be switched to use the main
> compiler with a different spec file, or simply replaced with an actual
> proper cross-compiler.
> 
> Take a look at:
> 
>   <http://www.hadrons.org/~guillem/debian/ports/fakecross-i486-0.0.tar.xz>
> 
> You'll also need to install at least:
> 
>   binutils-multiarch
>   libgcc-4.8-dev:i386
>   libc6-dev:i386
> 
> Move away the bogus instances of some multilib files from native
> packages (I've to file a bug about this):
> 
>   $ cd /usr/lib/gcc/x86_64-linux-gnu/4.8/
>   $ mv 32 32-old
> 
> And symlink it to the proper directory:
> 
>   $ ln -s ../../i486-linux-gnu/4.8 32
> 
> At least that was enough last time I used this. Then you should be
> able to simply do:
> 
>   $ dpkg-buildpackage -ai386
> 
> So given the above, I think I'll be closing this bug report, please
> let me know if that solves your issue.

Closing it now.

Thanks,
Guillem
------------=_1780793941-1187742-0--