On 10 Dec 2008, at 19:46, Jack Howarth wrote:


    Since your objections are entirely related to the testsuite when
FSF has not been installed,

hm. I'm not entirely sure that's the whole case... although that was the trigger for this chain of investigation.

I'm also wondering what instructions one gives to the developer about how code using TLS should be built/delivered.

perhaps it would be more productive to see
if the testsuite in libgomp can be reworked to handle darwin when
gcc is uninstalled.

the patch below gives the same result on D9 (checking is still running on D8) as the change I posted earlier (for libgomp only) obviously a similar thing needs to be done other places where TLS is used.

Index: libgomp/testsuite/lib/libgomp.exp
===================================================================
--- libgomp/testsuite/lib/libgomp.exp   (revision 142648)
+++ libgomp/testsuite/lib/libgomp.exp   (working copy)
@@ -113,9 +113,15 @@
            if { "$mldir" == "." } {
              continue
            }
- if { [llength [glob -nocomplain ${gccdir}/${mldir}/ libgcc_s*.so.*]] >= 1 } {
-             append always_ld_library_path ":${gccdir}/${mldir}"
-           }
+               if [istarget *-*-darwin*] {
+ if { [llength [glob -nocomplain ${gccdir}/${mldir}/ libgcc_s*.dylib]] >= 1 } {
+                               append always_ld_library_path 
":${gccdir}/${mldir}"
+                       }
+               } else {
+ if { [llength [glob -nocomplain ${gccdir}/${mldir}/ libgcc_s*.so.*]] >= 1 } {
+                               append always_ld_library_path 
":${gccdir}/${mldir}"
+                       }
+               }
          }
        }
     }
@@ -127,7 +133,6 @@
         lappend ALWAYS_CFLAGS "ldflags=-L${blddir}/.libs"
     }
     lappend ALWAYS_CFLAGS "additional_flags=-I${srcdir}/.."
-    lappend ALWAYS_CFLAGS "ldflags=-lgomp"

     # We use atomic operations in the testcases to validate results.
     if { ([istarget i?86-*-*] || [istarget x86_64-*-*])
@@ -135,10 +140,6 @@
        lappend ALWAYS_CFLAGS "additional_flags=-march=i486"
     }

-    if [istarget *-*-darwin*] {
-       lappend ALWAYS_CFLAGS "additional_flags=-shared-libgcc"
-    }
-
     if [istarget sparc*-*-*] {
        lappend ALWAYS_CFLAGS "additional_flags=-mcpu=v9"
     }
@@ -153,6 +154,15 @@

     # And, gee, turn on OpenMP.
     lappend ALWAYS_CFLAGS "additional_flags=-fopenmp"
+       
+    if [istarget *-*-darwin*] {
+         #lappend ALWAYS_CFLAGS "additional_flags=-shared-libgcc"
+         # we need to use the unversioned libgcc to pick up the TLS emulation
+      lappend ALWAYS_CFLAGS "additional_flags=-lgcc_s.1"
+    } else {
+         # it's not clear who needs this ... -fopenmp should do this no?
+      lappend ALWAYS_CFLAGS "ldflags=-lgomp"
+       }
 }

 #

Reply via email to