This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Darwin] Patch, take 2: enable linkonce support for Darwin
- From: Jason Merrill <jason at redhat dot com>
- To: Matt Austern <austern at apple dot com>
- Cc: Richard Henderson <rth at redhat dot com>, gcc at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Mon, 02 Feb 2004 13:47:19 -0500
- Subject: Re: [Darwin] Patch, take 2: enable linkonce support for Darwin
- References: <24F20E06-5275-11D8-AAA9-000A95BCF344@apple.com><3D92B8AD-5342-11D8-87CA-000A95BCF344@apple.com><20040131000123.GA18142@redhat.com><AC42CB55-5389-11D8-87CA-000A95BCF344@apple.com>
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