This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: 'gcc -V' no longer works properly between 2.95 and older versions
- To: Michael Deutschmann <michael at talamasca dot wkpowerlink dot com>
- Subject: Re: 'gcc -V' no longer works properly between 2.95 and older versions
- From: Zack Weinberg <zack at bitmover dot com>
- Date: Thu, 12 Aug 1999 23:41:02 -0700
- cc: gcc-bugs at gcc dot gnu dot org
Michael Deutschmann wrote:
> I've recently installed gcc-2.95. I've discovered that 'gcc -V 2.8.1' or
> `gcc -V 2.7.2.3' does not work, although I do have those compilers
> properly installed. A `script' dump of my attempt follows.
>
>
> My guess (considering the warning) is that you've gone and changed the
> specs format in a backwardly-incompatible way. This is a no-no, as it
> makes the manual lie:
No - the warning is complaining about something that has nothing to do
with the way the assembler gets invoked.
[...]
> bash-2.03$ gcc -v -V 2.7.2.3 null.c -c -onull.o
> Reading specs from /usr/lib/gcc-lib/i386-pc-linux-gnu/2.7.2.3/specs
> gcc driver version 2.95 19990728 (release) executing gcc version 2.7.2.3
[...]
> as -V 2.7.2.3 -Qy -onull.o /tmp/cc6HZSIH.s
^^^^^^^^^^
This is your problem. The -V option plus its argument is being
handed to the assembler, and the assembler is misinterpreting it as a
-V and an input file.
Why's it doing that? Apparently because you put a space between the
-V and its argument. Watch:
$ gcc -V 2.7.2.3 -v -c null.s
Reading specs from /usr/lib/gcc-lib/i386-linux/2.7.2.3/specs
gcc driver version 2.95 19990728 (release) executing gcc version 2.7.2.3
as -V 2.7.2.3 -Qy -o null.o null.s
GNU assembler version 2.9.1 (i486-linux), using BFD version 2.9.1.0.25
Assembler messages:
Error: Can't open 2.7.2.3 for reading.
2.7.2.3: No such file or directory
$
$ gcc -V2.7.2.3 -v -c null.s
Reading specs from /usr/lib/gcc-lib/i386-linux/2.7.2.3/specs
gcc driver version 2.95 19990728 (release) executing gcc version 2.7.2.3
as -V -Qy -o null.o null.s
$
This is indeed a bug, but it's of the same order as having to put a
trailing slash on the argument to -B: annoying but not really that
serious. Just don't put a space there ;)
Furthermore, the bug itself is not something we can fix anymore, since
it's in the installed specs file for 2.7.2.3. This:
*asm:
%{V} %{v:%{!V:-V}} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*}
which should read
*asm:
%{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*}
as it does in 2.95. You can change
/usr/lib/gcc-lib/whatever/2.7.2.3/specs if you want. (While you're at
it, delete %[cpp_cpu] from the '*cpp:' spec - it's the cause of that
warning you were concerned about, and is doing absolutely nothing
useful on your platform.)
zw