This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

templates with gcc 2.95.2 for sh4


Hello!

I am not sure I am posting this on the right board, that is I am not certain 
this is a generic gcc problem, or cross-gcc problem, so please direct me 
elsewhere if you know a more appropriate newsgroup.

I am trying to compile a program using gcc 2.95.2 compiler for sh4 platform 
(win32/cygwin host).

The problem is the way compiler handles C++ templates.  For some reason it 
inlines all functions even if they are not declared inline or even if they 
are not written inside the class definition.

GCC manual section 5.5 describes several ways of compiling templates.

First opton is to compile with -frepo option.  In this case compiler will 
generate *.rpo files with all template instantiations.  Than, collect2 will 
update *.rpo files and tell the compiler to rebuild any affected object 
files.

I can't however use this, for we don't call collect2, but use our own link 
script.

Second option is to comile code with -fno-implicit-templates to disable the 
implicit generation of template instances.  The programmer than required to 
explicitly instantiate all the templates used, but even if I do that, I get 
link errors.

I don't want to use #pragma interface and #pragma implementation tags 
because they are deprecated, but I tried them anyway and I get link errors.

Also tried -falt-external-templates, but could not get my code to link 
either.

Any ideas?



_________________________________________________________________
Join the world’s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com


------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]