aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeoffrey Keating <geoffk@apple.com>2005-11-15 04:55:12 +0000
committerGeoffrey Keating <geoffk@gcc.gnu.org>2005-11-15 04:55:12 +0000
commit563092615ab6961f349792662c099d7484c728c8 (patch)
tree292390e5e3676cfcd404ea933f97d2045a1faea8
parent9193863e4e5dab6abf00b8150bed4fbedd2d8641 (diff)
downloadgcc-563092615ab6961f349792662c099d7484c728c8.zip
gcc-563092615ab6961f349792662c099d7484c728c8.tar.gz
gcc-563092615ab6961f349792662c099d7484c728c8.tar.bz2
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
-rw-r--r--gcc/ChangeLog15
-rw-r--r--gcc/config/darwin.h42
-rw-r--r--gcc/config/i386/darwin.h1
-rw-r--r--gcc/config/rs6000/darwin.h5
-rw-r--r--gcc/gcc.c6
5 files changed, 49 insertions, 20 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 804e6b5..1447c73 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,18 @@
+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>
PR 24840
diff --git a/gcc/config/darwin.h b/gcc/config/darwin.h
index a4b79c6..5b17c34 100644
--- a/gcc/config/darwin.h
+++ b/gcc/config/darwin.h
@@ -302,23 +302,31 @@ Boston, MA 02110-1301, USA. */
#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
- libraries to link against. */
+/* Support -mmacosx-version-min by supplying different (stub) libgcc_s.dylib
+ libraries to link against, and by not linking against libgcc_s on
+ 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
-#define REAL_LIBGCC_SPEC \
- "%{static|static-libgcc:-lgcc -lgcc_eh; \
- :%{shared-libgcc|Zdynamiclib \
- :%:version-compare(!> 10.5 mmacosx-version-min= -lgcc_s.10.4) \
- %:version-compare(>= 10.5 mmacosx-version-min= -lgcc_s.10.5) \
- -lgcc; \
- :-lgcc -lgcc_eh}}"
-
+#define REAL_LIBGCC_SPEC \
+ "%{static-libgcc|static: -lgcc_eh -lgcc; \
+ shared-libgcc|fexceptions: \
+ %:version-compare(!> 10.5 mmacosx-version-min= -lgcc_s.10.4) \
+ %:version-compare(>= 10.5 mmacosx-version-min= -lgcc_s.10.5) \
+ -lgcc; \
+ :%: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 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
#define STARTFILE_SPEC \
@@ -326,11 +334,11 @@ Boston, MA 02110-1301, USA. */
%{!Zbundle:%{pg:%{static:-lgcrt0.o} \
%{!static:%{object:-lgcrt0.o} \
%{!object:%{preload:-lgcrt0.o} \
- %{!preload:-lgcrt1.o %{!m64: crt2.o%s}}}}} \
+ %{!preload:-lgcrt1.o %(darwin_crt2)}}}} \
%{!pg:%{static:-lcrt0.o} \
%{!static:%{object:-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
that they're specified on the link line. Thus, it is pointless
diff --git a/gcc/config/i386/darwin.h b/gcc/config/i386/darwin.h
index 7e8b2dc..8997233 100644
--- a/gcc/config/i386/darwin.h
+++ b/gcc/config/i386/darwin.h
@@ -50,6 +50,7 @@ Boston, MA 02110-1301, USA. */
#undef SUBTARGET_EXTRA_SPECS
#define SUBTARGET_EXTRA_SPECS \
{ "darwin_arch", "i386" }, \
+ { "darwin_crt2", "" }, \
{ "darwin_subarch", "i386" },
/* Use the following macro for any Darwin/x86-specific command-line option
diff --git a/gcc/config/rs6000/darwin.h b/gcc/config/rs6000/darwin.h
index 0d633ef..d1635ff 100644
--- a/gcc/config/rs6000/darwin.h
+++ b/gcc/config/rs6000/darwin.h
@@ -124,9 +124,14 @@ do { \
mcpu=G5:ppc970; \
: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
#define SUBTARGET_EXTRA_SPECS \
{ "darwin_arch", "%{m64:ppc64;:ppc}" }, \
+ { "darwin_crt2", DARWIN_CRT2_SPEC }, \
{ "darwin_subarch", DARWIN_SUBARCH_SPEC },
/* Output a .machine directive. */
diff --git a/gcc/gcc.c b/gcc/gcc.c
index 7bc6ac9..a644d08 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -7699,13 +7699,13 @@ version_compare_spec_function (int argc, const char **argv)
bool result;
if (argc < 3)
- abort ();
+ fatal ("too few arguments to %%:version-compare");
if (argv[0][0] == '\0')
abort ();
if ((argv[0][1] == '<' || argv[0][1] == '>') && argv[0][0] != '!')
nargs = 2;
if (argc != nargs + 3)
- abort ();
+ fatal ("too many arguments to %%:version-compare");
switch_len = strlen (argv[nargs + 1]);
for (i = 0; i < n_switches; i++)
@@ -7746,7 +7746,7 @@ version_compare_spec_function (int argc, const char **argv)
break;
default:
- abort ();
+ fatal ("unknown operator %qs in %%:version-compare", argv[0]);
}
if (! result)
return NULL;