Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 1998-05-27
5
Medium Priority
?
358 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 140 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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

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

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 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…
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.
Suggested Courses
Course of the Month12 days, 23 hours left to enroll

971 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