Skip to content

Commit be9bc6a

Browse files
committed
Darwin, libgcc : Adjust min version supported for the OS.
Tools from later versions of the OS deprecate or fail to support earlier OS revisions. libgcc/ * config.host: Arrange to set min Darwin OS versions from the configured host version. * config/i386/t-darwin: Amend to handle configured min OS versions. * config/t-darwin : Use the configured min OS versions. * config/t-darwin-min-1: New. * config/t-darwin-min-4: New. * config/t-darwin-min-5: New. * config/t-darwin-min-8: New. (cherry picked from commit a618c9ca6ba25235b23e403ec1b06dac6d760281)
1 parent 6abf6de commit be9bc6a

File tree

7 files changed

+40
-7
lines changed

7 files changed

+40
-7
lines changed

libgcc/config.host

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,11 +235,33 @@ case ${host} in
235235
*-darwin*)
236236
echo "but is needed after macOS 10.11 (setting it on)" 1>&2
237237
tmake_file="$tmake_file t-darwin-rpath "
238+
enable_darwin_at_rpath=yes
238239
;;
239240
esac
240241
else
241242
echo "enable_darwin_at_rpath is '$enable_darwin_at_rpath'" 1>&2
242243
fi
244+
case ${host} in
245+
*-*-darwin20* | *-*-darwin1[89]*)
246+
tmake_file="t-darwin-min-8 $tmake_file"
247+
;;
248+
*-*-darwin9* | *-*-darwin1[0-7]*)
249+
if test "x$enable_darwin_at_rpath" = "xyes"; then
250+
tmake_file="t-darwin-min-5 $tmake_file"
251+
else
252+
tmake_file="t-darwin-min-4 $tmake_file"
253+
fi
254+
;;
255+
*-*-darwin[4-8]*)
256+
tmake_file="t-darwin-min-1 $tmake_file"
257+
;;
258+
*)
259+
# Fall back to configuring for the oldest system known to work with the
260+
# current sources.
261+
tmake_file="t-darwin-min-5 $tmake_file"
262+
echo "Warning: libgcc configured to support macOS 10.5" 1>&2
263+
;;
264+
esac
243265
extra_parts="crt3.o d10-uwfef.o crttms.o crttme.o libemutls_w.a"
244266
;;
245267
*-*-dragonfly*)

libgcc/config/t-darwin

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
# Set this as a minimum (unless overriden by arch t-files) since it's a
22
# reasonable lowest common denominator that works for all our archs.
3-
HOST_LIBGCC2_CFLAGS += -mmacosx-version-min=10.4
3+
HOST_LIBGCC2_CFLAGS += $(DARWIN_MIN_LIB_VERSION)
44

55
crt3.o: $(srcdir)/config/darwin-crt3.c
6-
$(crt_compile) -mmacosx-version-min=10.4 -c $<
6+
$(crt_compile) $(DARWIN_MIN_CRT_VERSION) -c $<
77

88
crttms.o: $(srcdir)/config/darwin-crt-tm.c
9-
$(crt_compile) -mmacosx-version-min=10.4 -DSTART -c $<
9+
$(crt_compile) $(DARWIN_MIN_CRT_VERSION) -DSTART -c $<
1010

1111
crttme.o: $(srcdir)/config/darwin-crt-tm.c
12-
$(crt_compile) -mmacosx-version-min=10.4 -DEND -c $<
12+
$(crt_compile) $(DARWIN_MIN_CRT_VERSION) -DEND -c $<
1313

1414
# Use unwind-dw2-fde-darwin
1515
LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/config/unwind-dw2-fde-darwin.c \
@@ -24,6 +24,8 @@ libemutls_w.a: emutls.o
2424
$(RANLIB_FOR_TARGET) $@
2525

2626
# Patch to __Unwind_Find_Enclosing_Function for Darwin10.
27+
# This has to be built for 10.6, even if the toolchain will not target that
28+
# version
2729
d10-uwfef.o: $(srcdir)/config/darwin10-unwind-find-enc-func.c
2830
$(crt_compile) -mmacosx-version-min=10.6 -c $<
2931

libgcc/config/t-darwin-min-1

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Support building with -mmacosx-version-min back to 10.1.
2+
DARWIN_MIN_LIB_VERSION = -mmacosx-version-min=10.4
3+
DARWIN_MIN_CRT_VERSION = -mmacosx-version-min=10.1

libgcc/config/t-darwin-min-4

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Support building with -mmacosx-version-min back to 10.4.
2+
DARWIN_MIN_LIB_VERSION = -mmacosx-version-min=10.4
3+
DARWIN_MIN_CRT_VERSION = -mmacosx-version-min=10.4

libgcc/config/t-darwin-min-5

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Support building with -mmacosx-version-min back to 10.5.
2+
DARWIN_MIN_LIB_VERSION = -mmacosx-version-min=10.5
3+
DARWIN_MIN_CRT_VERSION = -mmacosx-version-min=10.5

libgcc/config/t-darwin-min-8

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Support building with -mmacosx-version-min back to 10.8.
2+
DARWIN_MIN_LIB_VERSION = -mmacosx-version-min=10.8
3+
DARWIN_MIN_CRT_VERSION = -mmacosx-version-min=10.8

libgcc/config/t-darwin-rpath

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,2 @@
11
# Use @rpath and add a search path to exes and dylibs that depend on this.
22
SHLIB_RPATH = @rpath
3-
4-
# Which does not work for Darwin < 9
5-
HOST_LIBGCC2_CFLAGS += -mmacosx-version-min=10.5

0 commit comments

Comments
 (0)