First, everything in this message occurred while logged in as "root".
I think I've installed the compiler properly but the assembler always reports errors for "push" and "pop". Sample messages and the results when compiling with the -v option can be found below.
The platform is a HP xw8200 (Xeon) machine running 64 bit Red Hat Enterprise Linux Desktop, probably release 5.2. On this system "uname -a" produces:
Linux lxstn08 2.6.18-164.el5 #1 SMP Tue Aug 18 15:51:48 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux
gcc was not installed on this system when gpc was loaded. Using the web page instructions for binaries at http://www.gnu-pascal.de/binary/ I installed the "gpc-2.1-with-gcc.i686-pc-linux-gnu.tar.gz" file into the standard location. After gpc was installed "man gpc" worked and "gpc -v" says:
gpc version 2.1 (20020510), based on 2.95.2 19991024 (release).
So far so good. Now the problem:
Compiling the absolute minimum version of "hello.pas" (1 writeln statement) produced ~15 assember error messages, a mixture of:
Error: suffix or operands invalid for "push" (and/or) Error: suffix or operands invalid for "pop" messages with about 4 times more "push" than "pop" messages.
Any ideas about how to fix this problem?
BTW, Although a 64 bit executable would be much preferred a 32 bit target that can run under 64 bit RHEL would also work for us.
----- BACKGROUND INFO
For safety, security, and configuration control reasons changing the RHEL components is not allowed. But installing applications (e.g. gpc, vnc, Open Office) that do not affect the O/S is OK.
"man as" says that binutils contains the portable Gnu assember.
My first thought was a 64/32 bit word length mismatch in a library, the compiler or the assembler. The "yum" results are at the end of this message.
Using the "-v" option produces (with <CR>s inserted for clarity):
# gpc -v hello.pas
Reading specs from /usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/specs gpc version 2.1 (20020510), based on 2.95.2 19991024 (release)
/usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/gpcpp -lang-pascal -v -famtmpfile=/tmp/ccL8ikKt -fdelphi-comments -D__GNU_PASCAL__ -undef -D__GNUC__=2 -D__GNUC_MINOR__=95 -D__GPC__=2 -D__GPC_MINOR__=1 -D__GPC_VERSION__=2.1 -D__GPC_RELEASE__=20020510 -D__BITS_LITTLE_ENDIAN__=1 -D__BYTES_LITTLE_ENDIAN__=1 -D__WORDS_LITTLE_ENDIAN__=1 -D__NEED_NO_ALIGNMENT__=1 -D__ELF__ -Dunix -D__i386__ -Dlinux -D__ELF__ -D__unix__ -D__i386__ -D__linux__ -D__unix -D__linux -Asystem(posix) -Acpu(i386) -Amachine(i386) -Di386 -D__i386 -D__i386__ -Di686 -Dpentiumpro -D__i686 -D__i686__ -D__pentiumpro -D__pentiumpro__ hello.p /tmp/cc3waT7h.i
GNU Pascal Compiler PreProcessor version 2.1 (20020510), based on gcc-2.95.2 19991024 (release) (i386 Linux/ELF)
#include "..." search starts here: #include <...> search starts here: /usr/local/include /usr/local/i686-pc-linux-gnu/include /usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/include /usr/include End of search list.
/usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/gpc1 /tmp/cc3waT7h.i -quiet -dumpbase hello.pas -version -famtmpfile=/tmp/ccL8ikKt -o /tmp/cc3waT7h.s
GNU Pascal version 2.95.2 19991024 (release) (i686-pc-linux-gnu) compiled by GNU C version 3.3.3. GNU Pascal version is actually 2.1 (20020510), based on gcc-2.95.2 19991024 (release)
as -V -Qy -o /tmp/cc3waT7h1.o /tmp/cc3waT7h.s
GNU assembler version 2.17.50.0.6-12.el5 (x86_64-redhat-linux) using BFD version 2.17.50.0.6-12.el5 20061020
/tmp/cc3waT7h.s: Assembler messages: /tmp/cc3waT7h.s:14: Error: suffix or operands invalid for `push' /tmp/cc3waT7h.s:18: Error: suffix or operands invalid for `push'
... (about ~14 more "pop" and "push" error messages)
---
The man page for "as(1)" does not list the options -V or -Qy (used above). Also odd is that the "/usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.2" folder contains "collect2" instead of "collect" - and that the file "/lib/crt[01n].o" does not exist on this system (or is the "gpc" man page out of date?).
I have downloaded but not installed the "gcc-core-2.95.2.tar.gz" compiler (from http://www.gnu-pascal.de/stable/). As suggested by the mailing list archives I have also downloaded a newer version of gpc and gcc from http://alignment.hep.brandeis.edu/Software/Pascal/Index.html (by using the "Linux binary", "GCC 3.4.6" and "GPC 20070904" links on that page). I then untarred gcc 3.4.6 into it's normal location (but "man gcc" and "gcc" still do not work). I have not yet tried installing the newer version of gpc.
yum reports the following packages as installed:
binutils.x86_64 2.17.50.0.06-12.el5 (missing i386 version?) glibc.i686 2.5-42 (instead of i386 version?) glibc.x86_64 2.5-42 glibc-common.x86_64 2.5-42 libgcc.i386 4.1.2-46.el5 (i686 version needed?) libgcc.x86_64 4.1.2-46.el5
<EOM>