This is the mail archive of the
mailing list for the GCC project.
Re: gcc -m32 -dumpmachine
- From: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- To: "Warlich, Christof" <christof dot warlich at siemens dot com>
- Cc: "gcc-help (gcc-help at gcc dot gnu dot org)" <gcc-help at gcc dot gnu dot org>
- Date: Wed, 9 May 2018 10:10:33 +0100
- Subject: Re: gcc -m32 -dumpmachine
- References: <6D83E89737156549AEA25EF9ED712C5D2E5615@DEFTHW99EK1MSX.ww902.siemens.net> <CAH6eHdQ92pYgr0w+d3beWrbpbUuZZs0dOPjtfYicoAMxroBg=Q@mail.gmail.com>
On 9 May 2018 at 10:08, Jonathan Wakely wrote:
> On 9 May 2018 at 10:01, Warlich, Christof wrote:
>> I'm surprised: On an x86_64 machine, "gcc -dumpmachine" prints "x86_64-linux-gnu" as expected. But "gcc -m32 -dumpmachine" prints the same, whereas I'd expected it to print something like "i686-linux-gnu" instead, as indicated by gcc's usage:
>> $ gcc -help
>> -dumpmachine Display the compiler's target processor
>> After all, I've explicitly told it to build for 32-bit targets.
And for this part: I assume the reason is that -dumpmachine doesn't
actually build anything. Adding -m32 doesn't tell the compiler to
build for 32-bit targets, since it's not building, it's just dumping
part of its configuration settings.
>> But anyhow, is there any other way to obtain the target triplet (or at least the target processor that gcc would actually build for, depending on the switches being passed?
> gcc -m32 -Q --help=target | fgrep -- -march