This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

(C++) patch to maybe_make_one_only


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]