Databases
cancel
Showing results for 
Search instead for 
Did you mean: 

32 bit compilation on 64 bit machine

SOLVED
Go to solution
Norman Allen_1
Occasional Visitor

32 bit compilation on 64 bit machine

We are porting our 32 bit C/SQL applications from B.11.0 (HP9000) to a 64 bit machine (B.11.11).
I can only find the +DD32 and +DD64 options. DD64 generates code for a RISC2.0 machine, DD32 generates code for a RISC1.1 machine equivalent to +DAportable.
Is there any way of creating 32bit code for a RISC2.0 machine?
12 REPLIES
H.Merijn Brand (procura
Honored Contributor
Solution

Re: 32 bit compilation on 64 bit machine

+DAportable is the way to generate 32bit pa-1.1 code

+DA2.0 is 32bit pa-risc-2.0
+DA2.0w is 64bit pa-risc-2.0

32bit is still the default

Enjoy, Have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
Manish Srivastava
Trusted Contributor

Re: 32 bit compilation on 64 bit machine

Hi Norman,

As far as I know, +DD32 bit generates 32 bit application and +DD64 generates 64 bit application. If you do file what you see as PA RISC 1.1 is fro 32 bit since it can run bot on PA RISC 1.1 and 2 but a 64 bit app will run only on PA RISC 2. Hence the binary you get with +DD32 is the one which you can run on PA RISC 2.

manish
rick jones
Honored Contributor

Re: 32 bit compilation on 64 bit machine

The compiler default is to produce a 32-bit binary for the architecture type on which the compiler is running. So, if you compile with now options on a PA2.0 system, you get a PA2.0 32-bit binary. If you compile with no options on an IPF system, you get an IPF 32-bit binary.
there is no rest for the wicked yet the virtuous have no pillows
Saravanan_11
Occasional Advisor

Re: 32 bit compilation on 64 bit machine

To build PA-RISC 1.1 and PA-RISC 2.0 binaries on a PA 11.11 machine

a. using GCC compiler option ,

-mpa-risc-1-1 --> PA-RISC 1.1 binary
-mpa-risc-2-0 --> PA-RISC 2.0 binary

b. using HP's C compiler option,

+DA1.1 --> PA-RISC 1.1 binary
+DA2.0 --> PA-RISC 2.0 binary { 32 bit }
+DA2.0w --> PA-RISC 2.0 binary { 64 bit }

-Saravanan
Norman Allen_1
Occasional Visitor

Re: 32 bit compilation on 64 bit machine

Thanks for all the information, however something new crops up.

If I compile with +DAportable to create RISC 1.1 32 bit code, our applications work.
If I use +DA2.0 (not +DA2.0w) which should create RISC 2.0 32 bit code, our applications hang. This is exactly the same problem I originally found when the compiler was generating 64 bit code.
The file statement only says RISC1.1 or RISC2.0, but not if its 32 or 64 bit.
Can someone tell me how to check if it is genuine 32 bit code, and why this should hang our applications?
ranganath ramachandra
Esteemed Contributor

Re: 32 bit compilation on 64 bit machine

please make sure you have the latest linker PHSS_30965 (and NOT PHSS_30048 : that linker may be one reason for the hangs).
Norman Allen_1
Occasional Visitor

Re: 32 bit compilation on 64 bit machine

Apparently PHSS_30965 is for 11.0.
We are running 11.11 with PHSS_30049. There doesn't seem to be an equivalent patch for 11i.
Bill Hassell
Honored Contributor

Re: 32 bit compilation on 64 bit machine

The file statement is all you need. Unless the file statement reports ELF format, the code is 32bits. Here's a link that discusses the 64bit executable format: http://docs.hp.com/cgi-bin/fsearch/framedisplay?top=/hpux/onlinedocs/B2355-90655/B2355-90655_top.html&con=/hpux/onlinedocs/B2355-90655/00/00/8-con.html&toc=/hpux/onlinedocs/B2355-90655/00/00/8-toc.html&searchterms=executable%7cformat%7celf&queryid=20040802-070918

On your 64bit opsystem, use file on the files in /usr/bin and you'll see some ELF's.


Bill Hassell, sysadmin
Norman Allen_1
Occasional Visitor

Re: 32 bit compilation on 64 bit machine

Now isn't that interesting - I've just done a file on /usr/bin and they are all defined as RISC1.1 executables!
That would explain why my attempts at creating RISC2.0 code fails!!!
I'm taking this up with my sysadmin guy, but in the meantime +DD32 or +DAportable works just fine.
When we have the time to port our applications from 32 to 64 bits, we'll have to change this!
Mike Stroyan
Honored Contributor

Re: 32 bit compilation on 64 bit machine

PHSS_30966 is the 11.11 equivalent to PHSS_30965.
The HP-UX commands are PA-RISC 1.1 executables, but that does not explain a problem with building and running PA2.0 32-bit programs.
A system with a PA2.0 processor can run both PA1.1 and PA2.0 code.
Bill Hassell
Honored Contributor

Re: 32 bit compilation on 64 bit machine

Whoops, I forgot. The HP-UX commands don't need to be 64bit. Try this:

file /stand/vmunix

If that isn't an ELF file then try this command to see what your kernel is runnng:

getconf KERNEL_BITS


Bill Hassell, sysadmin
Norman Allen_1
Occasional Visitor

Re: 32 bit compilation on 64 bit machine

/stand/vmunix returns
/stand/vmunix: ELF-64 executable object file - PA-RISC 2.0 (LP64)
and the getconf return 64.

If I'm compiling using +DA2.0 to generate 32 bit RISC 2.0 code, I don't see why this shouldn't work with the system libraries, etc. defined as RISC 1.1, but it doesn't.

One additional point, when I say "doesn't work" it does execute a bit, and I can see the point it stopped at. It processes input data, writes something to an Oracle 9 db, generates a report and then stops dead, with no obvious reason for the stop. I've tried running it under gdb but didn't get a very useful message at the point where it stopped.