[lttng-dev] [PATCH babeltrace] Fix: Static build on OS X

Michael Jeanson mjeanson at efficios.com
Wed May 4 17:13:29 UTC 2016


----- On May 4, 2016, at 11:57 AM, Mathieu Desnoyers mathieu.desnoyers at efficios.com wrote:

> ----- On May 4, 2016, at 10:54 AM, Michael Jeanson mjeanson at efficios.com wrote:
> 
>> The OS X linker fails to resolve common symbols in a static
>> library for some unexplained reason. Initializing the variables
>> to zero makes the symbol become uninitialized data and fixes
>> the linking.
> 
> We don't initialize static/global variables to 0/NULL ever in our
> coding style, presuming they are zeroed (similarly to the kernel
> coding style).
> 
> Why should we diverge from this coding style in this specific instance ?

I'm open to a better solution but after consulting with Jérémie and Philippe it's
the best we came up with to fix static compilation on OS X.

> Why not elsewhere ?

Seems to be related to an object file that contains "common" symbols and no other
directly referenced symbols other than a constructor which happens only with 
lib/babeltrace.o in the current tree.

> 
> Thanks,
> 
> Mathieu
>


More information about the lttng-dev mailing list