From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/proj/prefix:master commit in: sys-devel/gcc/, sys-devel/gcc/files/
Date: Wed, 3 Nov 2021 03:37:27 +0000 (UTC) [thread overview]
Message-ID: <1635910626.2990c38b564bf54bce0454f7c21f21db76628bc8.sam@gentoo> (raw)
commit: 2990c38b564bf54bce0454f7c21f21db76628bc8
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Nov 3 03:37:06 2021 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Nov 3 03:37:06 2021 +0000
URL: https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=2990c38b
sys-devel/gcc: add patch for building on macOS 12 (Monterey)
Signed-off-by: Sam James <sam <AT> gentoo.org>
sys-devel/gcc/files/gcc-10.3.0-monterey.patch | 80 +++++++++++++++++++++++++++
sys-devel/gcc/gcc-10.3.0-r2.ebuild | 2 +
2 files changed, 82 insertions(+)
diff --git a/sys-devel/gcc/files/gcc-10.3.0-monterey.patch b/sys-devel/gcc/files/gcc-10.3.0-monterey.patch
new file mode 100644
index 0000000000..904414dad1
--- /dev/null
+++ b/sys-devel/gcc/files/gcc-10.3.0-monterey.patch
@@ -0,0 +1,80 @@
+https://github.com/macports/macports-ports/blob/573b82fd5df538ea2ad75e2c2373f4727ef3430c/lang/gcc11/files/patch-darwin21-support.diff
+
+From 20f61faaed3b335d792e38892d826054d2ac9f15 Mon Sep 17 00:00:00 2001
+From: Saagar Jha <saagar@saagarjha.com>
+Date: Tue, 15 Jun 2021 04:08:23 -0700
+Subject: [PATCH] Darwin, config: Amend for Darwin 21 / macOS 12.
+
+It seems that the OS major version is now tracking the kernel
+major version - 9. Minor version tracking is unknown.
+
+Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
+Signed-off-by: Saagar Jha <saagar@saagarjha.com>
+
+gcc/ChangeLog:
+
+ * config.gcc: Adjust for Darwin21.
+ * config/darwin-c.c (macosx_version_as_macro): Likewise.
+ * config/darwin-driver.c (validate_macosx_version_min):
+ Likewise.
+ (darwin_find_version_from_kernel): Likewise.
+
+--- a/gcc/config.gcc
++++ b/gcc/config.gcc
+@@ -679,9 +679,9 @@ case ${target} in
+ *-*-darwin[4-9]* | *-*-darwin1[0-9]*)
+ macos_min=`expr $darwin_maj - 4`
+ ;;
+- *-*-darwin20*)
+- # Darwin 20 corresponds to macOS 11.
+- macos_maj=11
++ *-*-darwin2*)
++ # Darwin 20 corresponds to macOS 11, Darwin 21 to macOS 12.
++ macos_maj=`expr $darwin_maj - 9`
+ def_ld64=609.0
+ ;;
+ *-*-darwin)
+--- a/gcc/config/darwin-c.c
++++ b/gcc/config/darwin-c.c
+@@ -691,7 +691,7 @@ macosx_version_as_macro (void)
+ if (!version_array)
+ goto fail;
+
+- if (version_array[MAJOR] < 10 || version_array[MAJOR] > 11)
++ if (version_array[MAJOR] < 10 || version_array[MAJOR] > 12)
+ goto fail;
+
+ if (version_array[MAJOR] == 10 && version_array[MINOR] < 10)
+--- a/gcc/config/darwin-driver.c
++++ b/gcc/config/darwin-driver.c
+@@ -64,17 +64,17 @@ validate_macosx_version_min (const char *version_str)
+
+ major = strtoul (version_str, &end, 10);
+
+- if (major < 10 || major > 11 ) /* MacOS 10 and 11 are known. */
++ if (major < 10 || major > 12 ) /* macOS 10, 11, and 12 are known. */
+ return NULL;
+
+ /* Skip a separating period, if there's one. */
+ version_str = end + ((*end == '.') ? 1 : 0);
+
+- if (major == 11 && *end != '\0' && !ISDIGIT (version_str[0]))
+- /* For MacOS 11, we allow just the major number, but if the minor is
++ if (major > 10 && *end != '\0' && !ISDIGIT (version_str[0]))
++ /* For macOS 11+, we allow just the major number, but if the minor is
+ there it must be numeric. */
+ return NULL;
+- else if (major == 11 && *end == '\0')
++ else if (major > 10 && *end == '\0')
+ /* We will rewrite 11 => 11.0.0. */
+ need_rewrite = true;
+ else if (major == 10 && (*end == '\0' || !ISDIGIT (version_str[0])))
+@@ -172,7 +172,7 @@ darwin_find_version_from_kernel (void)
+ if (minor_vers > 0)
+ minor_vers -= 1; /* Kernel 20.3 => macOS 11.2. */
+ /* It's not yet clear whether patch level will be considered. */
+- asprintf (&new_flag, "11.%02d.00", minor_vers);
++ asprintf (&new_flag, "%d.%02d.00", major_vers - 9, minor_vers);
+ }
+ else if (major_vers - 4 <= 4)
+ /* On 10.4 and earlier, the old linker is used which does not
diff --git a/sys-devel/gcc/gcc-10.3.0-r2.ebuild b/sys-devel/gcc/gcc-10.3.0-r2.ebuild
index b1e30bf1e1..3b0eecc0a4 100644
--- a/sys-devel/gcc/gcc-10.3.0-r2.ebuild
+++ b/sys-devel/gcc/gcc-10.3.0-r2.ebuild
@@ -59,6 +59,8 @@ src_prepare() {
# fix interoperation with Xcode 12.5, bug #799170
eapply -p1 "${FILESDIR}"/${PN}-10.2.0-xcode-12.5.patch
+ # allow building with macOS 12
+ eapply -p1 "${FILESDIR}"/${PN}-10.3.0-monterey.patch
}
src_configure() {
next reply other threads:[~2021-11-03 3:37 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-03 3:37 Sam James [this message]
-- strict thread matches above, loose matches on Subject: below --
2024-12-29 13:33 [gentoo-commits] repo/proj/prefix:master commit in: sys-devel/gcc/, sys-devel/gcc/files/ Fabian Groffen
2024-09-23 19:17 Fabian Groffen
2024-09-19 12:31 Fabian Groffen
2024-03-30 21:48 Fabian Groffen
2024-03-10 19:00 Fabian Groffen
2023-04-29 7:16 Sam James
2021-12-05 13:47 Fabian Groffen
2020-11-24 8:42 Fabian Groffen
2017-09-25 16:39 Michael Haubenwallner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1635910626.2990c38b564bf54bce0454f7c21f21db76628bc8.sam@gentoo \
--to=sam@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox