Operating System - HP-UX
1826337 Members
4082 Online
109692 Solutions
New Discussion

linking really large applications

 
SOLVED
Go to solution
Thomas Matelich
Occasional Contributor

linking really large applications

Sorry if this is the wrong category to post to, didn't see any that screamed "software development." I'm working on HPUX 11i, and am unable to link my application when I build it with debug information. My linker ident says:
/usr/ccs/bin/ld:
$Revision: 92453-07 linker linker ctr0.o B.11.16.01 030316 $
$Revision: 1.85 $

The libraries/objects I'm trying to link are primarily built with g++.

The error I get is:
/usr/ccs/bin/ld: Cann't mmap 12 bytes
/usr/ccs/bin/ld: Not enough space

It always says 12 bytes, and the odd spelling of "Cann't" is not mine.

I've changed my TMPDIR and TEMPDIR to a directory that has multiple GB of free space, increased maxdsiz to 0xC000000 and maxssiz to 0xC000000, and tried running it with no other apps running besides daemons.

I ran with -t and -v sent to the linker and the last things it printed before dying were:
Loading /usr/lib/milli.a(div_const.o):
Searching library /usr/lib/milli.a

Any kernel params or linker options or patches you might have would be most appreciated.

Tom Matelich
1 REPLY 1
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: linking really large applications

You are running a rather old version of ld. You should also rollback the size of maxssiz to 64MB or so because both the data and stack come from the same quadrant in 32-bit land so large stacks (even if not used) reduce the available heap for dynamic allocation. Mmap cal also be limited by swapspace.

By best advice is to add -Wl,+nommap to your CC makefile line so that the linker does not use mmap. This will result in slower links but mmap should no longer be a problem.
If it ain't broke, I can fix that.