This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch]: PR/44139 Exporting emutls symbols from a DLL broken on w32 targets
- From: Kai Tietz <ktietz70 at googlemail dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 20 May 2010 20:12:37 +0200
- Subject: [patch]: PR/44139 Exporting emutls symbols from a DLL broken on w32 targets
Hello,
This patch handles dllimport/dllexport semantics for TLS variables.
ChangeLog
PR/44139
* varasm.c (emutls_decl): Merge attributes to new decl.
Patch tested for i686-pc-mingw32, x86_64-pc-mingw32, and AIX (see bug-report).
Ok for apply to trunk and 4.5 branch?
Regards,
Kai
--
| (\_/) This is Bunny. Copy and paste
| (='.'=) Bunny into your signature to help
| (")_(") him gain world domination
Index: gcc/gcc/varasm.c
===================================================================
--- gcc.orig/gcc/varasm.c 2010-05-18 13:19:20.000000000 +0200
+++ gcc/gcc/varasm.c 2010-05-18 17:10:11.385445300 +0200
@@ -403,6 +403,8 @@ emutls_decl (tree decl)
int foo() { return i; }
__thread int i = 1;
in which I goes from external to locally defined and initialized. */
+ DECL_DLLIMPORT_P (to) = DECL_DLLIMPORT_P (decl);
+ DECL_ATTRIBUTES (to) = targetm.merge_decl_attributes (decl, to);
TREE_STATIC (to) = TREE_STATIC (decl);
TREE_USED (to) = TREE_USED (decl);