[patch, darwin] repost of a patch to make -static-libgfortan work.

Jack Howarth howarth@bromo.med.uc.edu
Sat Jan 17 04:56:00 GMT 2009


   Iain's patch from...

http://gcc.gnu.org/ml/gcc-patches/2008-12/msg01328.html

has been approved...

http://gcc.gnu.org/ml/gcc-patches/2009-01/msg00356.html
http://gcc.gnu.org/ml/gcc-patches/2009-01/msg00382.html

I have created a clean diff against current gcc trunk for
it and added the missing changelog. It works fine under
i686-apple-darwin9 for creating staticly linked fortran
binaries.
    Janis, could you please do the checkin so we can get
this in before the branch occurs. Thanks in advance.
               Jack

2009-01-16  Iain Sandoe  <iain.sandoe@sandoe-acoustics.co.uk>

        * gcc/config/darwin.h: Add static-libgfortran to LINK_SPEC.
        * libgomp/testsuite/lib/libgomp.exp: Add -B option for targets that
	use libgfortran.a%s in their specs.
        * gcc/testsuite/lib/gfortran.exp: Likewise.


Index: libgomp/testsuite/lib/libgomp.exp
===================================================================
--- libgomp/testsuite/lib/libgomp.exp	(revision 143450)
+++ libgomp/testsuite/lib/libgomp.exp	(working copy)
@@ -171,6 +171,9 @@
 
     if { [info exists lang_test_file] } {
         if { $blddir != "" } {
+            # Some targets use libgfortran.a%s in their specs, so they need a -B option
+            # for uninstalled testing.
+            lappend options "additional_flags=-B${blddir}/$ {lang_library_path}"
             lappend options "ldflags=-L${blddir}/${lang_library_path}"
         }
         lappend options "ldflags=${lang_link_flags}"
Index: gcc/testsuite/lib/gfortran.exp
===================================================================
--- gcc/testsuite/lib/gfortran.exp	(revision 143450)
+++ gcc/testsuite/lib/gfortran.exp	(working copy)
@@ -88,6 +88,9 @@
 
     if { $gccpath != "" } {
       if [file exists "${gccpath}/libgfortran/.libs/libgfortran.a"] {
+          # Some targets use libgfortran.a%s in their specs, so they need a -B option
+          # for uninstalled testing.
+          append flags "-B${gccpath}/libgfortran/.libs "
           append flags "-L${gccpath}/libgfortran/.libs "
           append ld_library_path ":${gccpath}/libgfortran/.libs"
       }
Index: gcc/config/darwin.h
===================================================================
--- gcc/config/darwin.h	(revision 143450)
+++ gcc/config/darwin.h	(working copy)
@@ -258,6 +258,7 @@
 #define LINK_SPEC  \
   "%{static}%{!static:-dynamic} \
    %{fgnu-runtime:%:replace-outfile(-lobjc -lobjc-gnu)}\
+   %{static|static-libgfortran:%:replace-outfile(-lgfortran libgfortran.a%s)}\
    %{!Zdynamiclib: \
      %{Zforce_cpusubtype_ALL:-arch %(darwin_arch) -force_cpusubtype_ALL} \
      %{!Zforce_cpusubtype_ALL:-arch %(darwin_subarch)} \



More information about the Gcc-patches mailing list