Solved

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

Posted on 1998-05-27
5
352 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
  • 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
nodeip 9 86
Tracking which app / process changes permission of a file in SOlaris 10 4 124
reinstall 1 85
Linux "time" command output redirection 16 184
Installing FreeBSD… FreeBSD is a darling of an operating system. The stability and usability make it a clear choice for servers and desktops (for the cunning). Savvy?  The Ports collection makes available every popular FOSS application and packag…
Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
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.

830 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