[Darwin] Patch, take 2: enable linkonce support for Darwin

Jason Merrill jason@redhat.com
Mon Feb 2 18:47:00 GMT 2004


On Fri, 30 Jan 2004 17:06:17 -0800, Matt Austern <austern@apple.com> wrote:

> Here's the case where we use COMMON even on SUPPORTS_ONE_ONLY
> targets:
>   if (TREE_CODE (decl) == VAR_DECL
>        && (DECL_INITIAL (decl) == 0 || DECL_INITIAL (decl) ==
> error_mark_node))
>      DECL_COMMON (decl) = 1;
>    else if (SUPPORTS_ONE_ONLY)
>      ...
>
> I agree, it looks funny.  Unless someone can explain to me why this is a
> good idea, I'd be happy to exchange the order of those clauses so that we
> never use COMMON if we've got ONE_ONLY available.

I was doing it that way out of a philosophy of using a more advanced
feature only when necessary.  COMMON objects are merged by any Unix linker,
and they take up no space in the object file.  But if using COMMON is
problematic, I'm certainly not attached to it.

>>> Finally, one new user-visible feature: -fhidden-weak.  This flag makes
>>> the compiler automatically give hidden visibility to symbols that have
>>> vague linkage.

Sounds like this would block sharing of template instantiations and RTTI
information between an executable and a shared library, which would break a
lot of code.

Jason



More information about the Gcc mailing list