aboutsummaryrefslogtreecommitdiff
path: root/gcc/config
diff options
context:
space:
mode:
authorFrançois-Xavier Coudert <fxcoudert@gcc.gnu.org>2021-12-17 19:30:36 +0100
committerFrançois-Xavier Coudert <fxcoudert@gcc.gnu.org>2021-12-18 09:20:49 +0100
commitf18cbc1ee1f421a0dd79dc389bef9a23dd4a761d (patch)
tree0a243e2185f02ff994f70deb2e79fb094149afa6 /gcc/config
parent2554e2da9263e4e26a164318f8041b19b8e54c21 (diff)
downloadgcc-f18cbc1ee1f421a0dd79dc389bef9a23dd4a761d.zip
gcc-f18cbc1ee1f421a0dd79dc389bef9a23dd4a761d.tar.gz
gcc-f18cbc1ee1f421a0dd79dc389bef9a23dd4a761d.tar.bz2
Darwin: Future-proof and homogeneize detection of darwin versions
The current GCC branch will become 12.1.0, which will be the stable version of GCC when the next macOS version is released. There are some places in GCC that don’t handle darwin22 as a version, so we need to future-proof it (gcc/config.gcc and gcc/config/darwin-driver.c). We align that code with what Apple clang does, i.e. accept all potential major macOS versions until 99. This patch also homogenises the handling of darwin version numbers, where the majority of places use darwin2*, but some used darwin2[0-9]*. Since there never was a darwin2.x version, the two are equivalent, and we prefer the simpler darwin2* gcc/ChangeLog: * config/darwin-driver.c: Make version code more future-proof. * config.gcc: Homogeneize darwin versions. * configure.ac: Homogeneize darwin versions. * configure: Regenerate. gcc/testsuite/ChangeLog: * gcc.dg/darwin-minversion-link.c: Test darwin21. * obj-c++.dg/cxx-ivars-3.mm: Homogeneize darwin versions. * obj-c++.dg/objc-gc-3.mm: Homogeneize darwin versions. * objc.dg/objc-gc-4.m: Homogeneize darwin versions.
Diffstat (limited to 'gcc/config')
-rw-r--r--gcc/config/darwin-driver.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/config/darwin-driver.c b/gcc/config/darwin-driver.c
index 688fe8f..e459a72 100644
--- a/gcc/config/darwin-driver.c
+++ b/gcc/config/darwin-driver.c
@@ -64,7 +64,8 @@ validate_macosx_version_min (const char *version_str)
major = strtoul (version_str, &end, 10);
- if (major < 10 || major > 12 ) /* macOS 10, 11, and 12 are known. */
+ /* macOS 10, 11, and 12 are known. clang accepts up to 99. */
+ if (major < 10 || major > 99)
return NULL;
/* Skip a separating period, if there's one. */
@@ -160,8 +161,7 @@ darwin_find_version_from_kernel (void)
/* Darwin20 sees a transition to macOS 11. In this, it seems that the
mapping to macOS minor version is now shifted to the kernel minor
- version - 1 (at least for the initial releases). At this stage, we
- don't know what macOS version will correspond to Darwin21. */
+ version - 1 (at least for the initial releases). */
if (major_vers >= 20)
{
int minor_vers = *version_p++ - '0';