Hi all,

With Mandrake-8.0 I see a very strange bug with gcc. I tried both the
standard gcc-2.96 which comes with
Mandrake and the latest gcc-3.0 snapshot, and things don't change.

I report this bug here because 1) it seems strange to me that such a bug
hasn't been detected in one year of
gcc development and 2) I don't remember having seen this bug in previous
installation of gcc-2.97 snapshots
under Mandrake 7.2.

The bug is related to the -MD option, which normally produces a file with
extension .d holding
the dependencies for the compiled file. This option, as stated in the gcc
sources, is deprecated and
will be removed at a later time; however, there's always some software that
depends on it :-(

When you specify -MD compiling, say, filename.c into filename, /usr/bin/gcc
should translate -MD (by
means of the specs file) to
        -M -MF filename.d -MQ filename
and pass these three options to cc1. What happens instead is that gcc emits
        -M -MF filename.d -MQ .filename filename
and cc1 gets confused.

Just try writing some do-nothing hello.c, type
        gcc -O2 -v -MD hello.c -o hello
and look at what is passed to cc1 (and ld too).
If you use an absolute path, e.g.
        gcc -O2 -v -MD ./hello.c -o ./hello
the bug disappears. The same if you just compile with -c.
The bug should be in gcc.c, maybe when parsing the "%o*" string from specs.
I found no workaround
until now.

Alberto


Reply via email to