This is the mail archive of the 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]
Other format: [Raw text]

Re: emulating tls for systems without

On Wed, Sep 20, 2006 at 06:59:10PM -0700, Richard Henderson wrote:
> Jakub, I've finished up that WIP patch you sent me this morning.

Thanks.  I have added a hack on top of this:

--- gcc/config/i386/i386.c.xx	2006-09-20 10:12:29.000000000 +0200
+++ gcc/config/i386/i386.c	2006-09-21 08:44:58.000000000 +0200
@@ -1267,7 +1267,7 @@ static section *x86_64_elf_select_sectio

 #ifdef HAVE_AS_TLS
-#define TARGET_HAVE_TLS true
+#define TARGET_HAVE_TLS false
 #define TARGET_CANNOT_FORCE_CONST_MEM ix86_cannot_force_const_mem

so that I can test it on x86-64 linux and tried to build it with target
libs.  One thing is that libgcc_eh.a wasn't using WEAK symbols for
pthread_*, fixed by including two extra headers (that's exactly what
unwind-dw2.c does too):

	* emutls.c: Include coretypes.h and tm.h.

--- gcc/emutls.c.jj	2006-09-21 08:44:17.000000000 +0200
+++ gcc/emutls.c	2006-09-21 10:03:54.000000000 +0200
@@ -30,6 +30,8 @@ Software Foundation, 51 Franklin Street,
 #include "tconfig.h"
 #include "tsystem.h"
+#include "coretypes.h"
+#include "tm.h"
 #include "gthr.h"
 typedef unsigned int word __attribute__((mode(word)));

But the next problem is that doesn't link, as e.g.
__emutls_v.tid_cache isn't defined anywhere.  Small testcase

/* { dg-options "-O2" } */
static __thread int i;
int foo (void)
  return i;

__emutls_v.i is optimized out.  Guess we need some cgraph munging, but not
sure what exactly.


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