gcc 3.4, explicit template instantiations and STL

Alain Roy roy@cs.wisc.edu
Tue Nov 16 20:14:00 GMT 2004


At 05:15 PM 11/16/2004 +0000, Nathan Sidwell wrote:
>Alain Roy wrote:
>>I'm writing a library that I would like to be able to compile with 
>>multiple versions of gcc on multiple platforms. The library is used by a 
>>larger project, and we need portability. Using the latest gcc is not 
>>always an option, so we live with multiple versions. I can't change this.
>>My library contains STL.
>>To avoid code bloat, it uses explicit template instantiation.
>What platform(s) are you targetting? With ELF, implicit instantiations will
>make the object files larger, but only one instantiation will actually
>be copied to the executable.  (One per shared library, if those are
>involved.)

At the moment:

Solaris 8, 9 (and maybe 10)
IRIX 6.5
Recent versions of Linux
Tru64 5.1
Mac OS X
AIX 5.2
HPUX 11

ELF isn't used on all of those platforms.

>-frepo might help you too. It does the leg work of working out which
>things to explicitly instantiate.

I'll check it out--thanks.

-alain




More information about the Gcc-help mailing list