This discussion is archived
2 Replies Latest reply: Jan 5, 2011 9:47 AM by 800173 RSS

SunStudio 11 fails to link with "Not enough space" error

800173 Newbie
Currently Being Moderated
We have a large application that links just fine on a linux platform of similar configuration (mem/swap) but fails to link using SunStudio 11 on Solaris 10 Sparc.
Beyond increasing swap/mem or change the way the thing is structured, is there anything else we can do?


ld: elf error: file hpgr/histogram/run/sunos5/libhistogram.a: elf_begin: Memory allocation error: vm stats: Not enough space
ld: elf error: file hpgr/histogram/run/sunos5/libhistogram.a: elf_begin: Memory allocation error: vm stats: Not enough space
ld: fatal: library -lhistogram: not found

compile flags:
C++ flags = -xO4 -Dsparc_sunos5 -Dsunos5 -Dsparc -D_REENTRANT -DNDEBUG ... more preprocessor symbols


linker opts:
-cflags /opt/SUNWspro/prod/bin/CC -xO4 -KPIC -w -features=no%conststrings -xarch=v8plus -DMWTHREAD_PHASE1 -DMWTHREAD_SAFE -mt -endcflags -pushlibpath -c++ -enddip /opt/SUNWspro/prod/bin/CC \
obj/sunos5_optimized/MainWin.o obj/sunos5_optimized/VgerApp.o obj/sunos5_optimized/GbsBuildVersion.o \
-xildoff -Qoption ld -z,now -
  • 1. Re: SunStudio 11 fails to link with "Not enough space" error
    Steve_Clamage Pro
    Currently Being Moderated
    There are two possibilities:

    1. Not enough memory (swap space) is available to link the program. Be sure you have more than 4GB swap space free before beginning the link step.

    2. The program's final address space exceeds the maximum size for a 32-bit program on Solaris. The limit varies from 3Gb to nearly 4Gb depending on the update level of Solaris 10 and the linker.

    If you have determined that #1 is not the problem, post your question in the Open Solaris linker discussion group.
    http://www.opensolaris.org/jive/forum.jspa?forumID=63
    Include the first line of file /etc/release in your post, which shows the Solaris update level. Example:
    % head -1 /etc/release
             Solaris 10 10/09 s10s_u8wos_08a SPARC 
    Someone will be able to help you determine whether you can fix the problem with a linker patch, or whether the program is just too large.

    If the program is not too far over the limit, there probably are some things you can do to reduce the size.

    If building the program as a 64-bit application is an option, that would eliminate any problems due to #2.
  • 2. Re: SunStudio 11 fails to link with "Not enough space" error
    800173 Newbie
    Currently Being Moderated
    Thanks Steve!

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points