Fw: unexpected gpc command line behaviour

trevor-b at ovi.com trevor-b at ovi.com
Tue Feb 28 21:19:05 CET 2012


Now resolved ...

The problem was a forgotten alias that I put into my bash script that made the 32 bit binary distribution of gpc run neatly on my 64 bit PC.

    alias gpc='gpc  -Wa,--32 -Wl,--no-warn-search-mismatch'

explains everything perfectly and | should have thought of this earlier.

Many thanks to those of you who contacted me with suggestions - mostly suggesting that I look at my environment somewhere.


-- Trevor//

----- Forwarded Message -----
>From: "trevor-b at ovi.com" <trevor-b at ovi.com>
>To: "gpc at gnu.de" <gpc at gnu.de> 
>Sent: Thursday, 19 January 2012, 13:24
>Subject: unexpected gpc command line behaviour
> 
>
>Hi,
>I've built gpc-20070904 for openSuSE 12.1 and the gpc command fails unless I type the full path name of gpc on the command line.
>
>
>For example, if I type gpc -- verbose hello.pas , gpc calls the assembler in 32 bit mode.  Like this ...
>
> ...
>
>On the other hand, when I call gpc using its full path name, everything works as expected ...
>
>
>trevor at linux-z54m:~/projects/gpc/gpc-20070904/p/demos> /usr/local/bin/gpc --verbose hello.pas 
>Reading specs from /usr/local/gpc/lib64/gcc/x86_64-suse-linux-gnu/3.4.6/specs
>Configured with: ./configure --host=x86_64-suse-linux-gnu --build=x86_64-suse-linux-gnu --enable-languages=pascal --disable-mapped-location --enable-threads=posix --disable-nls --prefix=/usr/local/gpc --infodir=/usr/local/info --mandir=/usr/local/man
>Thread model: posix
>gpc version 20070904, based on gcc-3.4.6
> /usr/local/gpc/lib/gcc/x86_64-suse-linux-gnu/3.4.6/gpc1 -quiet -v hello.pas -quiet -dumpbase
hello.pas -mtune=k8 -auxbase hello -famtmpfile=/tmp/ccVD338Z.gpa -version -o /tmp/ccxCBcyY.s
>GNU Pascal version 20070904, based on gcc-3.4.6 (x86_64-suse-linux-gnu)
>        compiled by GNU C version 3.4.6.
>GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
>GNU Pascal Compiler PreProcessor version 20070904, based on gcc-3.4.6
>
> as -V -Qy -o /tmp/ccBkjEYW.o /tmp/ccxCBcyY.s
>GNU assembler version 2.21.1 (x86_64-suse-linux) using BFD version (GNU Binutils; openSUSE 12.1) 2.21.1
> ld --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 /usr/lib/../lib64/crt1.o /usr/lib/../lib64/crti.o /usr/local/gpc/lib64/gcc/x86_64-suse-linux-gnu/3.4.6/crtbegin.o -L/usr/local/gpc/lib64/gcc/x86_64-suse-linux-gnu/3.4.6 -L/usr/local/gpc/lib64/gcc/x86_64-suse-linux-gnu/3.4.6/../../../../lib64 -L/usr/local/gpc/lib64/gcc/x86_64-suse-linux-gnu/3.4.6/../../..
-L/lib/../lib64 -L/usr/lib/../lib64 /tmp/ccBkjEYW.o -lgpc -lm -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/local/gpc/lib64/gcc/x86_64-suse-linux-gnu/3.4.6/crtend.o /usr/lib/../lib64/crtn.o
>trevor at linux-z54m:~/projects/gpc/gpc-20070904/p/demos> ./a.out
>Hello, world.
>trevor at linux-z54m:~/projects/gpc/gpc-20070904/p/demos> 
>
>
>
>Similar (but not identical) problem when I call gpc with no arguments:  When I omit the full pathname, gpc fails because it tries to link an empty file ...
>
>
>
>trevor at linux-z54m:~/projects/gpc/gpc-20070904/p/demos> gpc --verbose
>Reading specs from /usr/local/gpc/lib64/gcc/x86_64-suse-linux-gnu/3.4.6/specs
>Configured with: ./configure --host=x86_64-suse-linux-gnu --build=x86_64-suse-linux-gnu --enable-languages=pascal --disable-mapped-location --enable-threads=posix --disable-nls --prefix=/usr/local/gpc
--infodir=/usr/local/info --mandir=/usr/local/man
>Thread model: posix
>gpc version 20070904, based on gcc-3.4.6
> ld --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 /usr/lib/../lib64/crt1.o /usr/lib/../lib64/crti.o /usr/local/gpc/lib64/gcc/x86_64-suse-linux-gnu/3.4.6/crtbegin.o -L/usr/local/gpc/lib64/gcc/x86_64-suse-linux-gnu/3.4.6 -L/usr/local/gpc/lib64/gcc/x86_64-suse-linux-gnu/3.4.6/../../../../lib64 -L/usr/local/gpc/lib64/gcc/x86_64-suse-linux-gnu/3.4.6/../../.. -L/lib/../lib64 -L/usr/lib/../lib64 --no-warn-search-mismatch -lgpc -lm -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/local/gpc/lib64/gcc/x86_64-suse-linux-gnu/3.4.6/crtend.o /usr/lib/../lib64/crtn.o
>/usr/lib/../lib64/crt1.o: In function `_start':
>/home/abuild/rpmbuild/BUILD/glibc-2.14.1/csu/../sysdeps/x86_64/elf/start.S:109: undefined reference to
`main'
>trevor at linux-z54m:~/projects/gpc/gpc-20070904/p/demos> 
>
>
>
>
>
>With a full pathname, gpc prints some version info and exits (as expected)
>
>
>
>trevor at linux-z54m:~/projects/gpc/gpc-20070904/p/demos> /usr/local/bin/gpc --verbose
>Reading specs from /usr/local/gpc/lib64/gcc/x86_64-suse-linux-gnu/3.4.6/specs
>Configured with: ./configure --host=x86_64-suse-linux-gnu --build=x86_64-suse-linux-gnu --enable-languages=pascal --disable-mapped-location --enable-threads=posix --disable-nls --prefix=/usr/local/gpc --infodir=/usr/local/info --mandir=/usr/local/man
>Thread model: posix
>gpc version 20070904, based on gcc-3.4.6
>trevor at linux-z54m:~/projects/gpc/gpc-20070904/p/demos>
>
>
>Note:  /usr/local/bin/gpc is a link:   
>
>trevor at linux-z54m:~/projects/gpc/gpc-20070904/p/demos> file /usr/local/bin/gpc
>/usr/local/bin/gpc:
symbolic link to `/usr/local/gpc/bin/gpc'
>trevor at linux-z54m:~/projects/gpc/gpc-20070904/p/demos> 
>
>
>
>Also,
>
>trevor at linux-z54m:~/projects/gpc/gcc-3.4.6/gcc/p/test> uname -a
>Linux linux-z54m 3.1.0-1.2-desktop #1 SMP PREEMPT Thu Nov 3 14:45:45 UTC 2011 (187dde0) x86_64 x86_64 x86_64 GNU/Linux
>trevor at linux-z54m:~/projects/gpc/gcc-3.4.6/gcc/p/test> 
>
>
>Also, calling gpc (ie in short form, not using full pathname) from a shell script works as expected, so the test scripts work.   Results copied below.
>I built gpc on openSuSE 11.3 using the same build process (as far as I know) and there were no problems.
>
>
>
>
>
>OK, it's not a catastrophic failure, but I would like to fix it.
>Does anyone know what causes this, and what I need to do about it?
>Any ideas much appreciated.
>
>
>
>
>Test summary:
>
>
>                === gpc Summary ===
>
># of tests                5111
># of expected passes      5102
># of unexpected failures  7
># of unsupported tests    2
>
>
>_______________________________________________
>Gpc mailing list
>Gpc at gnu.de
>https://www.g-n-u.de/mailman/listinfo/gpc
>
>
>



More information about the Gpc mailing list