This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug driver/12448] -MT / -MQ don't behave as documented.
- From: "taylor at candd dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 3 Oct 2003 14:34:50 -0000
- Subject: [Bug driver/12448] -MT / -MQ don't behave as documented.
- References: <20030929205632.12448.taylor@candd.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12448
------- Additional Comments From taylor at candd dot org 2003-10-03 14:34 -------
To reproduce the problem, consider the following Makefile:
CC = gcc
CFLAGS = -MD -MT foo.o -MF foo.d
MV = mv
foo.o: bar.c
${CC} bar.c -o - > xfoo.o
${MV} xfoo.o foo.o
Suppose bar.c includes no files, then the resulting foo.d
file will contain:
foo.o -: bar.c
But, it should contain:
foo.o: bar.c
The - should NOT be present. You could argue about whether - should ever
be a target within the .d file, but regardless -- if the user specified one
or more targets with -MT / -MQ, then the *DEFAULT* target should *NOT* be used.
Eliminating or editing the cpp_unique_options line, as mentioned, fixes
the problem.
Deleting the line (my preferred fix) bootstraps just fine. There do not
appear to be any tests within the testsuite that test the -MT / -MQ / -MD /
-MMD / -MF / -M<whatever> options. If someone will give me a pointer on
how to have the testsuite compare two files -- the generated .d file against
the correct .d file, I will gladly write a test case for this bug.