<pre style='margin:0'>
Zhenfu Shi (i0ntempest) pushed a commit to branch master
in repository macports-ports.
</pre>
<p><a href="https://github.com/macports/macports-ports/commit/0db7a7a184f6a5fcb6f4481a80271f401beaaf68">https://github.com/macports/macports-ports/commit/0db7a7a184f6a5fcb6f4481a80271f401beaaf68</a></p>
<pre style="white-space: pre; background: #F8F8F8">The following commit(s) were added to refs/heads/master by this push:
<span style='display:block; white-space:pre;color:#404040;'> new 0db7a7a184f gcc9: port darwin 21 fixes from gcc10
</span>0db7a7a184f is described below
<span style='display:block; white-space:pre;color:#808000;'>commit 0db7a7a184f6a5fcb6f4481a80271f401beaaf68
</span>Author: i0ntempest <szf1234@me.com>
AuthorDate: Thu Apr 28 17:46:27 2022 -0400
<span style='display:block; white-space:pre;color:#404040;'> gcc9: port darwin 21 fixes from gcc10
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> Closes: https://trac.macports.org/ticket/64316
</span>---
lang/gcc9/Portfile | 7 +++++
lang/gcc9/files/patch-darwin21-support.diff | 48 +++++++++++++++++++++++++++++
lang/gcc9/files/patch-genconditions.diff | 32 +++++++++++++++++++
3 files changed, 87 insertions(+)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/lang/gcc9/Portfile b/lang/gcc9/Portfile
</span><span style='display:block; white-space:pre;color:#808080;'>index 14d1adfe430..b7e60e82d89 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/lang/gcc9/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/lang/gcc9/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -41,6 +41,13 @@ checksums rmd160 1787505ca3a6ea6129c85a3e48a7798a77d324f1 \
</span>
patchfiles patch-fix-libgccjit-soname
<span style='display:block; white-space:pre;background:#e0ffe0;'>+patchfiles-append patch-darwin21-support.diff
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+if { ${os.platform} eq "darwin" && ${os.major} > 19 } {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92061
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ patchfiles-append patch-genconditions.diff
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> if { ${configure.build_arch} eq "i386" } {
# fix no-pie clang bug bootstrapping gcc on i386
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/lang/gcc9/files/patch-darwin21-support.diff b/lang/gcc9/files/patch-darwin21-support.diff
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 00000000000..4b26323bc09
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/lang/gcc9/files/patch-darwin21-support.diff
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,48 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/gcc/config/darwin-c.c b/gcc/config/darwin-c.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 951a998775f83e16ed6c11963e6e9eb1286c51a7..62d28fcea501bbcb9eb403c74793af45eb91ca7f 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- gcc/config/darwin-c.c.orig
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ gcc/config/darwin-c.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -691,7 +691,7 @@ macosx_version_as_macro (void)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (!version_array)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ goto fail;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (version_array[MAJOR] < 10 || version_array[MAJOR] > 11)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (version_array[MAJOR] < 10 || version_array[MAJOR] > 12)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ goto fail;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (version_array[MAJOR] == 10 && version_array[MINOR] < 10)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/gcc/config/darwin-driver.c b/gcc/config/darwin-driver.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 0b86bb6faf7ca246afd23d43f716242f3d802123..3e02d003cd19dabc9518e21655586768feae6756 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- gcc/config/darwin-driver.c.orig
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ gcc/config/darwin-driver.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -64,17 +64,17 @@ validate_macosx_version_min (const char *version_str)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ major = strtoul (version_str, &end, 10);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (major < 10 || major > 11 ) /* MacOS 10 and 11 are known. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (major < 10 || major > 12 ) /* macOS 10, 11, and 12 are known. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* Skip a separating period, if there's one. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ version_str = end + ((*end == '.') ? 1 : 0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (major == 11 && *end != '\0' && !ISDIGIT (version_str[0]))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- /* For MacOS 11, we allow just the major number, but if the minor is
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (major > 10 && *end != '\0' && !ISDIGIT (version_str[0]))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* For macOS 11+, we allow just the major number, but if the minor is
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ there it must be numeric. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- else if (major == 11 && *end == '\0')
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else if (major > 10 && *end == '\0')
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* We will rewrite 11 => 11.0.0. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ need_rewrite = true;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ else if (major == 10 && (*end == '\0' || !ISDIGIT (version_str[0])))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -172,7 +172,7 @@ darwin_find_version_from_kernel (void)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (minor_vers > 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ minor_vers -= 1; /* Kernel 20.3 => macOS 11.2. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* It's not yet clear whether patch level will be considered. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- asprintf (&new_flag, "11.%02d.00", minor_vers);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ asprintf (&new_flag, "%d.%02d.00", major_vers - 9, minor_vers);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ else if (major_vers - 4 <= 4)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* On 10.4 and earlier, the old linker is used which does not
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/lang/gcc9/files/patch-genconditions.diff b/lang/gcc9/files/patch-genconditions.diff
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 00000000000..45d19841de6
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/lang/gcc9/files/patch-genconditions.diff
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,32 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- gcc/genconditions.c 2019-01-01 12:37:19.064943662 +0100
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ gcc/genconditions.c 2019-10-11 10:57:11.464595789 +0200
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -57,8 +57,9 @@ write_header (void)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ \n\
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* It is necessary, but not entirely safe, to include the headers below\n\
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ in a generator program. As a defensive measure, don't do so when the\n\
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- table isn't going to have anything in it. */\n\
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if GCC_VERSION >= 3001\n\
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ table isn't going to have anything in it.\n\
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ Clang 9 is buggy and doesn't handle __builtin_constant_p correctly. */\n\
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if GCC_VERSION >= 3001 && __clang_major__ < 9\n\
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ \n\
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* Do not allow checking to confuse the issue. */\n\
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #undef CHECKING_P\n\
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -170,7 +171,7 @@ struct c_test\n\
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ vary at run time. It works in 3.0.1 and later; 3.0 only when not\n\
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ optimizing. */\n\
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ \n\
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if GCC_VERSION >= 3001\n\
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if GCC_VERSION >= 3001 && __clang_major__ < 9\n\
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ static const struct c_test insn_conditions[] = {\n");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ traverse_c_tests (write_one_condition, 0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -191,7 +192,7 @@ write_writer (void)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ " unsigned int i;\n"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ " const char *p;\n"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ " puts (\"(define_conditions [\");\n"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "#if GCC_VERSION >= 3001\n"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "#if GCC_VERSION >= 3001 && __clang_major__ < 9\n"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ " for (i = 0; i < ARRAY_SIZE (insn_conditions); i++)\n"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ " {\n"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ " printf (\" (%d \\\"\", insn_conditions[i].value);\n"
</span></pre><pre style='margin:0'>
</pre>