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]

[Patch Darwin] tidy linkspecs.


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.



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}}}}}}}}}}}}"


 /* libSystem contains unwind information for signal frames.  */
 #define DARWIN_LIBSYSTEM_HAS_UNWIND




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