I've been using an ancient 1999 version of GPC since, well, 1999, because it worked fine, came as an RPM, and did what I wanted.
However, I've now got a laptop that is running the 64 bit version of Mandriva Linux. Compiled 32-bit code seems to run OK, but the packaged versions of the compiler fail at the assembly stage. I.e. I can use my old versions of GPC to produce assembler, but the assembler gives error messages even on a "hello world" program.
Is there any simple work-around, or a binary distribution that should work on my system? Or do I have no option other than compiling from scratch?
Mike Reid
Mike Reid wrote:
I've been using an ancient 1999 version of GPC since, well, 1999, because it worked fine, came as an RPM, and did what I wanted.
However, I've now got a laptop that is running the 64 bit version of Mandriva Linux. Compiled 32-bit code seems to run OK, but the packaged versions of the compiler fail at the assembly stage. I.e. I can use my old versions of GPC to produce assembler, but the assembler gives error messages even on a "hello world" program.
Is there any simple work-around, or a binary distribution that should work on my system? Or do I have no option other than compiling from scratch?
You may try:
gpc -Wa,--32 foo.p
The '-Wa,--32' option tell gpc to pass '--32' option to assembler which in turn tells assembler to expect 32-bit code. By default assembler on 64-bit Linux expects 64-bit code.
Mandrake used to have GPC package (they were probably the first distribution which packaged GPC on AMD64 machines) -- if Mandrivia do not have recent package older one (or one from different distribution) may work fine.
OTOH compiling gpc from sources should be easy, so I would encourage you to try this.
Regarding running a 32-bit compiler on Mandriva 64: Waldek Hebisch wrote:
You may try:
gpc -Wa,--32 foo.p
The '-Wa,--32' option tell gpc to pass '--32' option to assembler which in turn tells assembler to expect 32-bit code. By default assembler on 64-bit Linux expects 64-bit code.
Thanks, gpc -Wa,--32 foo.p -L/usr/lib
did the trick (otherwise it didn't find the 32bit libraries).
Mandrake used to have GPC package (they were probably the first distribution which packaged GPC on AMD64 machines) -- if Mandrivia do not have recent package older one (or one from different distribution) may work fine.
OTOH compiling gpc from sources should be easy, so I would encourage you to try this.
Obviously I should look into doing it properly with 64-bit code, but in the meantime I am very happy that I can at least compile my code!
Mike Reid