]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[Darwin, PPC] Move the out of line register save/restore to an endfile.
authorIain Sandoe <iain@sandoe.co.uk>
Fri, 1 Nov 2019 20:38:37 +0000 (20:38 +0000)
committerIain Sandoe <iains@gcc.gnu.org>
Fri, 1 Nov 2019 20:38:37 +0000 (20:38 +0000)
272660
We have been including this in libgcc, which means that we have to append
-lgcc even when using shared libgcc. In preparation for revision of libgcc
split this into an endfile.

272759 Correct whitespace in specs.

gcc/

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

Backport from mainline
2019-06-27  Iain Sandoe  <iain@sandoe.co.uk>

* config/rs6000/darwin.h (ENDFILE_SPEC): Correct whitespace in the
spec.

Backport from mainline
2019-06-25  Iain Sandoe  <iain@sandoe.co.uk>

* config/rs6000/darwin.h (ENDFILE_SPEC): New.

libgcc/

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

Backport from mainline.
2019-06-25  Iain Sandoe  <iain@sandoe.co.uk>

* config.host: Add libef_ppc.a to the extra files for powerpc-darwin.
* config/rs6000/t-darwin: (PPC_ENDFILE_SRC, PPC_ENDFILE_OBJS): New.
Build objects for the out of line save/restore register functions
so that they can be used for any supported Darwin version.
* config/t-darwin: Default the build Darwin version to Darwin8
(MacOS 10.4).

From-SVN: r277724

gcc/ChangeLog
gcc/config/rs6000/darwin.h
libgcc/ChangeLog
libgcc/config.host
libgcc/config/rs6000/t-darwin
libgcc/config/t-darwin

index be2913bb971688fba8a7f6758b83d7c5818b7aef..f1b830b894bba6ab79c5d0d3006a4f1955859fec 100644 (file)
@@ -1,3 +1,16 @@
+2019-11-01  Iain Sandoe  <iain@sandoe.co.uk>
+
+       Backport from mainline
+       2019-06-27  Iain Sandoe  <iain@sandoe.co.uk>
+
+       * config/rs6000/darwin.h (ENDFILE_SPEC): Correct whitespace in the
+       spec.
+
+       Backport from mainline
+       2019-06-25  Iain Sandoe  <iain@sandoe.co.uk>
+
+       * config/rs6000/darwin.h (ENDFILE_SPEC): New.
+
 2019-11-01  Iain Sandoe  <iain@sandoe.co.uk>
 
        Backport from mainline
index 58a2b811ea75f2bde1341c69d21f45ad7c868d61..4a9f67f2e93bcf0592703eea8006bf92912b7e4f 100644 (file)
 #define DARWIN_CRT2_SPEC \
   "%{!m64:%:version-compare(!> 10.4 mmacosx-version-min= crt2.o%s)}"
 
+/* The PPC regs save/restore functions are leaves and could, conceivably
+   be used by the tm destructor.  */
+#undef ENDFILE_SPEC
+#define ENDFILE_SPEC TM_DESTRUCTOR " -lef_ppc"
+
 #undef SUBTARGET_EXTRA_SPECS
 #define SUBTARGET_EXTRA_SPECS                  \
   DARWIN_EXTRA_SPECS                            \
index 67d064a6347f880adf7b30a5881aa78431f2457a..129e937dee84a8993222c15f3d00ae9f12467630 100644 (file)
@@ -1,3 +1,15 @@
+2019-11-01  Iain Sandoe  <iain@sandoe.co.uk>
+
+       Backport from mainline.
+       2019-06-25  Iain Sandoe  <iain@sandoe.co.uk>
+
+       * config.host: Add libef_ppc.a to the extra files for powerpc-darwin.
+       * config/rs6000/t-darwin: (PPC_ENDFILE_SRC, PPC_ENDFILE_OBJS): New.
+       Build objects for the out of line save/restore register functions
+       so that they can be used for any supported Darwin version.
+       * config/t-darwin: Default the build Darwin version to Darwin8
+       (MacOS 10.4).
+
 2019-09-04  Iain Sandoe  <iain@sandoe.co.uk>
 
        Backport from mainline.
index 8beb492b5fa1343d9a4db5094e2ff349ef52ab79..e38f0c2774d6cecf90d3102cd22f2bb02dfe9ee2 100644 (file)
@@ -993,11 +993,11 @@ powerpc-*-darwin*)
          ;;
        esac
        tmake_file="$tmake_file rs6000/t-ibm-ldouble"
-       extra_parts="$extra_parts crt2.o"
+       extra_parts="$extra_parts crt2.o libef_ppc.a"
        ;;
 powerpc64-*-darwin*)
        tmake_file="$tmake_file rs6000/t-darwin64 rs6000/t-ibm-ldouble"
-       extra_parts="$extra_parts crt2.o"
+       extra_parts="$extra_parts crt2.o libef_ppc.a"
        ;;
 powerpc*-*-freebsd*)
        tmake_file="${tmake_file} rs6000/t-ppccomm rs6000/t-savresfgpr rs6000/t-crtstuff rs6000/t-freebsd t-softfp-sfdf t-softfp-excl t-softfp"
index 61da0bdf13a700f7ebf130fc23f97e310a1cd12d..0c238b7a7e83c3c8291295e2139e6ea203f036e4 100644 (file)
@@ -3,23 +3,49 @@ DARWIN_EXTRA_CRT_BUILD_CFLAGS = -mlongcall -mmacosx-version-min=10.4
 crt2.o: $(srcdir)/config/rs6000/darwin-crt2.c
        $(crt_compile) $(DARWIN_EXTRA_CRT_BUILD_CFLAGS) -c $<
 
+# The outlined register save/restore functions need to run anywhere, and
+# they must be leaf functions suitable for use in an endfile.
+
+PPC_ENDFILE_SRC = \
+  $(srcdir)/config/rs6000/darwin-gpsave.S \
+  $(srcdir)/config/rs6000/darwin-fpsave.S \
+  $(srcdir)/config/rs6000/darwin-vecsave.S
+
+PPC_ENDFILE_OBJS = \
+ darwin-gpsave.o \
+ darwin-fpsave.o \
+ darwin-vecsave.o
+
+darwin-gpsave.o: $(srcdir)/config/rs6000/darwin-gpsave.S
+       $(crt_compile) -mmacosx-version-min=10.1 -c $<
+
+darwin-fpsave.o: $(srcdir)/config/rs6000/darwin-fpsave.S
+       $(crt_compile) -mmacosx-version-min=10.1 -c $<
+
+darwin-vecsave.o: $(srcdir)/config/rs6000/darwin-vecsave.S
+       $(crt_compile) -mmacosx-version-min=10.1 -c $<
+
+# We build these into a library, so that they are only linked as needed and not
+# forced into every object.
+
+libef_ppc.a: $(PPC_ENDFILE_OBJS)
+       $(AR_CREATE_FOR_TARGET) $@ $(PPC_ENDFILE_OBJS)
+       $(RANLIB_FOR_TARGET) $@
+
 LIB2ADD = $(srcdir)/config/rs6000/darwin-tramp.S \
          $(srcdir)/config/darwin-64.c \
-         $(srcdir)/config/rs6000/darwin-fpsave.S  \
-         $(srcdir)/config/rs6000/darwin-gpsave.S  \
          $(srcdir)/config/rs6000/darwin-world.S \
          $(srcdir)/config/rs6000/ppc64-fp.c
 
-LIB2ADD_ST = \
-         $(srcdir)/config/rs6000/darwin-vecsave.S
-
 # The .S files above are designed to run on all processors, even though
 # they use AltiVec instructions.
 # -Wa is used because -force_cpusubtype_ALL doesn't work with -dynamiclib.
-# -mmacosx-version-min=10.4 is used to provide compatibility for code from
-# earlier OSX versions.
-HOST_LIBGCC2_CFLAGS += -Wa,-force_cpusubtype_ALL -mmacosx-version-min=10.4
 
+HOST_LIBGCC2_CFLAGS += -Wa,-force_cpusubtype_ALL
+
+# Although the default for 10.4 is G3, we need the unwinder to be built
+# with vector support so that the "save/rest_world" outlined functions are
+# correctly invoked.
 unwind-dw2_s.o: HOST_LIBGCC2_CFLAGS += -maltivec
 unwind-dw2.o: HOST_LIBGCC2_CFLAGS += -maltivec
 
index 13ca6ed99d3f58df474c5f2cd0dd1d04385feab9..8ca61d02f3b021901bec61704e494c6d3bd91f67 100644 (file)
@@ -1,6 +1,6 @@
 # Set this as a minimum (unless overriden by arch t-files) since it's a
 # reasonable lowest common denominator that works for all our archs.
-HOST_LIBGCC2_CFLAGS += -mmacosx-version-min=10.5
+HOST_LIBGCC2_CFLAGS += -mmacosx-version-min=10.4
 
 crt3.o: $(srcdir)/config/darwin-crt3.c
        $(crt_compile) $(DARWIN_EXTRA_CRT_BUILD_CFLAGS) -c $<