[patch, libgomp.fortran/testuite] fix uninstalled check problem on darwin8

IainS developer@sandoe-acoustics.co.uk
Mon Dec 8 14:08:00 GMT 2008


Hi,

ref: http://gcc.gnu.org/ml/fortran/2008-12/msg00084.html

This investigation arose because I could not get some of the libgomp  
tests to agree with "regress" when the compiler was tested un-installed.

there are (apparently) two unrelated problems.

[both issues are outside libgomp and fortran, but they do affect the  
test suite]

This applies equally to darwin 8 and 9
(although the symptoms/behavior of ld command is somewhat different  
between them).

=---=
1/
On both darwin8/9 the "___emutls_get_address" function is unresolved  
with default options.
This is in spite of the fact that the symbol  *is* defined in  
libgcc_s.1.dylib (and libgcc_eh.a)

(a)
  This might be a library order issue - since the tests do not use  
the gcc/gfortran driver - but gcc/xgcc with a hand-built command line.
I notice that -lgomp appears twice in any event.  Having said that, I  
couldn't resolve it by using the gfortran driver alone.

(b)
It is also possible that there's an issue with ld on darwin.
  libgcc_s.1 is not apparently parsed without forcing this by  
including a -lxxxx gd-options line

the workround *should* be to put -lgcc_s.1 in the gd-options line.

however, trying this.... this eventually revealed problem #2.

=---=
(2)
the version of ___emutls_get_address in libgcc_s.1.dylib is broken  
*when the processor is 64bit*.

That is, the code is m32 but the processor running it is, say, a G5  
or a Xeon.
when the processor is a G4 or Core Duo the libgcc_s.1.dylib   
___emutls_get_address is apparently OK.

(the compiler and libgcc have, in each case, been built with default  
native conditions on the target processor).

=====

test matrix [these are all with default build and test conditions]
___emutls_get_address is the only symbol that is resolved differently  
(observe using -Wl,-whyload)

say, for crayptr2.f90

OSVersion    library used          processor        result
========     ============   ==========   ====
darwin8.11    libgcc_s.1.dylib  PPC32bit(G4)  PASS
darwin8.11    libgcc_eh.a         PPC32bit(G4)  PASS

darwin8.11    libgcc_s.1.dylib  PPC64bit(G5)  FAIL
darwin8.11    libgcc_eh.a         PPC64bit(G5)  PASS

---

darwin9.5      libgcc_s.1.dylib  PPC32bit(G4)  PASS
darwin9.5      libgcc_eh.a         PPC32bit(G4)  PASS

darwin9.5      libgcc_s.1.dylib  Intel32bit(CD)  PASS
darwin9.5      libgcc_eh.a         Intel32bit(CD)  PASS

darwin9.5      libgcc_s.1.dylib  Intel64bit(Xe)  FAIL
darwin9.5      libgcc_eh.a         Intel64bit(Xe)  PASS

=======================================

I fully accept that the desideratum is to the fix the underlying  
problem ... and I'll try and progress that further (when time permits);

In the meantime.....  the workaround is to put -lgcc_eh in the gd- 
options line.

This is (AFAICT) harmless on 32 bit processors, and the static  
version of the code is apparently functional on the 64bit ones.

(On Darwin 9 using -static-libgcc also works ... because this causes  
libgcc_eh.a and libgcc.a to be used for the mainline.
However it still doesn't work on darwin8 because, for some reason,  
libgcc.a is not being loaded there.)

=======================================
test_summary output from 142537 (G5 D8 and Xeon D9)

http://gcc.gnu.org/ml/gcc-testresults/2008-12/msg00769.html
http://gcc.gnu.org/ml/gcc-testresults/2008-12/msg00770.html

======= DIFF

Index: libgomp/testsuite/libgomp.fortran/crayptr2.f90
===================================================================
--- libgomp/testsuite/libgomp.fortran/crayptr2.f90	(revision 142537)
+++ libgomp/testsuite/libgomp.fortran/crayptr2.f90	(working copy)
@@ -1,6 +1,7 @@
  ! { dg-do run }
  ! { dg-options "-fopenmp -fcray-pointer" }
-! { dg-options "-fopenmp -fcray-pointer -static-libgcc" { target *-*- 
darwin* } }
+! FIXME: work around __emutls_get_address problem in libgcc_s. 
1.dylib on 64bit processors
+! { dg-options "-fcray-pointer -lgcc_eh" { target *-*-darwin* } }

    use omp_lib
    integer :: a, b, c, d, p
Index: libgomp/testsuite/libgomp.fortran/pr32550.f90
===================================================================
--- libgomp/testsuite/libgomp.fortran/pr32550.f90	(revision 142537)
+++ libgomp/testsuite/libgomp.fortran/pr32550.f90	(working copy)
@@ -1,6 +1,7 @@
  ! PR fortran/32550
  ! { dg-do run }
-! { dg-options "-static-libgcc" { target *-*-darwin* } }
+! FIXME: work around __emutls_get_address problem in libgcc_s. 
1.dylib on 64bit processors
+! { dg-options "-fcray-pointer -lgcc_eh" { target *-*-darwin* } }

        integer, pointer, save :: ptr
        integer, target :: targ


=======
cheers,
Iain







More information about the Fortran mailing list