re PR libstdc++/54314 (undefined references to 'construction vtable for std::ostream...
authorJason Merrill <jason@redhat.com>
Tue, 29 Jan 2013 17:24:51 +0000 (12:24 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Tue, 29 Jan 2013 17:24:51 +0000 (12:24 -0500)
PR libstdc++/54314
gcc/
* varasm.c (default_assemble_visibility): Don't warn about
visibility on artificial decls.
gcc/cp/
* class.c (build_ctor_vtbl_group): Give construction vtables
hidden visibility.
libstdc++-v3/
* config/abi/pre/gnu.ver: Don't export construction vtables.
* config/abi/pre/gnu-versioned-namespace.ver: Likewise.

From-SVN: r195550

gcc/ChangeLog
gcc/cp/ChangeLog
gcc/cp/class.c
gcc/varasm.c
libstdc++-v3/ChangeLog
libstdc++-v3/config/abi/pre/gnu-versioned-namespace.ver
libstdc++-v3/config/abi/pre/gnu.ver

index c9273e4881adafadfb08b3f82d9550d814c5c4e2..42cb6248e55b33c94a1992636e4b6cee2f9bb06d 100644 (file)
@@ -1,3 +1,9 @@
+2013-01-29  Jason Merrill  <jason@redhat.com>
+
+       PR libstdc++/54314
+       * varasm.c (default_assemble_visibility): Don't warn about
+       visibility on artificial decls.
+
 2013-01-29  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/56113
index 1b640ff33097e232943f22376b9d905bae248c0d..65157e1dadfd9885ea71393c0e68241edcb7d2f9 100644 (file)
@@ -1,3 +1,9 @@
+2013-01-29  Jason Merrill  <jason@redhat.com>
+
+       PR libstdc++/54314
+       * class.c (build_ctor_vtbl_group): Give construction vtables
+       hidden visibility.
+
 2013-01-25  Jason Merrill  <jason@redhat.com>
 
        PR c++/56095
index 605dd16c7115dd28baf72944cd06822120425bdd..38339f22b69e43fa8d98d913622c41e736aae8df 100644 (file)
@@ -8356,6 +8356,12 @@ build_ctor_vtbl_group (tree binfo, tree t)
      construction vtable group.  */
   vtbl = build_vtable (t, id, ptr_type_node);
   DECL_CONSTRUCTION_VTABLE_P (vtbl) = 1;
+  /* Don't export construction vtables from shared libraries.  Even on
+     targets that don't support hidden visibility, this tells
+     can_refer_decl_in_current_unit_p not to assume that it's safe to
+     access from a different compilation unit (bz 54314).  */
+  DECL_VISIBILITY (vtbl) = VISIBILITY_HIDDEN;
+  DECL_VISIBILITY_SPECIFIED (vtbl) = true;
 
   v = NULL;
   accumulate_vtbl_inits (binfo, TYPE_BINFO (TREE_TYPE (binfo)),
index 6b941badd89d638b0fcad5cbfcde955484aff26d..66481031022c48635db28d05f17d4b70439a112d 100644 (file)
@@ -5788,8 +5788,9 @@ default_assemble_visibility (tree decl ATTRIBUTE_UNUSED,
   assemble_name (asm_out_file, name);
   fprintf (asm_out_file, "\n");
 #else
-  warning (OPT_Wattributes, "visibility attribute not supported "
-          "in this configuration; ignored");
+  if (!DECL_ARTIFICIAL (decl))
+    warning (OPT_Wattributes, "visibility attribute not supported "
+            "in this configuration; ignored");
 #endif
 }
 
index c18641364d8b930eccd45ec1db76b9c3726d92b9..62bf2e215fa5c28950a5b3766d68dda290ec5f92 100644 (file)
@@ -1,3 +1,9 @@
+2013-01-29  Jason Merrill  <jason@redhat.com>
+
+       PR libstdc++/54314
+       * config/abi/pre/gnu.ver: Don't export construction vtables.
+       * config/abi/pre/gnu-versioned-namespace.ver: Likewise.
+
 2013-01-28  Jonathan Wakely  <jwakely.gcc@gmail.com>
 
        PR libstdc++/56112
index d13c05926fa84cdaf5e573b0ed6500318ada26fb..7513e12fe13fea10f830a898de5a57f1b1653a63 100644 (file)
@@ -55,9 +55,6 @@ GLIBCXX_7.0 {
     # function-scope static objects requires a guard variable.
     _ZGVNSt*;
 
-    # construction vtable
-    _ZTCNSt*;
-
     # VTT structure
     _ZTTNSt*;
 
index 35b4c44de9d15047b4e59b19cefb111161224006..71be1c30a279804b94a2d533be722f3b932b6265 100644 (file)
@@ -1336,9 +1336,6 @@ GLIBCXX_3.4.18 {
       std::random_device::*;
     };
 
-    # construction vtable
-    _ZTCSt*;
-
     # std::this_thread::__sleep_for
     _ZNSt11this_thread11__sleep_for*;