Re: Re: ROOT 5.22 with gcc 4.4 (.1)

From: Fons Rademakers <Fons.Rademakers_at_cern.ch>
Date: Mon, 17 Aug 2009 18:39:58 +0200


Hi Roel,

   this R__EXPLICIT_FUNCTION_INSTANTIATION is needed to work around a bug in the -O2 mode of gcc 4.4.0. The bug was reported to the developers, but obviously not yet fixed in the 4.4.1 release. I'll update to Module.mk to also include the 4.4.1 release. Not that e.g. with -O there is no problem.

Cheers, Fons.

Roel Aaij wrote:

> Hi All,
> 
> I ran into the same problem as Christophe today, using gcc 4.4.1. I saw that 
> the in io/io/Module.mk, R__EXPLICIT_FUNCTION_INSTANTIATION is only defined for 
> gcc 4.4.0, once I changed it to 4.4.1, it worked. I don't know how to fix this 
> for all gcc 4.4 versions.
> 
> Greetings, Roel Aaij
> 

>> Hi Christophe,
>>
>> You are correct and this has been fixed in the SVN repository (and
>> released as part of
>> v5.24/00).
>>
>> Cheers,
>> Philippe.
>>
>> Christophe Saout wrote:
>>> Hi guys,
>>>
>>> referring to this thread (which I googled)
>>>
>>> http://root.cern.ch/root/roottalk/roottalk09/0353.html
>>>
>>> I wanted to compile ROOT on my notebook, it failed for the same reason,
>>> and I looked at it.
>>>
>>> I believe this is actually a bug in ROOT. The compile has no way of
>>> knowing that you intend to use the <T = char **> specialization of
>>> TStreamerInfo::ReadBuffer outside of the cxx file. What is happening
>>> with this particular compiler constellation is that gcc simply decided
>>> to not emit an out-of-line copy of this method but to inline it at the
>>> only place it is called (in terms of what gcc is seeing in the cxx
>>> file). Hence a reference to this method from another cxx file, which
>>> doesn't see the implemenation fails.
>>>
>>> I added an explicit instatiation:
>>>
>>> template
>>> Int_t TStreamerInfo::ReadBuffer(TBuffer &b, char **const &arr, Int_t
>>> first, Int_t narr, Int_t eoffset, Int_t arrayMode);
>>>
>>> to the file to let gcc know there are other users of ReadBuffer<char**>
>>> and then it compiles. (which I guess should also be done for the other
>>> possible types)
>>>
>>> I believe one is not supposed to rely on the compiler emitting instances
>>> of templates into the object file when there is only an implicit
>>> instantiation somewhere.
>>>
>>> Christophe

>
-- 
Org:    CERN, European Laboratory for Particle Physics.
Mail:   1211 Geneve 23, Switzerland
E-Mail: Fons.Rademakers_at_cern.ch              Phone: +41 22 7679248
WWW:    http://fons.rademakers.org           Fax:   +41 22 7669640
Received on Mon Aug 17 2009 - 18:40:02 CEST

This archive was generated by hypermail 2.2.0 : Mon Aug 17 2009 - 23:50:01 CEST