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 ...
trevor@linux-z54m:~/projects/gpc/gpc-20070904/p/demos> 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/ccsijV8f.gpa -version -o /tmp/cclfaLHH.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 --32 -o /tmp/ccrX1Zh9.o /tmp/cclfaLHH.s GNU assembler version 2.21.1 (x86_64-suse-linux) using BFD version (GNU Binutils; openSUSE 12.1) 2.21.1 /tmp/cclfaLHH.s: Assembler messages: /tmp/cclfaLHH.s:10: Error: bad register name `%rbp' /tmp/cclfaLHH.s:12: Error: bad register name `%rsp' /tmp/cclfaLHH.s:15: Error: bad register name `%rip)' /tmp/cclfaLHH.s:17: Error: `movabs' is only supported in 64-bit mode /tmp/cclfaLHH.s:20: Error: bad register name `%rip)' /tmp/cclfaLHH.s:22: Error: bad register name `%rip)' ... /tmp/cclfaLHH.s:67: Error: bad register name `%rbp)'
On the other hand, when I call gpc using its full path name, everything works as expected ...
trevor@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@linux-z54m:~/projects/gpc/gpc-20070904/p/demos> ./a.out Hello, world. trevor@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@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@linux-z54m:~/projects/gpc/gpc-20070904/p/demos>
With a full pathname, gpc prints some version info and exits (as expected)
trevor@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@linux-z54m:~/projects/gpc/gpc-20070904/p/demos>
Note: /usr/local/bin/gpc is a link:
trevor@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@linux-z54m:~/projects/gpc/gpc-20070904/p/demos>
Also,
trevor@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@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.3using 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
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@ovi.com" trevor-b@ovi.com To: "gpc@gnu.de" gpc@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@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@linux-z54m:~/projects/gpc/gpc-20070904/p/demos> ./a.out Hello, world. trevor@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@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@linux-z54m:~/projects/gpc/gpc-20070904/p/demos>
With a full pathname, gpc prints some version info and exits (as expected)
trevor@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@linux-z54m:~/projects/gpc/gpc-20070904/p/demos>
Note: /usr/local/bin/gpc is a link:
trevor@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@linux-z54m:~/projects/gpc/gpc-20070904/p/demos>
Also,
trevor@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@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@gnu.de https://www.g-n-u.de/mailman/listinfo/gpc