Operating System - Linux
1752292 Members
4526 Online
108786 Solutions
New Discussion юеВ

Re: HP-UX 11.11 compiled binaries running on HP-UX 11.00

 
SOLVED
Go to solution
Stephen Keane
Honored Contributor

HP-UX 11.11 compiled binaries running on HP-UX 11.00

I'm probably missing something really obvious here, but when I compile (using gcc 3.4.3) binaries (PA-RISC2.0) on a HP-UX 11.11 box, when I try and run them on a HP-UX 11.00 box I get a SIGSEV core dump and ldd doesn't work on them either.

I tried compiling them as PA-RISC1.1 binaries but gcc/g++ steadfastly refuses to do so despite every combination of -march=1.1 and +DA1.1 and +DAportable etc I've tried.


14 REPLIES 14
A. Clay Stephenson
Acclaimed Contributor

Re: HP-UX 11.11 compiled binaries running on HP-UX 11.00

I don't use gcc on HP-UX but evenso you know you are not following the Yellow Brick Road by trying execute 11.11 code on 11.0 boxes. The code is upwardly compatible only. I have actually run 11.11 produced code on 11.0 boxes and the HP compilers respect the +DAportable et al options. The most likely culprit is differences in shared library functions so you might try statically linked code but in all cases if you get this to work, it's working by accident. I also assume that you are not trying to execute 64-bit code on a 32-bit box or PA-RISC 2.0 on a less then PA-8000 equipped box.
If it ain't broke, I can fix that.
Kent Ostby
Honored Contributor

Re: HP-UX 11.11 compiled binaries running on HP-UX 11.00

compiled on 11.00 --> should run on 11.11.

There are no guarentees going in the direction that you are trying to move your code.
"Well, actually, she is a rocket scientist" -- Steve Martin in "Roxanne"
Steven E. Protter
Exalted Contributor

Re: HP-UX 11.11 compiled binaries running on HP-UX 11.00

Shalom,

The real answer is, it depends.

It depends on the compiler, it depends on the code, it depends on the options.

It might work, it might not.

I'd say write a good test plan.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
H.Merijn Brand (procura
Honored Contributor
Solution

Re: HP-UX 11.11 compiled binaries running on HP-UX 11.00

-march is not a valid gcc option for HP-UX

-mpa-risc-1-1 is


I've just tried, and I am *sure* it depends on the libs you link against.

11.11:
/tmp 104 > cat xx.c
#include

int main (int argc, char *argv[])
{
(void)printf ("Hello, world\n");
return (0);
} /* main */
/tmp 105 > gcc -static -o xx xx.c
/tmp 106 > ./xx
Hello, world
/tmp 107 > ux
HP-UX 11.11/64 U 9000/800/rp3410/64 PA8800/800(2) pa-2.0 4094 Mb
/tmp 108 >

NFS from 11.00
/hpux1111/tmp 102 > ./xx
Hello, world
/hpux1111/tmp 103 > ux
HP-UX 11.00/64 U 9000/800/L1000-44/64 PA8500/440 pa-2.0 512 Mb
/hpux1111/tmp 104 >

Enjoy, Have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
Stephen Keane
Honored Contributor

Re: HP-UX 11.11 compiled binaries running on HP-UX 11.00

Sorry for the delay in replying, I've had all sorts of problems trying to log in with the new passport type scheme that the forums are using.

I can compile a PA-RISC2.0 binary on the 11.11 box and run it on the 11.00 box happily, but that binary doesn't use any "special" libraries. It is in fact a simple "hello world" application. I just wanted to see if PA-RISC2.0 code (in general) will run on a 11.00 box.

My "proper" code is built in a complicated build environment and to replicate that on the 11.00 box would be a nightmare. (hence the unsupported backwards porting problem). I am just investigating whether the code would ever run successfully on an 11.00 box before investing too much effort in providing an 11.00 build environment.

PS. I've tried -mpa-risc-1-1 as well, and as procura says, I think it depends on which libraries you are linking too.
Stephen Keane
Honored Contributor

Re: HP-UX 11.11 compiled binaries running on HP-UX 11.00

I've now dowloaded gcc 3.4.3 for 11.00 from Merijn's web-site, but when I try and complile a simple (C++) hello world I get

/usr/ccs/bin/ld: Unrecognized argument: +init
/usr/ccs/bin/ld: Usage: /usr/ccs/bin/ld flags... files...


Any clues?
H.Merijn Brand (procura
Honored Contributor

Re: HP-UX 11.11 compiled binaries running on HP-UX 11.00

I've never used g++, but it is now vital to know if you are using the 32bit version or the 64bit version, as the 32bit gcc/g++ can only work with HP ld (which makes the message strange), and the 64bit gcc/g++ prefers the GNU ld, which is localted in /usr/local/pa20_64/bin, which makes me assume that your path is wrong, or my depot is corrupted.

Can you check for the existance of /usr/local/pa20_64/bin/ld ?
Maybe it is there as ld.exe
In that case, you can blame me.

Enjoy, Have FUN! H.merijn
Enjoy, Have FUN! H.Merijn
Stephen Keane
Honored Contributor

Re: HP-UX 11.11 compiled binaries running on HP-UX 11.00

I downloaded the latest linker cumulative patches and that problem has gone away.

I now have to work out why some pstat calls are failing with unknown `struct __psdev'.

Ho hum, such is the developer's lot.
Stephen Keane
Honored Contributor

Re: HP-UX 11.11 compiled binaries running on HP-UX 11.00

I'm using the 32-bit version. Now I've got

/usr/ccs/bin/ld: Invalid loader fixup in text space needed in output file for symbol "__gxx_personality_sj0" in input file "/usr/local/pa20_32/lib/libstdc++.a(ios_init.o)"
collect2: ld returned 1 exit status