Commit 56309261 by Geoffrey Keating Committed by Geoffrey Keating

gcc.c (version_compare_spec_function): Use fatal() rather than abort().

	* gcc.c (version_compare_spec_function): Use fatal() rather than
	abort().

	* config/rs6000/darwin.h (DARWIN_CRT2_SPEC): New.
	(SUBTARGET_EXTRA_SPECS): Define %(darwin_crt2).
	* config/i386/darwin.h (SUBTARGET_EXTRA_SPECS): Define %(darwin_crt2)
	as empty.
	* config/darwin.h (STARTFILE_SPEC): Use %(darwin_crt2) to possibly
	link in crt2.o.
	
	* config/darwin.h (REAL_LIBGCC_SPEC): Link in shared libgcc depending
	on -mmacosx-version-min setting.

From-SVN: r106935
parent 9193863e
2005-11-14 Geoffrey Keating <geoffk@apple.com>
* gcc.c (version_compare_spec_function): Use fatal() rather than
abort().
* config/rs6000/darwin.h (DARWIN_CRT2_SPEC): New.
(SUBTARGET_EXTRA_SPECS): Define %(darwin_crt2).
* config/i386/darwin.h (SUBTARGET_EXTRA_SPECS): Define %(darwin_crt2)
as empty.
* config/darwin.h (STARTFILE_SPEC): Use %(darwin_crt2) to possibly
link in crt2.o.
* config/darwin.h (REAL_LIBGCC_SPEC): Link in shared libgcc depending
on -mmacosx-version-min setting.
2005-11-14 Diego Novillo <dnovillo@redhat.com> 2005-11-14 Diego Novillo <dnovillo@redhat.com>
PR 24840 PR 24840
......
...@@ -302,23 +302,31 @@ Boston, MA 02110-1301, USA. */ ...@@ -302,23 +302,31 @@ Boston, MA 02110-1301, USA. */
#define LIB_SPEC "%{!static:-lSystem}" #define LIB_SPEC "%{!static:-lSystem}"
/* -dynamiclib implies -shared-libgcc just like -shared would on linux. /* Support -mmacosx-version-min by supplying different (stub) libgcc_s.dylib
Support -mmacosx-version-min by supplying different (stub) libgcc_s.dylib libraries to link against, and by not linking against libgcc_s on
libraries to link against. */ earlier-than-10.3.9.
Note that by default, -lgcc_eh is not linked against! This is
because in a future version of Darwin the EH frame information may
be in a new format, or the fallback routine might be changed; if
you want to explicitly link against the static version of those
routines, because you know you don't need to unwind through system
libraries, you need to explicitly say -static-libgcc.
If it is linked against, it has to be before -lgcc, because it may
need symbols from -lgcc. */
#undef REAL_LIBGCC_SPEC #undef REAL_LIBGCC_SPEC
#define REAL_LIBGCC_SPEC \ #define REAL_LIBGCC_SPEC \
"%{static|static-libgcc:-lgcc -lgcc_eh; \ "%{static-libgcc|static: -lgcc_eh -lgcc; \
:%{shared-libgcc|Zdynamiclib \ shared-libgcc|fexceptions: \
:%:version-compare(!> 10.5 mmacosx-version-min= -lgcc_s.10.4) \ %:version-compare(!> 10.5 mmacosx-version-min= -lgcc_s.10.4) \
%:version-compare(>= 10.5 mmacosx-version-min= -lgcc_s.10.5) \ %:version-compare(>= 10.5 mmacosx-version-min= -lgcc_s.10.5) \
-lgcc; \ -lgcc; \
:-lgcc -lgcc_eh}}" :%:version-compare(>< 10.3.9 10.5 mmacosx-version-min= -lgcc_s.10.4) \
%:version-compare(>= 10.5 mmacosx-version-min= -lgcc_s.10.5) \
-lgcc}"
/* We specify crt0.o as -lcrt0.o so that ld will search the library path. */ /* We specify crt0.o as -lcrt0.o so that ld will search the library path. */
/* We don't want anything to do with crt2.o in the 64-bit case;
testing the PowerPC-specific -m64 flag here is a little irregular,
but it's overkill to make copies of this spec for each target
arch. */
#undef STARTFILE_SPEC #undef STARTFILE_SPEC
#define STARTFILE_SPEC \ #define STARTFILE_SPEC \
...@@ -326,11 +334,11 @@ Boston, MA 02110-1301, USA. */ ...@@ -326,11 +334,11 @@ Boston, MA 02110-1301, USA. */
%{!Zbundle:%{pg:%{static:-lgcrt0.o} \ %{!Zbundle:%{pg:%{static:-lgcrt0.o} \
%{!static:%{object:-lgcrt0.o} \ %{!static:%{object:-lgcrt0.o} \
%{!object:%{preload:-lgcrt0.o} \ %{!object:%{preload:-lgcrt0.o} \
%{!preload:-lgcrt1.o %{!m64: crt2.o%s}}}}} \ %{!preload:-lgcrt1.o %(darwin_crt2)}}}} \
%{!pg:%{static:-lcrt0.o} \ %{!pg:%{static:-lcrt0.o} \
%{!static:%{object:-lcrt0.o} \ %{!static:%{object:-lcrt0.o} \
%{!object:%{preload:-lcrt0.o} \ %{!object:%{preload:-lcrt0.o} \
%{!preload:-lcrt1.o %{!m64: crt2.o%s}}}}}}}" %{!preload:-lcrt1.o %(darwin_crt2)}}}}}}"
/* The native Darwin linker doesn't necessarily place files in the order /* The native Darwin linker doesn't necessarily place files in the order
that they're specified on the link line. Thus, it is pointless that they're specified on the link line. Thus, it is pointless
......
...@@ -50,6 +50,7 @@ Boston, MA 02110-1301, USA. */ ...@@ -50,6 +50,7 @@ Boston, MA 02110-1301, USA. */
#undef SUBTARGET_EXTRA_SPECS #undef SUBTARGET_EXTRA_SPECS
#define SUBTARGET_EXTRA_SPECS \ #define SUBTARGET_EXTRA_SPECS \
{ "darwin_arch", "i386" }, \ { "darwin_arch", "i386" }, \
{ "darwin_crt2", "" }, \
{ "darwin_subarch", "i386" }, { "darwin_subarch", "i386" },
/* Use the following macro for any Darwin/x86-specific command-line option /* Use the following macro for any Darwin/x86-specific command-line option
......
...@@ -124,9 +124,14 @@ do { \ ...@@ -124,9 +124,14 @@ do { \
mcpu=G5:ppc970; \ mcpu=G5:ppc970; \
:ppc}}" :ppc}}"
/* crt2.o is at least partially required for 10.3.x and earlier. */
#define DARWIN_CRT2_SPEC \
"%{!m64:%:version-compare(!> 10.4 mmacosx-version-min= crt2.o%s)}"
#undef SUBTARGET_EXTRA_SPECS #undef SUBTARGET_EXTRA_SPECS
#define SUBTARGET_EXTRA_SPECS \ #define SUBTARGET_EXTRA_SPECS \
{ "darwin_arch", "%{m64:ppc64;:ppc}" }, \ { "darwin_arch", "%{m64:ppc64;:ppc}" }, \
{ "darwin_crt2", DARWIN_CRT2_SPEC }, \
{ "darwin_subarch", DARWIN_SUBARCH_SPEC }, { "darwin_subarch", DARWIN_SUBARCH_SPEC },
/* Output a .machine directive. */ /* Output a .machine directive. */
......
...@@ -7699,13 +7699,13 @@ version_compare_spec_function (int argc, const char **argv) ...@@ -7699,13 +7699,13 @@ version_compare_spec_function (int argc, const char **argv)
bool result; bool result;
if (argc < 3) if (argc < 3)
abort (); fatal ("too few arguments to %%:version-compare");
if (argv[0][0] == '\0') if (argv[0][0] == '\0')
abort (); abort ();
if ((argv[0][1] == '<' || argv[0][1] == '>') && argv[0][0] != '!') if ((argv[0][1] == '<' || argv[0][1] == '>') && argv[0][0] != '!')
nargs = 2; nargs = 2;
if (argc != nargs + 3) if (argc != nargs + 3)
abort (); fatal ("too many arguments to %%:version-compare");
switch_len = strlen (argv[nargs + 1]); switch_len = strlen (argv[nargs + 1]);
for (i = 0; i < n_switches; i++) for (i = 0; i < n_switches; i++)
...@@ -7746,7 +7746,7 @@ version_compare_spec_function (int argc, const char **argv) ...@@ -7746,7 +7746,7 @@ version_compare_spec_function (int argc, const char **argv)
break; break;
default: default:
abort (); fatal ("unknown operator %qs in %%:version-compare", argv[0]);
} }
if (! result) if (! result)
return NULL; return NULL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment