Skip to content

Commit 6725f18

Browse files
markmentovaiiains
authored andcommitted
Darwin: Future-proof -mmacosx-version-min
f18cbc1 (2021-12-18) updated various parts of gcc to not impose a Darwin or macOS version maximum of the current known release. Different parts of gcc accept, variously, Darwin version numbers matching darwin2*, and macOS major version numbers up to 99. The current released version is Darwin 21 and macOS 12, with Darwin 22 and macOS 13 expected for public release later this year. With one major OS release per year, this strategy is expected to provide another 8 years of headroom. However, f18cbc1 missed config/darwin-c.c (now .cc), which continued to impose a maximum of macOS 12 on the -mmacosx-version-min compiler driver argument. This was last updated from 11 to 12 in 11b9675 (2021-10-27), but kicking the can down the road one year at a time is not a viable strategy, and is not in line with the more recent technique from f18cbc1. Prior to 556ab51 (2020-11-06), config/darwin-c.c did not impose a maximum that needed annual maintenance, as at that point, all macOS releases had used a major version of 10. The stricter approach imposed since then was valuable for a time until the particulars of the new versioning scheme were established and understood, but now that they are, it's prudent to restore a more permissive approach. gcc/ChangeLog: * config/darwin-c.cc: Make -mmacosx-version-min more future-proof. Signed-off-by: Mark Mentovai <[email protected]>
1 parent ff500e1 commit 6725f18

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

gcc/config/darwin-c.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -691,7 +691,8 @@ macosx_version_as_macro (void)
691691
if (!version_array)
692692
goto fail;
693693

694-
if (version_array[MAJOR] < 10 || version_array[MAJOR] > 12)
694+
/* System tools accept up to 99 as a major version. */
695+
if (version_array[MAJOR] < 10 || version_array[MAJOR] > 99)
695696
goto fail;
696697

697698
if (version_array[MAJOR] == 10 && version_array[MINOR] < 10)

0 commit comments

Comments
 (0)