Operating System - HP-UX
1833883 Members
2101 Online
110063 Solutions
New Discussion

Re: aCC link problem on Hp_UX itanium

 
SOLVED
Go to solution
Satya_6
Frequent Advisor

aCC link problem on Hp_UX itanium

Hi group,

I am building an application linking some static libraries (my own .a libraries) and the standard shared libraires (-lc -lMrm -lXm -lXt -lXext -lGL -lGLU -lXmu -lX11 -lm -lpthread)

The source 'c' files are compiled (to get the archieves) using cc and linked using aCC.

I could build the executable successfully on a HP-UX 11.11 PA-RISC system, but I am getting the following errors while linking on the said itanium based system.

ld: The value 0xffffffffffd74fa8 does not fit when applying the relocation PLTOFF22 for symbol "sprintf" at offset 0x22 in section index 17 of file ../../hplib/libScript.a[vscrsyut.o]
ld: The value 0xffffffffffd74938 does not fit when applying the relocation PLTOFF22 for symbol "malloc" at offset 0xb2 in section index 17 of file ../../hplib/libScript.a[vscrsyut.o]

I am getting 56912 of such errors for both standard library symols like sprintf, fclose, malloc ... and also my own functions.

I am using A.05.36 version compiler.

Also I am using the following compile and link options.

-Aa -Ae +Z -O +Oprocelim +Ofastaccess +Ofast +eh +Z -z +d

-s -Wl,+s

TIA
satya
2 REPLIES 2
Mike Stroyan
Honored Contributor
Solution

Re: aCC link problem on Hp_UX itanium

The problem is that "+Ofast" includes "+Oshordata", and your program has too much data to use that option. You could add "+Oshortdata=0" after "+Ofast" to back away from that setting.
You could also install patch PHSS_27661, which is supposed to give a more meaningful warning when code is too big for the "+Oshortdata" option.
By the way, your list of libraries included -lc ahead of -lpthread. If you actually link with that list it will cause trouble because of getting pthread function stubs from libc. You should leave -lc off your link line and let cc or aCC add it implicitly at the end.
Satya_6
Frequent Advisor

Re: aCC link problem on Hp_UX itanium

Mike,

thanks for the reply. removing +Ofast did the trick.

but now I am facing one more problem, after getting the executable, if I run it is just getting killed.

I checked it in the debugger and it is not even coming to my main() function.

I tried removing all the optimisation options, I also tried by not linking the libpthread library but no luck.

it is giving the following trace.

#0 0x20000000789fecb0:0 in kill+0x30 () from /usr/lib/hpux32/libc.so.1
#1 0x20000000788fcf00:0 in raise+0x40 () from /usr/lib/hpux32/libc.so.1
#2 0x20000000789c1550:0 in abort+0x210 () from /usr/lib/hpux32/libc.so.1
#3 0x2000000078ab3450:0 in std::terminate+0x50 ()
from /usr/lib/hpux32/libCsup.so.1
#4 0x2000000078aac6d0:0 in __cxa_throw+0x130 ()
from /usr/lib/hpux32/libCsup.so.1
#5 0x2000000078c4b2e0:0 in std::ios_base::setf+0xe0 ()
from /usr/lib/hpux32/libstd_v2.so.1
#6 0x2000000078c48960:0 in std::ios_base::Init::Init+0x1c70 ()
from /usr/lib/hpux32/libstd_v2.so.1
#7 0x66105e0:0 in std::__sinit_NamedNodeMapImpl_cpp_+0x30 ()

TIA
satya