This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: How does one compile 64-bit executables on HP-UX PA-RISC?

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

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
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
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
drkirkby@hpbox:~$ cat test.c
#include <stdio.h>
int main(int argc, char **argv){


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]