Solved

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

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Hyper-threading config in Solaris 6 130
how to check for shares on HP-UX 1 59
Unix Script: Loop over all days of a month 17 95
Linux "time" command output redirection 16 144
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 …
I have been running these systems for a few years now and I am just very happy with them.   I just wanted to share the manual that I have created for upgrades and other things.  Oooh yes! FreeBSD makes me happy (as a server), no maintenance and I al…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

813 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