Re: 5.30/5.32 CompileMacro() inconsistency

From: Axel Naumann <Axel.Naumann_at_cern.ch>
Date: Tue, 24 Jan 2012 13:42:35 +0100


Hi Thiemo,

Most current Linux distros remove unneeded library dependencies by default; see the comment "They also have default options set to dead strip shared libs that don't resolve any symbols (equivalent to the MacOS X build changes described above)."

Cheers, Axel.

Thiemo Nagel wrote on 01/24/2012 12:25 PM:

> Dear Axel,
> 
> many thanks for the explanation!
> 
> On 01/24/2012 10:52 AM, Axel Naumann wrote:
>> The work-around is to load the library that defines
>> TestClass::DoSomething() before ACLiC-ing test3.C.
> 
> I would do that, if it wouldn't be for the "long standing issue of ACliC
> linking all previously created shared libs even when not needed".
> 
> It seems, that this was only resolved for MacOS X but not for Linux,
> quoting the release note:
> 
> "MacOS X:  Shared libs are also linked with the option
> "-Wl,-dead_strip_dylibs" which tells the linker to remove any shared lib
> which is not used to resolve any symbols (this should solve the long
> standing issue of ACliC linking all previously created shared libs even
> when not needed)."
> 
> http://root.cern.ch/root/html532/notes/release-notes.html
> 
> Cheers,
> Thiemo
> 
> 
>> Thiemo Nagel wrote on 01/24/2012 10:01 AM:

>>> Dear ROOTers,
>>>
>>> trying out ROOT v5.32, I've come across an inconsistency in
>>> TSystem::CompileMacro() w.r.t. v5.30.
>>>
>>> Take the following code (test3.C):
>>>
>>> class TestClass {
>>> public:
>>> void DoSomething();
>>> };
>>>
>>> void test3() {
>>> TestClass a;
>>> a.DoSomething();
>>> }
>>>
>>> With v5.30/03, this compiles nicely (no linking is done):
>>>
>>> root [1] gSystem->CompileMacro( "test3.C", "C" )
>>> (int)1
>>>
>>> But on 5.32 (svn-v5-32-00-patches, r42668), compilation fails at the
>>> linking stage. Of course, linking must fail because DoSomething() is
>>> not defined, but the old behaviour of CompileMacro() was to not even
>>> attempt to link when "c" is specified.
>>>
>>> [1] themis:~/computing> root
>>> root [0] gSystem->CompileMacro( "test3.C", "c" )
>>> Info in<TUnixSystem::ACLiC>: creating shared library
>>> /nfs/hicran/home/tnagel/private/computing/test3_C.so
>>> /nfs/hicran/home/tnagel/private/computing/test3_C_ACLiC_dict.o: In
>>> function `G__test3_C_ACLiC_dict_3018_0_1(G__value*, char const*,
>>> G__param*, int)':
>>> test3_C_ACLiC_dict.cxx:(.text+0xa2b): undefined reference to
>>> `TestClass::DoSomething()'
>>> /nfs/hicran/home/tnagel/private/computing/test3_C_ACLiC_dict.o: In
>>> function `test3()':
>>> test3_C_ACLiC_dict.cxx:(.text+0xa69): undefined reference to
>>> `TestClass::DoSomething()'
>>> collect2: ld returned 1 exit status
>>> Error in<ACLiC>: Compilation failed!
>>> (int)0
>>>
>>> Bottom line: Is this change in behaviour intended? In the release
>>> notes, I haven't found anything about it (and it breaks my code).
>>>
>>> Cheers!
>>> Thiemo
>>>

>
>

Received on Tue Jan 24 2012 - 13:42:40 CET

This archive was generated by hypermail 2.2.0 : Tue Jan 24 2012 - 17:50:01 CET