Re: [gtk-list] Re: C++ Wrappers



Martynas Kunigelis <martynas@nomagic.com> writes:

> is that g++ produces and links the same code for every template
> instance with the same parameter in different compile units. Except
> for ELF format, where it places the code into a common section and
> duplicate code gets eliminated during link time.

Note that if you go to cygnus's web site (ftp.cygnus.com/pub/g++), and
grab the template repository patch (gcc-2.7.2-repo), and use it to
recompile gcc, you can "fix" the problem.

After the patch gcc will when invoked with the -frepo flag, during
compilation, store information about all the template signatures in a
given source file in a corresponding .rpo file.  Then it will use this
information during the link step to generate one copy of the needed
templates in each resulting object library, etc.

-- 
Rob



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]