On Fri, Mar 26, 2010 at 11:21:27AM -0700, Neil Vachharajani wrote:
> Thanks for re-raising this issue.  I'm certainly interested in
> applying the patch.  I figured I had missed the boat for GCC 4.5 and
> was going to re-re-raise the issue for 4.6.  I someone approves the
> patch, I'll apply it once we re-enter Stage 1.
> 
> Cheers,
> Neil
> 
> On Fri, Mar 26, 2...@10:57 AM, Jack Howarth <howa...@bromo.med.uc.edu> wrote:
> >
> >   This issue of reapplying the patch...
> >
> > http://gcc.gnu.org/ml/gcc-patches/2008-12/msg00892.html
> >
> > to eliminate a race condition in indirect call value profiling
> > came up earlier this year after darwin was depreciated as a
> > primary target...
> >
> > http://gcc.gnu.org/ml/gcc-patches/2009-09/msg01545.html
> >
> > Now that we have a libgcc_ext on darwin to provide the additional
> > tls related symbols, this patch shouldn't be an issue. I haven't
> > been able to find a PR for this problem. Has it gone latent or
> > is it just that no one is interested in the issue?
> >        Jack
> 
> 
> 
> --
> Neil Vachharajani
> Google
> 650-214-1804

Neil,
   I tested your original patch adjusted for current gcc trunk against
x86_64-apple-darwin10 last night...

Index: gcc/tree-profile.c
===================================================================
--- gcc/tree-profile.c  (revision 157765)
+++ gcc/tree-profile.c  (working copy)
@@ -82,6 +82,7 @@
   TREE_PUBLIC (ic_void_ptr_var) = 0;
   DECL_ARTIFICIAL (ic_void_ptr_var) = 1;
   DECL_INITIAL (ic_void_ptr_var) = NULL;
+  DECL_TLS_MODEL (ic_void_ptr_var) = decl_default_tls_model (ic_void_ptr_var);
   varpool_finalize_decl (ic_void_ptr_var);
 
   gcov_type_ptr = build_pointer_type (get_gcov_type ());
@@ -93,6 +94,7 @@
   TREE_PUBLIC (ic_gcov_type_ptr_var) = 0;
   DECL_ARTIFICIAL (ic_gcov_type_ptr_var) = 1;
   DECL_INITIAL (ic_gcov_type_ptr_var) = NULL;
+  DECL_TLS_MODEL (ic_gcov_type_ptr_var) = decl_default_tls_model 
(ic_gcov_type_ptr_var);
   varpool_finalize_decl (ic_gcov_type_ptr_var);
 }
 
and found that we still end up with failed testcases from unresolved symbols. 
Darwin
doesn't have assembler level tls support and uses emutls. Thus the darwin build 
only adds
-DHAVE_CC_TLS but not -DUSE_TLS (like on linux). I am thinking that we need to 
also add...

Index: libgcc/config.host
===================================================================
--- libgcc/config.host  (revision 157779)
+++ libgcc/config.host  (working copy)
@@ -597,6 +597,12 @@
 esac
 
 case ${host} in
+*-*-darwin*)
+       tmake_file="${tmake_file} t-emutls"
+       ;;
+esac
+
+case ${host} in
 i[34567]86-*-darwin* | x86_64-*-darwin* | \
   i[34567]86-*-kfreebsd*-gnu | x86_64-*-kfreebsd*-gnu | \
   i[34567]86-*-linux* | x86_64-*-linux* | \
--- /dev/null   2010-03-27 14:42:18.000000000 -0400
+++ libgcc/config/t-emutls      2010-03-27 14:24:03.000000000 -0400
@@ -0,0 +1,2 @@
+# Use thread-local storage
+INTERNAL_CFLAGS += -DUSE_EMUTLS

to have -D_USE_EMUTLS passed as well. What other architectures besides
darwin use emutls? Those may well have the same problem.
                    Jack

Reply via email to