Igor Marnat wrote:
Thank you for the prompting about specs file, I managed to investigate the problem a bit further. Hope it will help to find out the actual reason of the problem.
First I rebuilt and reinstalled gcc 4.0.3 and gpc 20060325 from downloaded sources to be sure there are no local changes of mine. Then I tried to find the -quiet option in 'specs' file of gcc but found that there is no 'specs' file in the place where it used to be. Having investigated gcc mailing lists I found that in GCC 4 they do not install specs file at all any longer but use built-in specs instead.
Then I found 'specs' file in gcc 4.0.3 build directory and copied it into its proper place manually. After that all works fine (gpc began to add -quiet option when call cc1).
To find out what exactly is going wrong, I removed specs file once again and saved the output of commands gcc -dumpsspecs and gpc -dumpspecs. Then I returned specs file to its place, regenerated the output of -dumpspecs and compared it with the output I got before (without 'specs' file). The output of gpc and gcc that uses build-in specs and the output of gcc and gpc with specs from file are the same.
Then I tried to run the following command with no file 'specs':
[igor@marnat2 4.0.3]$ /usr/bin/gpc -v -E -H /home/igor/tmp/test/test.c Using built-in specs.
<snipped> /usr/libexec/gcc/i686-pc-linux-gnu/4.0.3/cc1 -E -v -H /home/igor/tmp/test/test.c -mtune=pentiumpro <snipped> Execution times (seconds) TOTAL : 0.00 0.00 0.01
and with file specs in place:
[igor@marnat2 test]$ /usr/bin/gpc -v -E -H /home/igor/tmp/test/test.c Reading specs from /usr/lib/gcc/i686-pc-linux-gnu/4.0.3/specs
<snipped> /usr/libexec/gcc/i686-pc-linux-gnu/4.0.3/cc1 -E -quiet -v -H /home/igor/tmp/test/test.c -mtune=pentiumpro ignoring nonexistent directory "/usr/lib/gcc/i686-pc-linux-gnu/4.0.3/../../../../i686-pc-linux-gnu/include" <snipped>
As you can see the only difference is that in the second case cc1 is called with -quiet option and therefore it doesn't produce statistics output.
I have also installed in my system gpc of 20050217 version, based on gcc-3.4.3. When I removed its 'specs' file, it also began to omit '-quiet' option in an example shown above and refused to compile c files.
So the questions are
- Since the built-in specs and specs from 'specs'
file are the same (as one can imagine comparing -dumpspecs output), why does gpc omit '-quiet' flag when it calls cc1?
The specs built into gpc did not match with the specs build into gcc. The differences normally should not matter... With older gcc we used dumped specs produced by gcc, which avoided any problems.
The following should fix problem with '-quiet' option (I still have to investigate other options):
--- gpc.c.bb 2006-09-26 20:09:43.684244432 +0200 +++ gpc.c 2006-09-26 20:21:27.444256648 +0200 @@ -1043,8 +1043,11 @@ therefore no dependency entry, confuses make into thinking a .o file that happens to exist is up-to-date. */ static const char *cpp_unique_options = -"%{C|CC:%{!E:%eGCC does not support -C or -CC without -E}}\ - %{nostdinc*} %{C} %{CC} %{v} %{I*} %{P} %I\ +"%{C|CC:%{!E:%eGCC does not support -C or -CC without -E}}" +#ifdef GCC_3_3 +" %{!Q:-quiet}" +#endif +" %{nostdinc*} %{C} %{CC} %{v} %{I*} %{P} %I\ %{MD:-MD %{!o:%b.d}%{o*:%.d%*}}\ %{MMD:-MMD %{!o:%b.d}%{o*:%.d%*}}\ %{M} %{MM} %{MF*} %{MG} %{MP} %{MQ*} %{MT*}\