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 wrong
architectures when using 'gcc -m32'
has caused the Debian Bug report #712000,
regarding dpkg-architecture: Compares the wrong architectures when using 'gcc
-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.)
--
712000: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=712000
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
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
--- End Message ---
--- Begin Message ---
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
--- End Message ---