Solved

xlC 3.1.4  linker crashes on AIX4.2.1 when linking  C++ Templates

Posted on 1998-05-27
5
353 Views
Last Modified: 2008-03-17
I coded my  C++ code that includes lots of Templates and uses Roguewave to include the template implementation file inside the header. This causes compile-time template instantiation. While linking I get lots of duplicate warning the temparary files are huge ( 300M ) and finally the linker crashes with a segmentation fault.
A small test links OK the problem accures with relatively big applications.
Link flags are:
xlC_r -w -Wl,-bh:5 -Wl,-bnoobjreorder  -OBJ/AIX/CreditSwiss OBJ/AIX/CrInput.o  OBJ/AIX/CrSegSetInfo.o OBJ/AIX/CrSegmentsDB.o OBJ/AIX/CrMain.o OBJ/AIX/CrSegmentInfo.o OBJ/AIX/CrCollection.o OBJ/AIX/CrApplication.o OBJ/AIX/CrReqCBEvent.o OBJ/AIX/stub.o OBJ/AIX/CrOutput.o  OBJ/AIX/CrTopNNewDataEvent.o OBJ/AIX/C
rWriteToFile.o OBJ/AIX/CrHeader.o OBJ/AIX/CrConv.o OBJ/AIX/CrAddNewProbeEvent.o -L/usr/nms/lib/AIX -L/usr/local/lib  -L/usr/local/rogue/workspaces/AIX41/CSET31
/15s/lib -lDclServer -lcp_ipc -ldclWrapper -ldcl -lmpoller -lpoller -lsegments -
lsadb -lsasnmp -lcmu -lrequest -lPst -lPdtServer -lPdtIpc -lAgents -lObjects -lP
dtInfo -lPdtWrapper -lGenCpp -lRequests -lAgents -lObjects -lsnmp_wrapper -lprox
y -lgds -lbds -lrefcount -lnix -lnixrmon -lutil -lDnl -ldnl -linfile -lerrhandle
r -leventmgr -leventcb -lnixgenevent -ltracker -ldebug -lrestart -lnix -lerr -lm -lthr15s -lnet15s -ltls15s -lstd15s /usr/lib/libdl.a -lnet15s -lthr15s -ltls15s -lstd15s -lC_r -lpthreads
0
Comment
Question by:mbrutman
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 3

Accepted Solution

by:
braveheart earned 70 total points
ID: 2007279
If the linker crashes with a seg fault, then the linker has a bug. Report it to IBM or your supplier. They may be able so provide a patch, or suggest a workaround. They should be your first port of call. Failing that, try the comp.unix.aix newsgroup. Better still, contact your supplier but tell them that if they don't come up with a solution, fast, you will have to go to the newsgroups to ask, thereby publicising this shortcoming. This usually speeds up their response.
0
 
LVL 3

Expert Comment

by:braveheart
ID: 2007280
Hello mbrutman, are you there?
0
 

Author Comment

by:mbrutman
ID: 2007281
I have to change my code to Template link-time Resolution. It seems that xlC does not handle Template compile-time instantiation when you link several hundred object files. It creates too many duplicates and the system is running out of resourse. It crashes with an executable that is 300M of code.
Link-Time is also a nightmare. We had to customize some of our STL files ( like algoritm ) to resolve at compile time while others are link-time. Beware of Templates with xlC !!!
0
 

Author Comment

by:mbrutman
ID: 2007282
Thanks BraveHeart for your help !!
0
 
LVL 3

Expert Comment

by:braveheart
ID: 2007283
Good old C++ tends to suck in the rest of the universe unless you are very careful. Good luck and thanks for the points.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
llcommand 6 110
reinstall 1 96
replace column/record content in a *csv file based on a regular expression 6 86
awk sed variable in file 3 109
Hello fellow BSD lovers, I've created a patch process for patching openjdk6 for BSD (FreeBSD specifically), although I tried to keep all BSD versions in mind when creating my patch. Welcome to OpenJDK6 on BSD First let me start with a little …
This tech tip describes how to install the Solaris Operating System from a tape backup that was created using the Solaris flash archive utility. I have used this procedure on the Solaris 8 and 9 OS, and it shoudl also work well on the Solaris 10 rel…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question