From owner-freebsd-hackers Mon Feb 3 13:14:07 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id NAA20600 for hackers-outgoing; Mon, 3 Feb 1997 13:14:07 -0800 (PST) Received: from gargoyle.bazzle.com (gargoyle.bazzle.com [206.103.246.190]) by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id NAA20593 for ; Mon, 3 Feb 1997 13:13:57 -0800 (PST) Received: from gargoyle.bazzle.com (net2.bazzle.com [206.103.246.189]) by gargoyle.bazzle.com (8.8.4/8.6.12) with SMTP id QAA05056; Mon, 3 Feb 1997 16:13:35 -0500 (EST) Date: Mon, 3 Feb 1997 16:13:35 -0500 (EST) From: "Eric J. Chet" To: Bakul Shah cc: hackers@FreeBSD.ORG Subject: Re: g++, STL and -frepo on FreeBSD-2.2-Beta In-Reply-To: <199702021539.KAA21607@chai.plexuscom.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > > The -frepo patches don't work on our version of the g++ and > > ld. I assume ld is the problem. I haven't had the time to take a look > > to see what needs to be changed. The -frepo patch from Cygnus when > > applied, should create a set of *.ii one for each source file complied > > from g++. The *.ii files specify all templates that need to be > > instantiated before linking can take place. I believe there is a collect2 > > module that performs the instantiations task. > > I started with the *stock* gcc-2.7.2 distribution (+ 2.7.2-2.7.2.1 > diff), not the one in the FreeBSD source tree. > > The -frepo patch generates a .rpo file. In the test case I posted > this .rpo file contains lines like Oops, *.rpo files I use the EDG complier at work it generates *.ii files, same idea. > > On the other hand, the only thing you lose by not having the > > repository with our native compiler is executable size. The compiler > > will instantiated every template used in a object file and include it in > > that object file. Meaning, you can have duplicate template instantiations > > across different object files. > > This appears not to be the case. Are there any flags which make > this possible? Does libg++-2.7.1 have to be compiled with any > special flags or defines? > Works for me, -current g++ compiler. -- ejc@gargoyle: cat list1.cpp #include #include int array1 [] = { 9, 16, 36 }; int array2 [] = { 1, 4 }; int main () { list l1 (array1, array1 + 3); list l2 (array2, array2 + 2); list::iterator i1 = l1.begin (); l1.splice (i1, l2); list::iterator i2 = l1.begin (); while (i2 != l1.end ()) cout << *i2++ << endl; return 0; } ejc@gargoyle: g++ -o list1 list1.cpp ejc@gargoyle: ./list1 1 4 9 16 36 ejc@gargoyle: -- I have been using stl under our current compiler for a while without any problems, other than the known bugs. Just waiting for g++ 2.8.0 template member functions, static template member data, default template member parameters and sgi_stl. Life is good. Eric J. Chet - ejc@naserver1.cb.lucent.com - ejc@bazzle.com