Operating System - HP-UX
1747984 Members
4872 Online
108756 Solutions
New Discussion юеВ

32 bit compilation on 64 bit machine

 
SOLVED
Go to solution
Norman Allen_1
New Member

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 12
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
New Member

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).
 
--
ranga
[i work for hpe]

Accept or Kudo

Norman Allen_1
New Member

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
New Member

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!