This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
(C++) patch to maybe_make_one_only
- To: gcc-patches at gcc dot gnu dot org
- Subject: (C++) patch to maybe_make_one_only
- From: Jason Merrill <jason at cygnus dot com>
- Date: Mon, 1 Nov 1999 23:34:23 -0800
This fixes a breakage on SCO and other strict SVR4 targets as described in
the comment below.
1999-11-01 Jason Merrill <jason@yorick.cygnus.com>
* decl2.c (maybe_make_one_only): Always make things comdat on
ELF targets, too.
Index: decl2.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/decl2.c,v
retrieving revision 1.274
diff -c -p -r1.274 decl2.c
*** decl2.c 1999/10/06 06:18:18 1.274
--- decl2.c 1999/11/02 07:31:52
*************** void
*** 2365,2373 ****
maybe_make_one_only (decl)
tree decl;
{
! /* This is not necessary on targets that support weak symbols, because
! the implicit instantiations will defer to the explicit one. */
! if (! supports_one_only () || SUPPORTS_WEAK)
return;
/* We can't set DECL_COMDAT on functions, or finish_file will think
--- 2365,2377 ----
maybe_make_one_only (decl)
tree decl;
{
! /* We used to say that this was not necessary on targets that support weak
! symbols, because the implicit instantiations will defer to the explicit
! one. However, that's not actually the case in SVR4; a strong definition
! after a weak one is an error. Also, not making explicit
! instantiations one_only means that we can end up with two copies of
! some template instantiations. */
! if (! supports_one_only ())
return;
/* We can't set DECL_COMDAT on functions, or finish_file will think