Date: Mon, 3 Feb 1997 16:13:35 -0500 (EST) From: "Eric J. Chet" <ejc@gargoyle.bazzle.com> To: Bakul Shah <bakul@torrentnet.com> Cc: hackers@FreeBSD.ORG Subject: Re: g++, STL and -frepo on FreeBSD-2.2-Beta Message-ID: <Pine.BSF.3.95.970203155742.4919A-100000@gargoyle.bazzle.com> In-Reply-To: <199702021539.KAA21607@chai.plexuscom.com>
next in thread | previous in thread | raw e-mail | index | archive | help
> > 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 <iostream.h>
#include <stl.h>
int array1 [] = { 9, 16, 36 };
int array2 [] = { 1, 4 };
int main ()
{
list<int> l1 (array1, array1 + 3);
list<int> l2 (array2, array2 + 2);
list<int>::iterator i1 = l1.begin ();
l1.splice (i1, l2);
list<int>::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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.95.970203155742.4919A-100000>
