Re: Weak c++ symbols refresher needed
On Tue, Oct 07, 2014 at 04:23:54PM +0800, Chow Loong Jin wrote:
> On Tue, Oct 07, 2014 at 09:37:48AM +0200, Mathieu Malaterre wrote:
> > I am starring at bug #758572. Basically OP reports that `cmake` is
> > underlinked, which is a serious issue as per policy. However when
> > reading the details it appears that this is a c++ weak symbol (AFAIK
> > no weak default definition is available). This weak symbol is
> > generated by default by gcc when using part of the STL (See
> > #758572#13).
No, he shows that using a different libcurl makes ld.so barf. He
provides no evidence that the weak symbol is the reason for this.
> > Could someone please remind me in which case weak symbols (no weak
> > default definition) can trigger an undefined behavior at runtime ?
> I think UB is only triggered if something attempts to use the symbol. Is cmake pulling in
> another library that uses libpthread but doesn't link it in?
No, this is perfectly valid. Weak symbols are initialized to zero if no
definition is found.
Those who hate and fight must stop themselves -- otherwise it is not stopped.
-- Spock, "Day of the Dove", stardate unknown