This is the mail archive of the gcc-patches@gcc.gnu.org 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



> -----Original Message-----
> From: gcc-patches-owner@gcc.gnu.org 
> [mailto:gcc-patches-owner@gcc.gnu.org] On Behalf Of Danny Smith
> > 
> > It would be good if some windows or other similarly tls
> > deprived systems could test to see if openmp threadprivate 
> > tests work as expected.
> > 
> 
> Hello,
> I applied your patch and tested using the libgomp testsuite on
> i686-pc-mingw32.
> I have modified  specs to add -mthread  -lpthread.a  when 
> compiling with
> -fopenmp.
> The former will pull in libmingwthrd and so make gthread_active_p()
> return true.  The latter provides a pthread
> emulation libraray from the pthread-win32 project for the rest of the
> -fopenmp interface.
> 
> In fortran, i ran into library problem with 
> ialias (foo) expansion,  with undefined references to:
> 
> 	 	`gomp_ialias_omp_set_dynamic'
> 		`gomp_ialias_omp_unset_nest_lock'
> 		`gomp_ialias_omp_unset_lock'
>                    	`gomp_ialias_omp_set_nest_lock'
> 		`gomp_ialias_omp_set_lock'
> 		`gomp_ialias_omp_destroy_nest_lock'
> 		`gomp_ialias_omp_destroy_lock'
> 		`gomp_ialias_omp_init_nest_lock'
> 		`gomp_ialias_omp_init_lock'
> 
> 
>

The libgomp fortran problem with internal alias was due to
USER_LABEL_PREFIX confusion.  The following fixes that.

With below installed all the fortran libgomp failures are of
the form

/develop/svn/trunk/gcc/libgomp/testsuite/libgomp.fortran/omp_parse3.f90:
65:
undefined reference to `__emutls_v.z.967.1517'

as per Jakub's observation

Danny

Index: fortran.c
===================================================================
--- fortran.c	(revision 117095)
+++ fortran.c	(working copy)
@@ -33,8 +33,11 @@
 
 #ifdef HAVE_ATTRIBUTE_ALIAS
 /* Use internal aliases if possible.  */
+#define ULP	STR1(__USER_LABEL_PREFIX__)
+#define STR1(x)	STR2(x)
+#define STR2(x)	#x
 # define ialias_redirect(fn) \
-  extern __typeof (fn) fn __asm__ ("gomp_ialias_" #fn)
attribute_hidden;
+  extern __typeof (fn) fn __asm__ (ULP "gomp_ialias_" #fn)
attribute_hidden;
 ialias_redirect (omp_init_lock)
 ialias_redirect (omp_init_nest_lock)
 ialias_redirect (omp_destroy_lock)
Index: acinclude.m4
===================================================================
--- acinclude.m4	(revision 117095)
+++ acinclude.m4	(working copy)
@@ -47,11 +47,8 @@
   AC_CACHE_CHECK([whether the target supports symbol aliases],
 		 have_attribute_alias, [
   AC_TRY_LINK([
-#define ULP	STR1(__USER_LABEL_PREFIX__)
-#define STR1(x)	STR2(x)
-#define STR2(x)	#x
 void foo(void) { }
-extern void bar(void) __attribute__((alias(ULP "foo")));],
+extern void bar(void) __attribute__((alias("foo")));],
     [bar();], have_attribute_alias=yes, have_attribute_alias=no)])
   if test $have_attribute_alias = yes; then
     AC_DEFINE(HAVE_ATTRIBUTE_ALIAS, 1,


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