<pre style='margin:0'>
Chris Jones (cjones051073) pushed a commit to branch master
in repository macports-ports.
</pre>
<p><a href="https://github.com/macports/macports-ports/commit/cd4c1c9bb392cf1e19922cac9246262e5e06990b">https://github.com/macports/macports-ports/commit/cd4c1c9bb392cf1e19922cac9246262e5e06990b</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit cd4c1c9bb392cf1e19922cac9246262e5e06990b
</span>Author: Chris Jones <jonesc@macports.org>
AuthorDate: Wed Nov 18 16:18:31 2020 +0000
<span style='display:block; white-space:pre;color:#404040;'> (lib)gcc9: Add patch to support compilation on macOS 11.0
</span>---
lang/gcc9/Portfile | 9 ++++
lang/gcc9/files/big-sur-version-fix.diff | 75 ++++++++++++++++++++++++++++++++
2 files changed, 84 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 c022e926124..3839b2dc53b 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;'>@@ -40,6 +40,15 @@ checksums rmd160 e0ade31726b8fbb1eb308e2b1383a79633aef996 \
</span>
patchfiles patch-fix-libgccjit-soname
<span style='display:block; white-space:pre;background:#e0ffe0;'>+if { ${os.major} > 19 } {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # https://trac.macports.org/ticket/60908
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # Patch for macOS 11 (Darwin20) version numbering taken from
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # https://github.com/iains/gcc-darwin-arm64/commit/556ab512
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ patchfiles-append big-sur-version-fix.diff
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # Build doesn't understand a 11.0 deployment target so force to 10.16
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ macosx_deployment_target 10.16
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> depends_lib port:cctools \
port:gmp \
path:lib/pkgconfig/isl.pc:isl \
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/lang/gcc9/files/big-sur-version-fix.diff b/lang/gcc9/files/big-sur-version-fix.diff
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 00000000000..0de7fc281dd
</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/big-sur-version-fix.diff
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,75 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff -pur gcc-10.2.0-old/gcc/config/darwin-c.c gcc-10.2.0/gcc/config/darwin-c.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- gcc/config/darwin-c.c.orig 2020-07-23 08:35:17.000000000 +0200
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ gcc/config/darwin-c.c 2020-11-14 22:40:53.000000000 +0100
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -692,10 +692,10 @@ 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)
</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;'>+ 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[MINOR] < 10)
</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;'>+ version_macro = version_as_legacy_macro (version_array);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ version_macro = version_as_modern_macro (version_array);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff -pur gcc-10.2.0-old/gcc/config/darwin-driver.c gcc-10.2.0/gcc/config/darwin-driver.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- gcc/config/darwin-driver.c.orig 2020-07-23 08:35:17.000000000 +0200
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ gcc/config/darwin-driver.c 2020-11-14 22:40:53.000000000 +0100
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -65,7 +65,7 @@ validate_macosx_version_min (const char
</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;'>+ 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 != 10) /* So far .. all MacOS 10 ... */
</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;'>+ return NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* Version string components must be present and numeric. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -104,7 +104,7 @@ validate_macosx_version_min (const char
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (need_rewrite)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ char *new_version;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- asprintf (&new_version, "10.%lu.%lu", minor, tiny);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ asprintf (&new_version, "%2lu.%lu.%lu", major, minor, tiny);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return new_version;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -115,6 +115,12 @@ validate_macosx_version_min (const char
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #include <sys/sysctl.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #include "xregex.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++/* Determine the version of the running OS.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ We only look at the first two components (ignoring the patch one) and
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ report NN.MM.0 where NN is currently either 10 or 11 and MM is the OS
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ minor release number.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ If we can't parse what the kernel gives us, warn the user, and do nothing. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ static char *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ darwin_find_version_from_kernel (void)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -125,8 +131,6 @@ darwin_find_version_from_kernel (void)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ char * version_p;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ char * new_flag;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- /* Determine the version of the running OS. If we can't, warn user,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- and do nothing. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (sysctl (osversion_name, ARRAY_SIZE (osversion_name), osversion,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ &osversion_len, NULL, 0) == -1)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -144,10 +148,11 @@ darwin_find_version_from_kernel (void)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ major_vers = major_vers * 10 + (*version_p++ - '0');
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (*version_p++ != '.')
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ goto parse_failed;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- /* The major kernel version number is 4 plus the second OS version
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- component. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (major_vers - 4 <= 4)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* Darwin20 sees a transition to macOS 11. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (major_vers >= 20)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ asprintf (&new_flag, "11.%02d.00", major_vers - 20);
</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;background:#e0ffe0;'>+ support three-component system versions.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ FIXME: we should not assume this - a newer linker could be used. */
</span></pre><pre style='margin:0'>
</pre>