Patchwork [Darwin] tidy linkspecs.

login
register
mail settings
Submitter IainS
Date July 20, 2010, 4:22 p.m.
Message ID <BE6C58CA-3AA7-45C8-A543-1AFF0E90EF61@sandoe-acoustics.co.uk>
Download mbox | patch
Permalink /patch/59342/
State New
Headers show

Comments

IainS - July 20, 2010, 4:22 p.m.
there is a certain amount of unwelcome duplication in the darwin  
LINK_COMMAND_SPECs.
this splits the LINK_COMMAND_SPECs into two parts and only changes the  
bit that's necessary for darwin >= 9

successful bootstraps on {powerpc*,i686}-apple-darwin9, i686-apple- 
darwin8, x86_64-apple-darwin10.

OK for trunk?
Iain

gcc/

	* config/darwin.h (LINK_COMMAND_SPEC): Split into...
	(LINK_COMMAND_SPEC_A): New.
	(DSYMUTIL): New.
	(DSYMUTIL_SPEC): New.
	* config/darwin9.h (LINK_COMMAND_SPEC): Remove.
	(DSYMUTIL_SPEC): Update for darwin >= 9 requirements.




  /* libSystem contains unwind information for signal frames.  */
  #define DARWIN_LIBSYSTEM_HAS_UNWIND
Mike Stump - July 22, 2010, 2:24 a.m.
On Jul 20, 2010, at 9:22 AM, IainS wrote:
> OK for trunk?

Ok.
IainS - July 22, 2010, 8:04 a.m.
On 22 Jul 2010, at 03:24, Mike Stump wrote:

> On Jul 20, 2010, at 9:22 AM, IainS wrote:
>> OK for trunk?
>
> Ok.

r162403
Iain

Patch

Index: gcc/config/darwin.h
===================================================================
--- gcc/config/darwin.h	(revision 162327)
+++ gcc/config/darwin.h	(working copy)
@@ -266,8 +266,9 @@  extern GTY(()) int darwin_ms_struct;
     instead of LINK_COMMAND_SPEC.  The command spec is better for
     specifying the handling of options understood by generic Unix
     linkers, and for positional arguments like libraries.  */
-#define LINK_COMMAND_SPEC "\
-%{!fdump=*:%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:\
+
+#define LINK_COMMAND_SPEC_A \
+   "%{!fdump=*:%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:\
      %(linker) %l %X %{d} %{s} %{t} %{Z} %{u*} \
      %{A} %{e*} %{m} %{r} %{x} \
      %{o*}%{!o:-o a.out} \
@@ -277,11 +278,17 @@  extern GTY(()) int darwin_ms_struct;
      %{fopenmp|ftree-parallelize-loops=*: \
        %{static|static-libgcc|static-libstdc++|static-libgfortran:  
libgomp.a%s; : -lgomp } } \
      %{!nostdlib:%{!nodefaultlibs: %(link_ssp) %G %L }} \
-    %{!A:%{!nostdlib:%{!nostartfiles:%E}}} %{T*} %{F*} }}}}}}}\n\
-%{!fdump=*:%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:\
+    %{!A:%{!nostdlib:%{!nostartfiles:%E}}} %{T*} %{F*} }}}}}}}\n"
+
+#define DSYMUTIL "dsymutil"
+
+#define DSYMUTIL_SPEC \
+   "%{!fdump=*:%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:\
      %{.c|.cc|.C|.cpp|.cp|.c++|.cxx|.CPP|.m|.mm: \
-    %{gdwarf-2:%{!gstabs*:%{!g0: dsymutil %{o*:%*}%{! 
o:a.out}}}}}}}}}}}}"
+    %{gdwarf-2:%{!gstabs*:%{!g0: " DSYMUTIL " %{o*:%*}%{! 
o:a.out}}}}}}}}}}}}"

+#define LINK_COMMAND_SPEC LINK_COMMAND_SPEC_A DSYMUTIL_SPEC
+
  #ifdef TARGET_SYSTEM_ROOT
  #define LINK_SYSROOT_SPEC \
    "%{isysroot*:-syslibroot %*;:-syslibroot " TARGET_SYSTEM_ROOT "}"
Index: gcc/config/darwin9.h
===================================================================
--- gcc/config/darwin9.h	(revision 162327)
+++ gcc/config/darwin9.h	(working copy)
@@ -24,22 +24,11 @@  along with GCC; see the file COPYING3.  If not see
  #define DARWIN_PREFER_DWARF

  /* Since DWARF2 is default, conditions for running dsymutil are  
different.  */
-#undef LINK_COMMAND_SPEC
-#define LINK_COMMAND_SPEC "\
-%{!fdump=*:%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:\
-    %(linker) %l %X %{d} %{s} %{t} %{Z} \
-    %{A} %{e*} %{m} %{r} %{x} \
-    %{o*}%{!o:-o a.out} \
-    %{!A:%{!nostdlib:%{!nostartfiles:%S}}} \
-    %{L*} %(link_libgcc) %o %{fprofile-arcs|fprofile-generate*| 
coverage:-lgcov} \
-    %{flto} %{fwhopr} \
-    %{fopenmp|ftree-parallelize-loops=*: \
-      %{static|static-libgcc|static-libstdc++|static-libgfortran:  
libgomp.a%s; : -lgomp } } \
-    %{!nostdlib:%{!nodefaultlibs:  %(link_ssp) %G %L }} \
-    %{!A:%{!nostdlib:%{!nostartfiles:%E}}} %{T*} %{F*} }}}}}}}\n\
-%{!fdump=*:%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:\
-    %{.c|.cc|.C|.cpp|.cp|.c++|.cxx|.CPP|.m|.mm: \
-    %{g*:%{!gstabs*:%{!g0: dsymutil %{o*:%*}%{!o:a.out}}}}}}}}}}}}"
+#undef DSYMUTIL_SPEC
+#define DSYMUTIL_SPEC \
+   "%{!fdump=*:%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:\
+    %{.c|.cc|.C|.cpp|.cp|.c++|.cxx|.CPP|.m|.mm|.s: \
+    %{g*:%{!gstabs*:%{!g0: " DSYMUTIL " %{o*:%*}%{!o:a.out}}}}}}}}}}}}"