Solved

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

Posted on 1998-05-27
5
349 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
Comment Utility
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
Comment Utility
Hello mbrutman, are you there?
0
 

Author Comment

by:mbrutman
Comment Utility
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
Comment Utility
Thanks BraveHeart for your help !!
0
 
LVL 3

Expert Comment

by:braveheart
Comment Utility
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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
When you do backups in the Solaris Operating System, the file system must be inactive. Otherwise, the output may be inconsistent. A file system is inactive when it's unmounted or it's write-locked by the operating system. Although the fssnap utility…
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…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now