<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/e0f8eb70c009bb7e02e7cf9ea644e5236beac548">https://github.com/macports/macports-ports/commit/e0f8eb70c009bb7e02e7cf9ea644e5236beac548</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit e0f8eb70c009bb7e02e7cf9ea644e5236beac548
</span>Author: Chris Jones <jonesc@macports.org>
AuthorDate: Fri Nov 20 10:38:34 2020 +0000
<span style='display:block; white-space:pre;color:#404040;'> (lib)gcc8: Add patches for Darwin20
</span>---
lang/gcc8/Portfile | 12 +++++
lang/gcc8/files/big-sur-version-fix.diff | 75 ++++++++++++++++++++++++++++
lang/gcc8/files/fix-sanitisers-darwin20.diff | 12 +++++
3 files changed, 99 insertions(+)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/lang/gcc8/Portfile b/lang/gcc8/Portfile
</span><span style='display:block; white-space:pre;color:#808080;'>index 0cae2bac863..c22373e6c2e 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/lang/gcc8/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/lang/gcc8/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -45,6 +45,18 @@ set isLastSupported [ expr ${os.major} < 11 ]
</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;'>+ # Fix detection of sanitizer support
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # https://trac.macports.org/ticket/61494
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ patchfiles-append fix-sanitisers-darwin20.diff
</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/gcc8/files/big-sur-version-fix.diff b/lang/gcc8/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/gcc8/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><span style='display:block; white-space:pre;color:#808080;'>diff --git a/lang/gcc8/files/fix-sanitisers-darwin20.diff b/lang/gcc8/files/fix-sanitisers-darwin20.diff
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 00000000000..471a7e8638a
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/lang/gcc8/files/fix-sanitisers-darwin20.diff
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,12 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- libsanitizer/configure.tgt.orig 2020-11-18 18:57:16.000000000 +0000
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ libsanitizer/configure.tgt 2020-11-18 18:57:16.000000000 +0000
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -55,6 +55,9 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ x86_64-*-darwin[1]* | i?86-*-darwin[1]*)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ TSAN_SUPPORTED=no
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ;;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ x86_64-*-darwin2[0-9]* | i?86-*-darwin2[0-9]*)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ TSAN_SUPPORTED=no
</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;'>+ UNSUPPORTED=1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ;;
</span></pre><pre style='margin:0'>
</pre>