https://gcc.gnu.org/g:bd4b33d265d44bfb3222c7bb962818179242bf4b

commit r17-1551-gbd4b33d265d44bfb3222c7bb962818179242bf4b
Author: Francois-Xavier Coudert <[email protected]>
Date:   Sun Jun 14 17:18:17 2026 +0200

    Darwin: account for macOS 27
    
    macOS 27 (Golden Gate) corresponds to darwin27. Previously, macOS 26 was
    darwin25, and darwin26 never existed. We need to adapt the driver to
    this new numbering scheme.
    
    2025-07-14  François-Xavier Coudert  <[email protected]>
    
    gcc/ChangeLog:
    
            PR target/120645
            * config/darwin-driver.cc: Account for latest macOS numbering
            scheme.
    
    gcc/testsuite/ChangeLog:
    
            * gcc.dg/darwin-minversion-link.c: Account for macOS 27.

Diff:
---
 gcc/config/darwin-driver.cc                   | 11 ++++++-----
 gcc/testsuite/gcc.dg/darwin-minversion-link.c |  1 +
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/gcc/config/darwin-driver.cc b/gcc/config/darwin-driver.cc
index 4235c6191084..d9130863f0ae 100644
--- a/gcc/config/darwin-driver.cc
+++ b/gcc/config/darwin-driver.cc
@@ -64,7 +64,7 @@ validate_macosx_version_min (const char *version_str)
 
   major = strtoul (version_str, &end, 10);
 
-  /* macOS 10, 11, 12, 13, 14, 15 and 26 are known.
+  /* macOS 10 to 15 and 26 upwards are known.
      clang accepts up to 99.  */
   if (major < 10 || major > 99)
     return NULL;
@@ -160,15 +160,16 @@ darwin_find_version_from_kernel (void)
   if (*version_p++ != '.')
     goto parse_failed;
 
-  /* Darwin25 saw a transition to macOS 26.  */
-  if (major_vers >= 25)
+  /* macOS 27 aligned version number with Darwin27.  */
+  if (major_vers >= 27)
     /* Apple clang doesn't include the minor version or the patch level
        in the object file, nor does it pass it to ld  */
+    asprintf (&new_flag, "%d.00.00", major_vers);
+  /* Darwin25 saw a transition to macOS 26.  */
+  else if (major_vers >= 25)
     asprintf (&new_flag, "%d.00.00", major_vers + 1);
   /* Darwin20 saw a transition to macOS 11.  */
   else if (major_vers >= 20)
-    /* Apple clang doesn't include the minor version or the patch level
-       in the object file, nor does it pass it to ld  */
     asprintf (&new_flag, "%d.00.00", major_vers - 9);
   else if (major_vers - 4 <= 4)
     /* On 10.4 and earlier, the old linker is used which does not
diff --git a/gcc/testsuite/gcc.dg/darwin-minversion-link.c 
b/gcc/testsuite/gcc.dg/darwin-minversion-link.c
index 55f7c7ea8374..bf974c5bc087 100644
--- a/gcc/testsuite/gcc.dg/darwin-minversion-link.c
+++ b/gcc/testsuite/gcc.dg/darwin-minversion-link.c
@@ -21,6 +21,7 @@
 /* { dg-additional-options "-mmacosx-version-min=014.000.00 -DCHECK=140000" { 
target *-*-darwin23* } } */
 /* { dg-additional-options "-mmacosx-version-min=015.000.00 -DCHECK=150000" { 
target *-*-darwin24* } } */
 /* { dg-additional-options "-mmacosx-version-min=026.000.00 -DCHECK=260000" { 
target *-*-darwin25* } } */
+/* { dg-additional-options "-mmacosx-version-min=027.000.00 -DCHECK=270000" { 
target *-*-darwin27* } } */
 
 int
 main ()

Reply via email to