This is the mail archive of the
mailing list for the GCC project.
Re: [CPP patch]: -M default name
On Thu, Feb 08, 2001 at 09:28:35PM +0000, Neil Booth wrote:
> bash-2.04$ cpp -M test.c -o test.o -v
> Reading specs from /usr/local/lib/gcc-lib/i586-pc-linux-gnu/2.97/specs
> Configured with: ../configure --enable-shared --disable-checking
> --enable-threads=posix : (reconfigured)
> gcc version 2.97 20010205 (experimental)
> /usr/local/lib/gcc-lib/i586-pc-linux-gnu/2.97/cpp0 -lang-c -v -M -MQ
> test.o -D__ELF__ -Dunix -Dlinux -D__ELF__ -D__unix__ -D__linux__
> -D__unix -D__linux -Asystem=posix -D__STDC_HOSTED__=1 -Acpu=i386
> -Amachine=i386 -Di386 -D__i386 -D__i386__ -D__tune_i586__
> -D__tune_pentium__ test.c -o test.o -o test.o
> This is all caused by the spec in gcc.c that reads
> This spec is completely wrong, if I understand what's going on at all.
> My original understanding was that the %W merely indicates to the
> driver to delete the final -o option. In fact, it also supplies the
> -o options. Therefore, the above line was causing the -o option to be
> output twice - once for the "-E" and once for the "-M".
> As I said in the previous mail, the %W is not wanted at all for the
> -M/-MM/-MD/-MMD options, since it's not the ".o" file that is our
> output; ".d" is. Instead I think what we need is the patch below.
This sounds plausible enough, although rather horrifying. But we knew
the specs were horrifying.
Do you think you can come up with a way to test this stuff?