]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
darwin - fix PR86215 by backporting 80556.
authorIain Sandoe <iain@sandoe.co.uk>
Sun, 19 May 2019 16:03:17 +0000 (16:03 +0000)
committerIain Sandoe <iains@gcc.gnu.org>
Sun, 19 May 2019 16:03:17 +0000 (16:03 +0000)
The backport had been missed.

2019-01-03  Iain Sandoe  <iain@sandoe.co.uk>

PR target/86215
Backport from mainline
2017-09-25  Iain Sandoe  <iain@codesourcery.com>

PR target/80556
* config/i386/darwin.h (REAL_LIB_SPEC): New; put libSystem ahead
of libgcc_eh for m64.
* config/i386/darwin64.h: Likewise.

From-SVN: r271381

gcc/ChangeLog
gcc/config/i386/darwin.h
gcc/config/i386/darwin64.h

index 6ed560907a40269c9c392e454f7c131938ed4701..d5237d94695e178d9e420a289bfe5099bf80b144 100644 (file)
@@ -1,3 +1,14 @@
+2019-01-03  Iain Sandoe  <iain@sandoe.co.uk>
+
+       PR target/86215
+       Backport from mainline
+       2017-09-25  Iain Sandoe  <iain@codesourcery.com>
+
+       PR target/80556
+       * config/i386/darwin.h (REAL_LIB_SPEC): New; put libSystem ahead
+       of libgcc_eh for m64.
+       * config/i386/darwin64.h: Likewise.
+
 2019-05-15  David Edelsohn  <dje.gcc@gmail.com>
 
        Backport from mainline
index ebaa15a219921a4255724d191b16dbe858902355..2f67d84983aee89f2acf8a924d03d0855ad18c34 100644 (file)
@@ -39,6 +39,32 @@ along with GCC; see the file COPYING3.  If not see
 #endif
 #endif
 
+/* WORKAROUND pr80556:
+   For x86_64 Darwin10 and later, the unwinder is in libunwind (redirected
+   from libSystem).  This doesn't use the keymgr (see keymgr.c) and therefore
+   the calls that libgcc makes to obtain the KEYMGR_GCC3_DW2_OBJ_LIST are not
+   updated to include new images, and might not even be valid for a single
+   image.
+   Therefore, for 64b exes at least, we must use the libunwind implementation,
+   even when static-libgcc is specified.  We put libSystem first so that
+   unwinder symbols are satisfied from there. */
+#undef REAL_LIBGCC_SPEC
+#define REAL_LIBGCC_SPEC                                                  \
+   "%{static-libgcc|static:                                               \
+      %{m64:%:version-compare(>= 10.6 mmacosx-version-min= -lSystem)}     \
+        -lgcc_eh -lgcc;                                                           \
+      shared-libgcc|fexceptions|fgnu-runtime:                             \
+       %:version-compare(!> 10.5 mmacosx-version-min= -lgcc_s.10.4)       \
+       %:version-compare(>< 10.5 10.6 mmacosx-version-min= -lgcc_s.10.5)   \
+       %:version-compare(!> 10.5 mmacosx-version-min= -lgcc_ext.10.4)     \
+       %:version-compare(>= 10.5 mmacosx-version-min= -lgcc_ext.10.5)     \
+       -lgcc ;                                                            \
+      :%:version-compare(>< 10.3.9 10.5 mmacosx-version-min= -lgcc_s.10.4) \
+       %:version-compare(>< 10.5 10.6 mmacosx-version-min= -lgcc_s.10.5)   \
+       %:version-compare(!> 10.5 mmacosx-version-min= -lgcc_ext.10.4)     \
+       %:version-compare(>= 10.5 mmacosx-version-min= -lgcc_ext.10.5)     \
+       -lgcc }"
+
 /* Size of the Obj-C jump buffer.  */
 #define OBJC_JBLEN ((TARGET_64BIT) ? ((9 * 2) + 3 + 16) : (18))
 
index f2982edeac3a18f834aa7f910cabc0cf0afdddd2..32cb789c191a6c02d8b50fe7778da3f4d69dcebe 100644 (file)
@@ -21,6 +21,32 @@ along with GCC; see the file COPYING3.  If not see
 #undef  DARWIN_ARCH_SPEC
 #define DARWIN_ARCH_SPEC "%{m32:i386;:x86_64}"
 
+/* WORKAROUND pr80556:
+   For x86_64 Darwin10 and later, the unwinder is in libunwind (redirected
+   from libSystem).  This doesn't use the keymgr (see keymgr.c) and therefore
+   the calls that libgcc makes to obtain the KEYMGR_GCC3_DW2_OBJ_LIST are not
+   updated to include new images, and might not even be valid for a single
+   image.
+   Therefore, for 64b exes at least, we must use the libunwind implementation,
+   even when static-libgcc is specified.  We put libSystem first so that
+   unwinder symbols are satisfied from there. */
+#undef REAL_LIBGCC_SPEC
+#define REAL_LIBGCC_SPEC                                                  \
+   "%{static-libgcc|static:                                               \
+      %{!m32:%:version-compare(>= 10.6 mmacosx-version-min= -lSystem)}    \
+        -lgcc_eh -lgcc;                                                           \
+      shared-libgcc|fexceptions|fgnu-runtime:                             \
+       %:version-compare(!> 10.5 mmacosx-version-min= -lgcc_s.10.4)       \
+       %:version-compare(>< 10.5 10.6 mmacosx-version-min= -lgcc_s.10.5)   \
+       %:version-compare(!> 10.5 mmacosx-version-min= -lgcc_ext.10.4)     \
+       %:version-compare(>= 10.5 mmacosx-version-min= -lgcc_ext.10.5)     \
+       -lgcc ;                                                            \
+      :%:version-compare(>< 10.3.9 10.5 mmacosx-version-min= -lgcc_s.10.4) \
+       %:version-compare(>< 10.5 10.6 mmacosx-version-min= -lgcc_s.10.5)   \
+       %:version-compare(!> 10.5 mmacosx-version-min= -lgcc_ext.10.4)     \
+       %:version-compare(>= 10.5 mmacosx-version-min= -lgcc_ext.10.5)     \
+       -lgcc }"
+
 #undef  DARWIN_SUBARCH_SPEC
 #define DARWIN_SUBARCH_SPEC DARWIN_ARCH_SPEC