Frank Heckenbach wrote:
Gert Doering wrote:
OK, here we go. This is how it's called:
---PC_WITH_FLAGS--- /s1/gpc-build-20060325-3.4.6/gcc/xgpc -B/s1/gpc-build-20060325-3.4.6/gcc/ --unit-path=/gnulocal/lib/gcc/powerpc-ibm-aix5.3.0.0/3.4.6/units -I /gnulocal/lib/gcc/powerpc-ibm-aix5.3.0.0/3.4.6/units -I ../rts --no-unit-path --unit-path=/s1/gcc-3.4.6/gcc/p/units --autobuild -g -O3 -W -Wall -Wno-unused -o a.out --unit-path=/s1/gcc-3.4.6/gcc/p/test --unit-path=/s1/gcc-3.4.6/gcc/p/test/../rts --unit-path=/s1/gcc-3.4.6/gcc/p/test/../units -I /s1/gcc-3.4.6/gcc/p/test -I /s1/gcc-3.4.6/gcc/p/test/../units --executable-path=. -Werror /s1/gcc-3.4.6/gcc/p/test/abso1.pas ---PC_WITH_FLAGS---
If I run that on "hello.pas" I get the same warnings from "cc1".
Adding "-v" to the gpc command line suggests that the warnings might come from "collect2":
Ah, collect2 ... :-/
... GNU Pascal Compiler PreProcessor version 20060325, based on gcc-3.4.6
{$include "..."} search starts here: {$include <...>} search starts here: /gnulocal/lib/gcc/powerpc-ibm-aix5.3.0.0/3.4.6/units ../rts /s1/gcc-3.4.6/gcc/p/test /s1/gcc-3.4.6/gcc/p/test/../units End of search list. as -u -mppc -o /tmp//cchPIwsI.o /tmp//cckcaRBw.s /s1/gpc-build-20060325-3.4.6/gcc/collect2 -bpT:0x10000000 -bpD:0x20000000 -btextro -bnodelcsect -bexport:/usr/lib/libg.exp -o a.out /lib/crt0.o -L/s1/gpc-build-20060325-3.4.6/gcc -L/gnulocal/lib/gcc/powerpc-ibm-aix5.3.0.0/3.4.6 -L/gnulocal/lib/gcc/powerpc-ibm-aix5.3.0.0/3.4.6/../../.. /tmp//cchPIwsI.o -lgpc -lm /s1/gpc-build-20060325-3.4.6/gcc/libgcc.a /s1/gpc-build-20060325-3.4.6/gcc/libgcc_eh.a -lg -lc /s1/gpc-build-20060325-3.4.6/gcc/libgcc.a /s1/gpc-build-20060325-3.4.6/gcc/libgcc_eh.a cc1: warning: command line option "-funit-path=/gnulocal/lib/gcc/powerpc-ibm-aix5.3.0.0/3.4.6/units" is valid for Pascal but not for C cc1: warning: command line option "-fno-unit-path" is valid for Pascal but not for C cc1: warning: command line option "-funit-path=/s1/gcc-3.4.6/gcc/p/units" is valid for Pascal but not for C cc1: warning: command line option "-fautobuild" is valid for Pascal but not for C cc1: warning: command line option "-funit-path=/s1/gcc-3.4.6/gcc/p/test" is valid for Pascal but not for C cc1: warning: command line option "-funit-path=/s1/gcc-3.4.6/gcc/p/test/../rts" is valid for Pascal but not for C
I still don't understand it, though. Where does collect2 get these options from? Are they included in the .o file?
I also wonder. Strangely, in the collect2 command line above, these options don't even appear. OTOH, I think collect2 does some fairly convoluted stuff (e.g., to output C++ templates AFAIK), so I wouldn't even be surprised if the options are embedded in the .o files or something ... :-(
The driver passes options to collect2 via environment (see `set_collect_gcc_options' in `gpc.c'). The problem is that the driver does not remove options which are invalid for C compiler. In principle other languages should have the same problem, I wonder how (if???) they handle it.