New (gpc-20060325)

Frank Heckenbach ih8mj at fjf.gnu.de
Sun Jun 4 04:34:51 CEST 2006


Gert Doering wrote:

> so maybe portable code really should avoid using the same quote character
> on different levels.  Which means, the "right" thing to do would be:
> 
> echo "$PC `$PC $PFLAGS -dumpversion`, flags: $PFLAGS_NO_PATHS `if [ x"$GP" != x ]; then echo '(using GP)'; fi`"
> 
> - which seems to be fully portable to all shells I have tried.

Good idea, thanks.

> > > After that, the test suite starts, but *all* test programs fail:
> > > 
> > > "gmake pascal.check-long" explains what is going wrong:
> > > 
> > > Test Run By gd on 2006-05-19 13:43:03
> > > Native configuration is powerpc-ibm-aix5.3.0.0 (hilb31)
> > > /s1/gpc-build-20060325-3.4.6/gcc/xgpc -B/s1/gpc-build-20060325-3.4.6/gcc/ 20060325, based on gcc-3.4.6, flags: -g -O3 -W -Wall -Wno-unused   
> > > GPC-TEST-BEGIN
> > > ==========================
> > > TEST    abso1.pas:      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
> > > cc1: warning: command line option "-funit-path=/s1/gcc-3.4.6/gcc/p/test/../units" is valid for Pascal but not for C
> > > cc1: warning: command line option "-fexecutable-path=." is valid for Pascal but not for C
> > > OK
> > >
> > > I'm not sure how to proceed here.  Why is it calling cc1?  Why is it passing
> > > options that the backend doesn't like?  Is this something that gcc-3.4.6
> > > has changed?
> > 
> > For debugging, you could insert an echo statement in test_run,
> 
> 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 ... :-(

Can you try calling collect2 manually as above? You'll need to save
the Pascal .o file (I hope gpc -c will produce equivalent results)
and substitute it for /tmp//cchPIwsI.o in the command line. If it
still produces those errors, it must be something like that.

You could also try grepping for the option names in all generated
files (in particular the Pascal .o file) ...

If that's it, I guess we'll have to find out why collect2 is trying
to compile something at all (and what?), and how to put only options
understood by C into the .o file (as that something appears to be
something C) ...

Frank

-- 
Frank Heckenbach, frank at g-n-u.de, http://fjf.gnu.de/, 7977168E
GPC To-Do list, latest features, fixed bugs:
http://www.gnu-pascal.de/todo.html
GPC download signing key: ACB3 79B2 7EB2 B7A7 EFDE  D101 CD02 4C9D 0FE0 E5E8





More information about the Gpc mailing list