Operating System - HP-UX
1834772 Members
3309 Online
110070 Solutions
New Discussion

The linked output may not run on a PA 1.x system

 
SOLVED
Go to solution
Max_4
Frequent Advisor

The linked output may not run on a PA 1.x system

Hi all,

It happens to be that I've just upgraded an L2000 from HP-UX11.00 to 11i. Also swinstalled the C and aC++ compilers for 11i. Before, when I was still on 11.00 when I used to compile C code, the output from the compiler was ok. Now whenever I link something there's always a warning mesage from ld:

At least one PA 2.0 object file (foo.o) was detected. The linked output may not run on a PA 1.x system.

What does this message means?
Is there something wrong with this?

Thanks to all in advance...
8 REPLIES 8
Steve Steel
Honored Contributor
Solution

Re: The linked output may not run on a PA 1.x system

Hi

This is normal because your system has the PA 2.0 instruction set.
To avoid using this instruction set, put +DAportable on the compilation line.


Steve Steel
If you want truly to understand something, try to change it. (Kurt Lewin)
H.Merijn Brand (procura
Honored Contributor

Re: The linked output may not run on a PA 1.x system

Or - better - if you are sure the objects are never run on hppa-1.1, use

cc -Wl,+vnocompatwarnings ...

If you are using gcc-3.0.4 or up, you can switch architectures with

gcc -mpa-risc-2-0 ...
or
gcc -mpa-risc-1-1 ...
Enjoy, Have FUN! H.Merijn
Carlos Fernandez Riera
Honored Contributor

Re: The linked output may not run on a PA 1.x system

From man cc:
Requires Optional ANSI C Compiler Software

1.1 systems. To generate code compatible across PA-
RISC 1.1 and 2.0 workstations and servers, use the
+DAportable option. For best performance use +DA with
the model number or architecture where you plan to
execute the program. See the file
/opt/langtools/lib/sched.models for a list of model
numbers and their PA-RISC architecture designations.
If you do not specify this option, the default object
code generated is determined automatically as that of
the machine on which you compile. Examples
+DA1.1
+DA867
+DA2.0
+DA2.0W
+DAportable

The first two examples generate code for the PA-RISC
1.1 architecture. The third example generates 32-bit
code for the PA-RISC 2.0 architecture. The fourth
example generates 64-bit code for the PA-RISC 2.0
architecture. The fifth example generates code
compatible across PA-RISC 1.1 and 2.0 workstations an
unsupported
Max_4
Frequent Advisor

Re: The linked output may not run on a PA 1.x system

Thanks to all of you, for your useful answers. But I have another question how do find out which is the default instruction set version in a machine?
Carlos Fernandez Riera
Honored Contributor

Re: The linked output may not run on a PA 1.x system

do:

model

search your model in /opt/langtools/lib/sched.models
unsupported
H.Merijn Brand (procura
Honored Contributor

Re: The linked output may not run on a PA 1.x system

Carlos, though he may find out this way what kind of CPU he has, there are more factors that the C compiler uses.

1. Whatever the architecture, HP C-ANSI-C creates 32bit object code by default. You have to force 64bit code with +DA2.0W
2. 64bit code cannot be used on 64bit architectures with a 32bit kernel
3. 64bit objects cannot be linked to 32bit objects, so if a project depends on a library that is only available in 32bit, do not even try to create 64bit objects.

Generally, default for all modern HP systems is hppa-2.0 (32bit). If you need the programs running on other machines with hppa-1.1 architectures (also see the /opt/langtools/lib/sched.models file: all PA7xxx are not 2.0), use +DAportable
Enjoy, Have FUN! H.Merijn
Max_4
Frequent Advisor

Re: The linked output may not run on a PA 1.x system

Hi again,

Thanks to all. Now there's something I just discovered. I moved my source code to another L1000 that's running 11i from a cold install not an upgrade, and compiled the same code and now the linker does not display a warning, just silently generates the executable. Now, I'm wondering if the extra warning provided by the linker in the system I've just upgraded to 11i has to do with the fact of the upgrade (not a cold install). Another thing maybe when I ran swinstall I should have had specified 'reinstall' when I installed the compilers, or maybe had done an swremove of the 11.0 versions of the compilers before swinstalling the 11i versions.

Thanks
Olav Baadsvik
Esteemed Contributor

Re: The linked output may not run on a PA 1.x system


Hi,

If you on the "cold-installed" machine did
not install any optional compilers you are
using the "bundled" c-compiler. It may
be that the "bundled" c-compiler by default
coompiles for PA1.1 in which case the
linker will not give this warning.

Regards
Olav