On 07/30/10 03:46 PM, Dennis Clarke wrote:
On 07/30/10 06:07, Dr. David Kirkby wrote:
I have an HP C3600 workstation
http://www.b2net.co.uk/hp/hp_visualize_c3600_workstation.htm
which is fitted with 552 MHz PA-8600 PA-RISC CPU (64-bit) and 8 GB RAM.
If I use gcc -m64, I get an error.
drkirkby@hpbox:~$ gcc -m64 test.c
cc1: error: unrecognized command line option "-m64"
Can anyone tell me how to build 64-bit binaries with gcc on this
machine?
GCC for the PA isn't runtime switchable between 32 and 64 bit binaries.
ie, however GCC was initially configured is the only way it'll generate
code on the PA.
What does gcc -v report?
I recall going through some gymnastics on that server. Not sure .. but the
gcc that I bootstrapped was 64-bit ready.
Funny that HP could not be bothered to make a server that runs both 32-bit
and 64-bit executables .. but I digress.
The machine (really a workstation rather than a server), can run both 32-bit and
64-bit binaries. It's similar to the non-ancient SPARCs in that matter.
I note that I have a version of gcc able to build 64-bit. But if I recall
correctly, that gcc was buggy, which was why Dennis built another one on my
machine.
See the code below, which just prints sizeof(long)
drkirkby@hpbox:~$ /home/dclarke/local/bin/gcc test.c
drkirkby@hpbox:~$ file a.out
a.out: PA-RISC1.1 shared executable dynamically linked -not stripped
drkirkby@hpbox:~$ ./a.out
sizeof(long)=4
drkirkby@hpbox:~$ /opt/hp-gcc64-4.4.0/bin/gcc test.c
drkirkby@hpbox:~$ file a.out
a.out: ELF-64 executable object file - PA-RISC 2.0 (LP64)
drkirkby@hpbox:~$ ./a.out
sizeof(long)=8
drkirkby@hpbox:~$ cat test.c
#include <stdio.h>
int main(int argc, char **argv){
printf("sizeof(long)=%d\n",sizeof(long));
}