Hello List!
I've built two toolchains (native for i386-linux and cross for ppc-linux target) based on gpc 20060325 and gcc 4.0.3.
I have the units that use {$L file.c} directive. Native compiler build them just fine but cross compiler of the same version gives an error
"new style GCC `-H' output detected" and stops build.
I couldn't find any information in Google and GPC mailing lists. Please, any ideas?
Native compiler version: [igor@marnat2 main_program]$ gpc -v Using built-in specs. Configured with: ../gcc-4.0.3/configure --enable-languages=c,pascal --enable-threads=posix --prefix=/home/igor/src-big/tools Thread model: posix gpc version 20060325, based on gcc-4.0.3
Cross compiler version: [igor@marnat2 main_program]$ ppc-linux-gpc -v Using built-in specs. Configured with: ../configure --prefix=/home/igor/src-big/ELDK4.0/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --disable-libgcj --target=ppc-linux --with-newlib --enable-languages=c,pascal --enable-multilib=no --disable-multilib Thread model: posix gpc version 20060325, based on gcc-4.0.3 (DENX ELDK custom version 4.0.3-1)
Best regards, Igor Marnat mailto:marny@rambler.ru
Igor Marnat wote:
I've built two toolchains (native for i386-linux and cross for ppc-linux target) based on gpc 20060325 and gcc 4.0.3.
I have the units that use {$L file.c} directive. Native compiler build them just fine but cross compiler of the same version gives an error
"new style GCC `-H' output detected" and stops build.
AFAICS the message is produced by the `gp' utility (does not come from the compiler). I can not help with `gp', but the first step to resolve the problem would be to give `-v' option to `gp' to collect more data.
Waldek Hebisch wrote:
Igor Marnat wote:
I've built two toolchains (native for i386-linux and cross for ppc-linux target) based on gpc 20060325 and gcc 4.0.3.
I have the units that use {$L file.c} directive. Native compiler build them just fine but cross compiler of the same version gives an error
"new style GCC `-H' output detected" and stops build.
AFAICS the message is produced by the `gp' utility (does not come from the compiler).
Yes. It's not an error, just an informative message in a high verbosity level only (-v4 or higher). (There are different forms of GCC output that GP has to read, and it should adjust automatically to the form it finds.) By itself, it's no reason to worry.
Can you (Igor) please provide more information? What exactly did do you (full command-line invocation and gp version), and what is the full output (with -v as Waldek said, but you probably used this already, otherwise you wouldn't have seen this message)? If no other message appeared after the above, it may even be that everything was compiled successfully. Did you check that it wasn't?
Frank
Hello Frank and Waldek!
FH> already, otherwise you wouldn't have seen this message)? If no other FH> message appeared after the above, it may even be that everything was FH> compiled successfully. Did you check that it wasn't?
Sure it doesn't. Here are the data:
================================= Command line and gp's output: [igor@marnat2 test]$ make gp PC=ppc-linux-gpc -v -Wl,-v testpas.pas ppc-linux-gpc -dumpmachine ppc-linux-gpc -dumpversion ppc-linux-gpc -print-file-name=units ppc-linux-gpc --print-needed-options -x Preprocessed-Pascal /var/tmp/GPaaa00736 ppc-linux-gpc -I /home/igor/tmp/test/ -I /home/igor/tmp/test/ -I . -I /home/igor/src-big/ELDK4.0/usr/lib/gcc/ppc-linux/4.0.3/units -I /home/igor/tmp/test/ --unit-path=/home/igor/tmp/test/ -E -H /home/igor/tmp/test/testpas.pas ppc-linux-gpc -I /home/igor/tmp/test/ -I /home/igor/tmp/test/ -I . -I /home/igor/src-big/ELDK4.0/usr/lib/gcc/ppc-linux/4.0.3/units -I /home/igor/tmp/test/ -E -H /home/igor/tmp/test/test.c TOTAL : 0.00 0.00 0.00 make: *** [all] Error 1
================================= Software versions: [igor@marnat2 test]$ gp --version GP version 0.61 (GNU Pascal Make Utility) Copyright (C) 2000-2005 Free Software Foundation, Inc.
GP and GNU Pascal come with NO WARRANTY, to the extent permitted by law. You may redistribute copies of GP and GNU Pascal under the terms of the GNU General Public License. For more information about these matters, see the file named COPYING.
Report bugs to gpc@gnu.de.
[igor@marnat2 test]$ ppc-linux-gpc -v Using built-in specs. Configured with: ../configure --prefix=/home/igor/src-big/ELDK4.0/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --disable-libgcj --target=ppc-linux --with-newlib --enable-languages=c,pascal --enable-multilib=no --disable-multilib Thread model: posix gpc version 20060325, based on gcc-4.0.3 (DENX ELDK custom version 4.0.3-1)
================================= testpas.pas:
program test;
{$L test.c}
procedure CInc (var T: byte); external name 'cinc';
var t: byte;
begin t := 5; writeln (t); CInc (t); writeln (t);
end.
test.c: void cinc (unsigned char* t) { (*t)++; return; }
Best regards, Igor Marnat mailto:marny@rambler.ru
Igor Marnat wrote:
Hello Frank and Waldek!
FH> already, otherwise you wouldn't have seen this message)? If no other FH> message appeared after the above, it may even be that everything was FH> compiled successfully. Did you check that it wasn't?
Sure it doesn't. Here are the data:
================================= Command line and gp's output:
Sorry, where's the output? I don't see any messages from the compilers there, neither the mentioned "new style" message. (Please remove all *.o *.gpi *.gpd files before running the command to get full output.)
[igor@marnat2 test]$ make gp PC=ppc-linux-gpc -v -Wl,-v testpas.pas ppc-linux-gpc -dumpmachine ppc-linux-gpc -dumpversion ppc-linux-gpc -print-file-name=units ppc-linux-gpc --print-needed-options -x Preprocessed-Pascal /var/tmp/GPaaa00736 ppc-linux-gpc -I /home/igor/tmp/test/ -I /home/igor/tmp/test/ -I . -I /home/igor/src-big/ELDK4.0/usr/lib/gcc/ppc-linux/4.0.3/units -I /home/igor/tmp/test/ --unit-path=/home/igor/tmp/test/ -E -H /home/igor/tmp/test/testpas.pas ppc-linux-gpc -I /home/igor/tmp/test/ -I /home/igor/tmp/test/ -I . -I /home/igor/src-big/ELDK4.0/usr/lib/gcc/ppc-linux/4.0.3/units -I /home/igor/tmp/test/ -E -H /home/igor/tmp/test/test.c
What's the output if you run this last command manually, and error status (do "echo $?" afterwards)?
Please also send the content of all *.gpd files that are produced before it aborts (if any).
Frank
Hello Frank,
FH> Sorry, where's the output? I don't see any messages from the FH> compilers there, neither the mentioned "new style" message. (Please
Yes , that's true. The message about "new style" appeared when I built my main project. It is big and fat and I tried to create simple and little one just for testing. Message about new style does not appear when the test project is being built. Anyway there is something odd here since it doesn't gets built.
FH> What's the output if you run this last command manually, and error FH> status (do "echo $?" afterwards)?
Here it is:
[igor@marnat2 test]$ make gp -v PC=ppc-linux-gpc testpas.pas ppc-linux-gpc -dumpmachine ppc-linux-gpc -dumpversion ppc-linux-gpc -print-file-name=units ppc-linux-gpc --print-needed-options -x Preprocessed-Pascal /var/tmp/GPaaa04995 ppc-linux-gpc -I /home/igor/tmp/test/ -I /home/igor/tmp/test/ -I . -I /home/igor/src-big/ELDK4.0/usr/lib/gcc/ppc-linux/4.0.3/units -I /home/igor/tmp/test/ --unit-path=/home/igor/tmp/test/ -E -H /home/igor/tmp/test/testpas.pas ppc-linux-gpc -I /home/igor/tmp/test/ -I /home/igor/tmp/test/ -I . -I /home/igor/src-big/ELDK4.0/usr/lib/gcc/ppc-linux/4.0.3/units -I /home/igor/tmp/test/ -E -H /home/igor/tmp/test/test.c TOTAL : 0.00 0.00 0.00 make: *** [all] Error 1 [igor@marnat2 test]$ ppc-linux-gpc -I /home/igor/tmp/test/ -I /home/igor/tmp/test/ -I . -I /home/igor/src-big/ELDK4.0/usr/lib/gcc/ppc-linux/4.0.3/units -I /home/igor/tmp/test/ -E -H /home/igor/tmp/test/test.c # 1 "/home/igor/tmp/test/test.c" # 1 "<built-in>" # 1 "<command line>" # 1 "/home/igor/tmp/test/test.c" void cinc (unsigned char* t) { (*t)++; return; }
Execution times (seconds) TOTAL : 0.00 0.00 0.01 [igor@marnat2 test]$ echo $? 0
FH> Please also send the content of all *.gpd files that are produced FH> before it aborts (if any).
There is the only one *.gpd file afterwards:
[igor@marnat2 test]$ echo $? 0 [igor@marnat2 test]$ ls -l total 16 -rw-rw-r-- 1 igor igor 574 Sep 1 16:44 makefile -rw-rw-r-- 1 igor igor 52 Sep 1 10:35 test.c -rw-rw-r-- 1 igor igor 263 Sep 1 16:49 testpas.gpd -rw-rw-r-- 1 igor igor 161 Sep 1 11:06 testpas.pas [igor@marnat2 test]$ cat testpas.gpd GNU Pascal Preliminary Dependency File, Version 2 T 1 t ppc-linux V 20060325, based on gcc-4.0.3 (DENX ELDK custom version 4.0.3-1) P p g n 17 m 5120d06554a1b352740ad129808dffdc m 00000000000000000000000000000000 m 00000000000000000000000000000000 M l test.c
Regards, Igor Marnat mailto:marny@rambler.ru
Igor Marnat wrote:
FH> Sorry, where's the output? I don't see any messages from the FH> compilers there, neither the mentioned "new style" message. (Please
Yes , that's true. The message about "new style" appeared when I built my main project. It is big and fat and I tried to create simple and little one just for testing. Message about new style does not appear when the test project is being built. Anyway there is something odd here since it doesn't gets built.
FH> What's the output if you run this last command manually, and error FH> status (do "echo $?" afterwards)?
Here it is:
[igor@marnat2 test]$ make gp -v PC=ppc-linux-gpc testpas.pas ppc-linux-gpc -dumpmachine ppc-linux-gpc -dumpversion ppc-linux-gpc -print-file-name=units ppc-linux-gpc --print-needed-options -x Preprocessed-Pascal /var/tmp/GPaaa04995 ppc-linux-gpc -I /home/igor/tmp/test/ -I /home/igor/tmp/test/ -I . -I /home/igor/src-big/ELDK4.0/usr/lib/gcc/ppc-linux/4.0.3/units -I /home/igor/tmp/test/ --unit-path=/home/igor/tmp/test/ -E -H /home/igor/tmp/test/testpas.pas ppc-linux-gpc -I /home/igor/tmp/test/ -I /home/igor/tmp/test/ -I . -I /home/igor/src-big/ELDK4.0/usr/lib/gcc/ppc-linux/4.0.3/units -I /home/igor/tmp/test/ -E -H /home/igor/tmp/test/test.c TOTAL : 0.00 0.00 0.00 make: *** [all] Error 1 [igor@marnat2 test]$ ppc-linux-gpc -I /home/igor/tmp/test/ -I /home/igor/tmp/test/ -I . -I /home/igor/src-big/ELDK4.0/usr/lib/gcc/ppc-linux/4.0.3/units -I /home/igor/tmp/test/ -E -H /home/igor/tmp/test/test.c # 1 "/home/igor/tmp/test/test.c" # 1 "<built-in>" # 1 "<command line>" # 1 "/home/igor/tmp/test/test.c" void cinc (unsigned char* t) { (*t)++; return; }
Execution times (seconds) TOTAL : 0.00 0.00 0.01 [igor@marnat2 test]$ echo $? 0
FH> Please also send the content of all *.gpd files that are produced FH> before it aborts (if any).
There is the only one *.gpd file afterwards:
[...]
I'm a bit confused. I see nothing suspicious here. Could you please use the source code of GP to find out where it exits with status 1? It's probably via procedure Quit (gp.pas), but AFAICS it can only happen if either an error message was printed (e.g. GeneralError, but there is no error message above), or when GP reads an unexpected error message from a compiler it calls (this would be the line "OK := False" in function ReadBufferAndIncludes, but it should echo the message before ("WriteLn (StdErr, s);"), but again, no such message above), or a shell command failed (but the last command called didn't fail when you called it manually -- of course, it may still fail when called from GP for some strange reason, this would then be the line "if Status <> 0 then Quit (Status);" in procedure ParseC).
Frank
Hello Frank, hello List!
FH> "OK := False" in function ReadBufferAndIncludes, but it should echo FH> the message before ("WriteLn (StdErr, s);"), but again, no such FH> message above), or a shell command failed (but the last command
Thank you for your prompting, I hope I've found something.
First of all, yes, gp really exits with not Ok in function ReadBufferAndIncludes. Condition "if (Pos (': ', s) <> 0)" works and gp quits. It really prints the string confused which looks like "TOTAL : 0.00 0.00 0.00". This string is the output of "ppc-linux-gpc .... -E -H test.c" command. I think that ppc-linux-gpc just prints the summary of execution time and gp erroneously take it for error message (or something like this). It all worked for x86 target because gcc was called for *.c files processing instead of gpc as for ppc-linux-target and gcc doesn't print summary messages containing ": ".
I think that the problem is that I called gp with "PC=ppc-linux-gpc" parameter for ppc target. It worked for x86 because gp used gcc instead of gpc for c files processing. Gp doesn't work for x86 as well if I call it with "gp testpas.pas" command instead of "gp testpas.pas".
What is the best way to correct the situation?
Thank you for your help, best regards, Igor Marnat mailto:marny@rambler.ru
Igor Marnat wrote:
Hello Frank, hello List!
FH> "OK := False" in function ReadBufferAndIncludes, but it should echo FH> the message before ("WriteLn (StdErr, s);"), but again, no such FH> message above), or a shell command failed (but the last command
Thank you for your prompting, I hope I've found something.
First of all, yes, gp really exits with not Ok in function ReadBufferAndIncludes. Condition "if (Pos (': ', s) <> 0)" works and gp quits. It really prints the string confused which looks like "TOTAL : 0.00 0.00 0.00". This string is the output of "ppc-linux-gpc .... -E -H test.c" command. I think that ppc-linux-gpc just prints the summary of execution time and gp erroneously take it for error message (or something like this). It all worked for x86 target because gcc was called for *.c files processing instead of gpc as for ppc-linux-target and gcc doesn't print summary messages containing ": ".
I think that the problem is that I called gp with "PC=ppc-linux-gpc" parameter for ppc target. It worked for x86 because gp used gcc instead of gpc for c files processing. Gp doesn't work for x86 as well if I call it with "gp testpas.pas" command instead of "gp testpas.pas".
What is the best way to correct the situation?
Earlier:
[igor@marnat2 test]$ ppc-linux-gpc -I /home/igor/tmp/test/ -I /home/igor/tmp/test/ -I . -I /home/igor/src-big/ELDK4.0/usr/lib/gcc/ppc-linux/4.0.3/units -I /home/igor/tmp/test/ -E -H /home/igor/tmp/test/test.c # 1 "/home/igor/tmp/test/test.c" # 1 "<built-in>" # 1 "<command line>" # 1 "/home/igor/tmp/test/test.c" void cinc (unsigned char* t) { (*t)++; return; }
Execution times (seconds) TOTAL : 0.00 0.00 0.01
Normally your ppc-linux-gpc (with given options) should not print the last line. Try:
ppc-linux-gpc -v -E -H /home/igor/tmp/test/test.c
you should see something like:
....../cc1 -E -quiet ....
the `-quiet' option is crucial here: it removes extra diagnostics (in particular time report).
Hello Waldek,
WH> Normally your ppc-linux-gpc (with given options) should not print WH> the last line. Try:
WH> ppc-linux-gpc -v -E -H /home/igor/tmp/test/test.c WH> the `-quiet' option is crucial here: it removes extra diagnostics WH> (in particular time report).
I tried the command you sent but there is no '-quiet' option. Something goes wrong?
[igor@marnat2 test]$ ppc-linux-gpc -v -E -H /home/igor/tmp/test/test.c Using built-in specs. Configured with: ../configure --prefix=/home/igor/src-big/ELDK4.0/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --disable-libgcj --target=ppc-linux --with-newlib --enable-languages=c,pascal --enable-multilib=no --disable-multilib Thread model: posix gpc version 20060325, based on gcc-4.0.3 (DENX ELDK custom version 4.0.3-1) /home/igor/src-big/ELDK4.0/usr/libexec/gcc/ppc-linux/4.0.3/cc1 -E -v -H -D__unix__ -D__gnu_linux__ -D__linux__ -Dunix -D__unix -Dlinux -D__linux -Asystem=linux -Asystem=unix -Asystem=posix /home/igor/tmp/test/test.c ignoring nonexistent directory "/home/igor/src-big/ELDK4.0/usr/lib/gcc/ppc-linux/4.0.3/../../../../ppc-linux/sys-include" #include "..." search starts here: #include <...> search starts here: /home/igor/src-big/ELDK4.0/usr/lib/gcc/ppc-linux/4.0.3/include /home/igor/src-big/ELDK4.0/usr/lib/gcc/ppc-linux/4.0.3/../../../../ppc-linux/include End of search list. # 1 "/home/igor/tmp/test/test.c" # 1 "<built-in>" # 1 "<command line>" # 1 "/home/igor/tmp/test/test.c" void cinc (unsigned char* t) { (*t)++; return; }
Execution times (seconds) TOTAL : 0.00 0.00 0.03
Hello Waldek, Frank and List!
WH> you should see something like: WH> ....../cc1 -E -quiet ....
Well, what is the decision? Is it bug in gpc, in gp, or am I doing something wrong?
Best regards, Igor Marnat mailto:marny@rambler.ru
Hello Waldek, Frank and List!
WH> you should see something like: WH> ....../cc1 -E -quiet ....
Well, what is the decision? Is it bug in gpc, in gp, or am I doing something wrong?
1) If _unmodified_ gpc gives your result (and gcc does not!) I would consider it a gpc bug, however ATM it looks more like local modification (maybe a wrapper script?). Namely, the `-quiet' option is generated from `specs' file and is there. The part which reads (interprets) specs file is common to all platforms and is identical to code in gcc. BTW, I have build gpc targetting ppc-linux and I do not see timing reports.
2) Only Frank can tell if gp is supposed to cope with timing reports. When using unodified gpc one can give `-Q' option which turns time reports on -- Frank should decide if gp is compatible with this option.
Hello Waldek, Frank, List!
WH> 1) If _unmodified_ gpc gives your result (and gcc does not!) I would WH> consider it a gpc bug, however ATM it looks more like local WH> modification (maybe a wrapper script?). Namely, the `-quiet' option WH> is generated from `specs' file and is there. The part which WH> reads (interprets) specs file is common to all platforms and is WH> identical to code in gcc. BTW, I have build gpc targetting ppc-linux WH> and I do not see timing reports.
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 1. 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?
2. What should I do in order to go further with subject? I found the way to get it work for me (by restoring 'specs' file) but I'd like to be totally clear on this point.
Best regards, Igor Marnat mailto:marny@rambler.ru
Hello Waldek, Frank, List!
WH> 1) If _unmodified_ gpc gives your result (and gcc does not!) I would WH> consider it a gpc bug, however ATM it looks more like local WH> modification (maybe a wrapper script?). Namely, the `-quiet' option WH> is generated from `specs' file and is there. The part which WH> reads (interprets) specs file is common to all platforms and is WH> identical to code in gcc. BTW, I have build gpc targetting ppc-linux WH> and I do not see timing reports.
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?
- What should I do in
order to go further with subject? I found the way to get it work for me (by restoring 'specs' file) but I'd like to be totally clear on this point.
I can now reproduce the problem. ATM (for about two weeks) I am away from home -- I will investigate it further when I am back home.
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*}\
Hello Waldek,
WH> The following should fix problem with '-quiet' option (I still have WH> to investigate other options):
WH> --- gpc.c.bb 2006-09-26 20:09:43.684244432 +0200 WH> +++ gpc.c 2006-09-26 20:21:27.444256648 +0200 WH> @@ -1043,8 +1043,11 @@ WH> therefore no dependency entry, confuses make into thinking a .o WH> file that happens to exist is up-to-date. */ WH> static const char *cpp_unique_options = WH> -"%{C|CC:%{!E:%eGCC does not support -C or -CC without -E}}\ WH> - %{nostdinc*} %{C} %{CC} %{v} %{I*} %{P} %I\ WH> +"%{C|CC:%{!E:%eGCC does not support -C or -CC without -E}}" WH> +#ifdef GCC_3_3 WH> +" %{!Q:-quiet}" WH> +#endif WH> +" %{nostdinc*} %{C} %{CC} %{v} %{I*} %{P} %I\ WH> %{MD:-MD %{!o:%b.d}%{o*:%.d%*}}\ WH> %{MMD:-MMD %{!o:%b.d}%{o*:%.d%*}}\ WH> %{M} %{MM} %{MF*} %{MG} %{MP} %{MQ*} %{MT*}\
Sorry for delay. Thank you for the patch, I tried it, works fine.
Best regards, Igor Marnat mailto:marny@rambler.ru
Waldek Hebisch wrote:
- Only Frank can tell if gp is supposed to cope with timing reports.
When using unodified gpc one can give `-Q' option which turns time reports on -- Frank should decide if gp is compatible with this option.
The dependency-gathering phase of GP is not compatible with this option. The option generates a lot more output, and trying to filter it all in GP would be futile. For the regular compilation calls (where the -Q output is probably most useful), it's no problem though.
So the attached patch makes GP filter out an explicit "-Q" option for the dependency calls. This does not help against lack of an implicit "-quiet", so Waldek's gpc.c patch is still needed. If you find that it won't work reliably or with all backends, I might have to make GP add an explicit "-quiet" ... I wanted to say, but "-quiet" apparently is used internally between gpc and gpc1 only and can't be given on the gpc command-line, so that's not an option (quite literally ;-).
Frank