]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR target/40068 (GCC fails to apply dllexport attribute to typeinfo.)
authorKai Tietz <ktietz@redhat.com>
Tue, 7 Feb 2012 11:48:34 +0000 (12:48 +0100)
committerKai Tietz <ktietz@gcc.gnu.org>
Tue, 7 Feb 2012 11:48:34 +0000 (12:48 +0100)
2012-02-07  Kai Tietz  <ktietz@redhat.com>
            Dave Korn  <dave.korn.cygwin@gmail.com>

        PR target/40068
        * config/i386/winnt-cxx.c (i386_pe_adjust_class_at_definition):
        Take care that typinfo gets dllexport-attribute.

Co-Authored-By: Dave Korn <dave.korn.cygwin@gmail.com>
From-SVN: r183965

gcc/ChangeLog
gcc/config/i386/winnt-cxx.c

index 921f4190a912c025d496cf6fd0cb01491ddec559..92e558b9a62a65e3167a0575a1e957631537245b 100644 (file)
@@ -1,3 +1,10 @@
+2012-02-07  Kai Tietz  <ktietz@redhat.com>
+            Dave Korn  <dave.korn.cygwin@gmail.com>
+
+       PR target/40068
+       * config/i386/winnt-cxx.c (i386_pe_adjust_class_at_definition):
+       Take care that typinfo gets dllexport-attribute.
+
 2012-01-31  Matthew Gretton-Dann  <matthew.gretton-dann@arm.com>
 
        Backport from mainline:
index 48518adc765f5e44104304b65a82ff78240eb9b4..0e0e8056aad3d63fe6483d5028b80f5da00ac5c7 100644 (file)
@@ -101,6 +101,20 @@ i386_pe_adjust_class_at_definition (tree t)
  
   if (lookup_attribute ("dllexport", TYPE_ATTRIBUTES (t)) != NULL_TREE)
     {
+      tree tmv = TYPE_MAIN_VARIANT (t);
+
+      /* Make sure that we set dllexport attribute to typeinfo's
+        base declaration, as otherwise it would fail to be exported as
+        it isn't a class-member.  */
+      if (tmv != NULL_TREE
+         && CLASSTYPE_TYPEINFO_VAR (tmv) != NULL_TREE)
+       {
+         tree na, ti_decl = CLASSTYPE_TYPEINFO_VAR (tmv);
+         na = tree_cons (get_identifier ("dllexport"), NULL_TREE,
+                         NULL_TREE);
+         decl_attributes (&ti_decl, na, 0);
+       }
+
       /* Check static VAR_DECL's.  */
       for (member = TYPE_FIELDS (t); member; member = TREE_CHAIN (member))
        if (TREE_CODE (member) == VAR_DECL)