From 286b9428fed7536dba3406eeb06d5340a780bfe6 Mon Sep 17 00:00:00 2001 From: Iain Sandoe Date: Wed, 25 Dec 2019 20:31:04 +0000 Subject: [PATCH] [Darwin, PPC] Use Darwin9 bundle header for Rosetta builds. On Darwin10 it's possible to make a 32b PPC build using the 'Rosetta' emulator. However, these builds need to make use of Darwin9 crts (for exes, dylibs and bundles). This adds the change to cater for bundles. gcc/ChangeLog: Backport from mainline. 2019-12-14 Iain Sandoe * config/darwin.h (DARWIN_EXTRA_SPECS): Add new bundle spec. (DARWIN_BUNDLE1_SPEC): New. (STARTFILE_SPEC): Use darwin bundle spec. * config/rs6000/darwin.h (DARWIN_BUNDLE1_SPEC): New. (DARWIN_DYLIB1_SPEC): Delete duplicate. From-SVN: r279732 --- gcc/ChangeLog | 11 +++++++++++ gcc/config/darwin.h | 11 +++++++---- gcc/config/rs6000/darwin.h | 18 ++++++++++++------ 3 files changed, 30 insertions(+), 10 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ddf21f7108e3..928e9459ed54 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,14 @@ +2019-12-25 Iain Sandoe + + Backport from mainline. + 2019-12-14 Iain Sandoe + + * config/darwin.h (DARWIN_EXTRA_SPECS): Add new + bundle spec. (DARWIN_BUNDLE1_SPEC): New. + (STARTFILE_SPEC): Use darwin bundle spec. + * config/rs6000/darwin.h (DARWIN_BUNDLE1_SPEC): New. + (DARWIN_DYLIB1_SPEC): Delete duplicate. + 2019-12-20 Jakub Jelinek PR fortran/92756 diff --git a/gcc/config/darwin.h b/gcc/config/darwin.h index be261e73a7b4..fab9af97afdb 100644 --- a/gcc/config/darwin.h +++ b/gcc/config/darwin.h @@ -392,9 +392,7 @@ extern GTY(()) int darwin_ms_struct; #undef STARTFILE_SPEC #define STARTFILE_SPEC \ "%{Zdynamiclib: %(darwin_dylib1) %{fgnu-tm: -lcrttms.o}} \ - %{!Zdynamiclib:%{Zbundle:%{!static: \ - %:version-compare(< 10.6 mmacosx-version-min= -lbundle1.o) \ - %{fgnu-tm: -lcrttms.o}}} \ + %{!Zdynamiclib:%{Zbundle:%(darwin_bundle1)} \ %{!Zbundle:%{pg:%{static:-lgcrt0.o} \ %{!static:%{object:-lgcrt0.o} \ %{!object:%{preload:-lgcrt0.o} \ @@ -416,7 +414,8 @@ extern GTY(()) int darwin_ms_struct; { "darwin_crt1", DARWIN_CRT1_SPEC }, \ { "darwin_crt2", DARWIN_CRT2_SPEC }, \ { "darwin_crt3", DARWIN_CRT3_SPEC }, \ - { "darwin_dylib1", DARWIN_DYLIB1_SPEC }, + { "darwin_dylib1", DARWIN_DYLIB1_SPEC }, \ + { "darwin_bundle1", DARWIN_BUNDLE1_SPEC }, #define DARWIN_CRT1_SPEC \ "%:version-compare(!> 10.5 mmacosx-version-min= -lcrt1.o) \ @@ -438,6 +437,10 @@ extern GTY(()) int darwin_ms_struct; "%:version-compare(!> 10.5 mmacosx-version-min= -ldylib1.o) \ %:version-compare(>< 10.5 10.6 mmacosx-version-min= -ldylib1.10.5.o)" +#define DARWIN_BUNDLE1_SPEC \ +"%{!static:%:version-compare(< 10.6 mmacosx-version-min= -lbundle1.o) \ + %{fgnu-tm: -lcrttms.o}}" + #ifdef HAVE_AS_MMACOSX_VERSION_MIN_OPTION /* Emit macosx version (but only major). */ #define ASM_MMACOSX_VERSION_MIN_SPEC \ diff --git a/gcc/config/rs6000/darwin.h b/gcc/config/rs6000/darwin.h index e36de59ca250..165aca298384 100644 --- a/gcc/config/rs6000/darwin.h +++ b/gcc/config/rs6000/darwin.h @@ -156,6 +156,18 @@ %:version-compare(!> 10.4 mmacosx-version-min= crt3_2.o%s) \ }}" +/* As for crt1, we need to force the dylib crt for 10.6. */ +#undef DARWIN_DYLIB1_SPEC +#define DARWIN_DYLIB1_SPEC \ + "%:version-compare(!> 10.5 mmacosx-version-min= -ldylib1.o) \ + %:version-compare(>< 10.5 10.7 mmacosx-version-min= -ldylib1.10.5.o)" + +/* Likewise, the bundle crt. */ +#undef DARWIN_BUNDLE1_SPEC +#define DARWIN_BUNDLE1_SPEC \ +"%{!static:%:version-compare(< 10.7 mmacosx-version-min= -lbundle1.o) \ + %{fgnu-tm: -lcrttms.o}}" + /* The PPC regs save/restore functions are leaves and could, conceivably be used by the tm destructor. */ #undef ENDFILE_SPEC @@ -168,12 +180,6 @@ { "darwin_crt2", DARWIN_CRT2_SPEC }, \ { "darwin_subarch", DARWIN_SUBARCH_SPEC }, -/* We need to jam the dylib crt to 10.5 for 10.6 (Rosetta) use. */ -#undef DARWIN_DYLIB1_SPEC -#define DARWIN_DYLIB1_SPEC \ - "%:version-compare(!> 10.5 mmacosx-version-min= -ldylib1.o) \ - %:version-compare(>< 10.5 10.7 mmacosx-version-min= -ldylib1.10.5.o)" - /* Output a .machine directive. */ #undef TARGET_ASM_FILE_START #define TARGET_ASM_FILE_START rs6000_darwin_file_start -- 2.47.2