This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Whopr versus weakref
- From: Richard Guenther <rguenther at suse dot de>
- To: Jan Hubicka <hubicka at ucw dot cz>
- Cc: gcc-patches at gcc dot gnu dot org, dnovillo at google dot com
- Date: Wed, 21 Apr 2010 11:03:44 +0200 (CEST)
- Subject: Re: Whopr versus weakref
- References: <20100420205113.GG9096@kam.mff.cuni.cz>
On Tue, 20 Apr 2010, Jan Hubicka wrote:
> Hi,
> buiding whopr I get error on weakref alias in pthread library. We must bring
> functions public for ltrans split yet weakrefs are defined for static variables
> only. I am not sure what to do here, but I think it is safe to weaken the
> check for ltrans so we always end up with weak reference.
>
> Or better ideas?
Can't we avoid bringing these functions public by putting them into
a proper partition? Otherwise we risk breaking code when we suddenly
change symbol linkage, no? Think of using whopr to do partial
linking of {a.c, b.c} -> x.o and {c.c, d.c} -> y.o and then linking
x.o and y.o.
Richard.
> With all the patches I can now build working DLV that works comparably
> well to LTO version.
>
> Bootstrapped/regtested x86_64-linux, OK?
>
> Honza
>
> * varasm.c (assemble_alias): Do not worry about public weakrefs
> in whopr.
> Index: varasm.c
> ===================================================================
> --- varasm.c (revision 158563)
> +++ varasm.c (working copy)
> @@ -5749,7 +5749,7 @@ assemble_alias (tree decl, tree target)
> TREE_CHAIN (alias) = target;
> #endif
> }
> - if (TREE_PUBLIC (decl))
> + if (TREE_PUBLIC (decl) && !flag_ltrans)
> error ("weakref %q+D must have static linkage", decl);
> }
> else
>
>
--
Richard Guenther <rguenther@suse.de>
Novell / SUSE Labs
SUSE LINUX Products GmbH - Nuernberg - AG Nuernberg - HRB 16746 - GF: Markus Rex