public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Fabian Groffen" <grobian@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: Tue, 24 Nov 2020 08:42:52 +0000 (UTC)	[thread overview]
Message-ID: <1606207369.ae2fe55112b538d23327e62ef28dfe5e0063b4de.grobian@gentoo> (raw)

commit:     ae2fe55112b538d23327e62ef28dfe5e0063b4de
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Tue Nov 24 08:42:49 2020 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Tue Nov 24 08:42:49 2020 +0000
URL:        https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=ae2fe551

sys-devel/gcc-10.1.0: add patch for macOS Big Sur

Package-Manager: Portage-3.0.10-prefix, Repoman-3.0.2
RepoMan-Options: --force
Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>

 .../files/gcc-10.1.0-darwin-auth-fixincludes.patch |  22 ++++
 sys-devel/gcc/files/gcc-10.1.0-macos-bigsur.patch  | 140 +++++++++++++++++++++
 sys-devel/gcc/gcc-10.1.0-r1.ebuild                 |  19 +--
 3 files changed, 167 insertions(+), 14 deletions(-)

diff --git a/sys-devel/gcc/files/gcc-10.1.0-darwin-auth-fixincludes.patch b/sys-devel/gcc/files/gcc-10.1.0-darwin-auth-fixincludes.patch
new file mode 100644
index 0000000000..d5e100f6c2
--- /dev/null
+++ b/sys-devel/gcc/files/gcc-10.1.0-darwin-auth-fixincludes.patch
@@ -0,0 +1,22 @@
+--- a/fixincludes/inclhack.def
++++ b/fixincludes/inclhack.def
+@@ -1325,6 +1325,19 @@
+ };
+ 
+ /*
++ * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93082
++ */
++fix = {
++    hackname  = darwin_authorization;
++    mach      = "*-*-darwin*";
++    files     = Frameworks/Security.framework/Headers/Authorization.h;
++    select    = "static const size_t kAuthorizationExternalFormLength = 32;\n";
++    c_fix     = format;
++    c_fix_arg = "enum { kAuthorizationExternalFormLength = 32 };\n";
++    test_text = "static const size_t kAuthorizationExternalFormLength = 32;\n";
++};
++
++/*
+  *  For the AAB_darwin7_9_long_double_funcs fix (and later fixes for long long)
+  *  to be useful, the main math.h must use <> and not "" includes.
+  */

diff --git a/sys-devel/gcc/files/gcc-10.1.0-macos-bigsur.patch b/sys-devel/gcc/files/gcc-10.1.0-macos-bigsur.patch
new file mode 100644
index 0000000000..d2bf6a932a
--- /dev/null
+++ b/sys-devel/gcc/files/gcc-10.1.0-macos-bigsur.patch
@@ -0,0 +1,140 @@
+From 556ab5125912fa2233986eb19d6cd995cf7de1d2 Mon Sep 17 00:00:00 2001
+From: Iain Sandoe <iain@sandoe.co.uk>
+Date: Fri, 31 Jul 2020 21:05:28 +0100
+Subject: [PATCH] Darwin: Darwin 20 is to be macOS 11 (Big Sur).
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+As per Nigel Tufnel's assertion "... this one goes to 11".
+
+The various parts of the code that deal with mapping Darwin versions
+to macOS (X) versions need updating to deal with  a major version of
+11.
+
+So now we have, for example:
+
+Darwin  4 => macOS (X) 10.0
+…
+Darwin 14 => macOS (X) 10.10
+...
+Darwin 19 => macOS (X) 10.15
+
+Darwin 20 => macOS  11.0
+
+Because of the historical duplication of the "10" in macOSX 10.xx and
+the number of tools that expect this, it is likely that system tools will
+allow macos11.0 and/or macosx11.0 (despite that the latter makes little
+sense).
+
+Update the link test to cover Catalina (Darwin19/10.15) and
+Big Sur (Darwin20/11.0).
+
+gcc/ChangeLog:
+
+	* config/darwin-c.c: Allow for Darwin20 to correspond to macOS 11.
+	* config/darwin-driver.c: Likewise.
+
+gcc/testsuite/ChangeLog:
+
+	* gcc.dg/darwin-minversion-link.c: Allow for Darwin19 (macOS 10.15)
+	and Darwin20 (macOS 11.0).
+---
+ gcc/config/darwin-c.c                         |  4 ++--
+ gcc/config/darwin-driver.c                    | 21 ++++++++++++-------
+ gcc/testsuite/gcc.dg/darwin-minversion-link.c |  5 +++--
+ 3 files changed, 18 insertions(+), 12 deletions(-)
+
+diff --git a/gcc/config/darwin-c.c b/gcc/config/darwin-c.c
+index e3b999e166b..9034f49908e 100644
+--- a/gcc/config/darwin-c.c
++++ b/gcc/config/darwin-c.c
+@@ -692,10 +692,10 @@ macosx_version_as_macro (void)
+   if (!version_array)
+     goto fail;
+ 
+-  if (version_array[MAJOR] != 10)
++  if (version_array[MAJOR] < 10 || version_array[MAJOR] > 11)
+     goto fail;
+ 
+-  if (version_array[MINOR] < 10)
++  if (version_array[MAJOR] == 10 && version_array[MINOR] < 10)
+     version_macro = version_as_legacy_macro (version_array);
+   else
+     version_macro = version_as_modern_macro (version_array);
+diff --git a/gcc/config/darwin-driver.c b/gcc/config/darwin-driver.c
+index 8fdd32e2858..8ae300057fd 100644
+--- a/gcc/config/darwin-driver.c
++++ b/gcc/config/darwin-driver.c
+@@ -65,7 +65,7 @@ validate_macosx_version_min (const char *version_str)
+   major = strtoul (version_str, &end, 10);
+   version_str = end + ((*end == '.') ? 1 : 0);
+ 
+-  if (major != 10) /* So far .. all MacOS 10 ... */
++  if (major < 10 || major > 11 ) /* MacOS 10 and 11 are known. */
+     return NULL;
+ 
+   /* Version string components must be present and numeric.  */
+@@ -104,7 +104,7 @@ validate_macosx_version_min (const char *version_str)
+   if (need_rewrite)
+     {
+       char *new_version;
+-      asprintf (&new_version, "10.%lu.%lu", minor, tiny);
++      asprintf (&new_version, "%2lu.%lu.%lu", major, minor, tiny);
+       return new_version;
+     }
+ 
+@@ -115,6 +115,12 @@ validate_macosx_version_min (const char *version_str)
+ #include <sys/sysctl.h>
+ #include "xregex.h"
+ 
++/* Determine the version of the running OS.
++   We only look at the first two components (ignoring the patch one) and
++   report NN.MM.0 where NN is currently either 10 or 11 and MM is the OS
++   minor release number.
++   If we can't parse what the kernel gives us, warn the user, and do nothing.  */
++
+ static char *
+ darwin_find_version_from_kernel (void)
+ {
+@@ -125,8 +131,6 @@ darwin_find_version_from_kernel (void)
+   char * version_p;
+   char * new_flag;
+ 
+-  /* Determine the version of the running OS.  If we can't, warn user,
+-     and do nothing.  */
+   if (sysctl (osversion_name, ARRAY_SIZE (osversion_name), osversion,
+ 	      &osversion_len, NULL, 0) == -1)
+     {
+@@ -144,10 +148,11 @@ darwin_find_version_from_kernel (void)
+     major_vers = major_vers * 10 + (*version_p++ - '0');
+   if (*version_p++ != '.')
+     goto parse_failed;
+-  
+-  /* The major kernel version number is 4 plus the second OS version
+-     component.  */
+-  if (major_vers - 4 <= 4)
++
++  /* Darwin20 sees a transition to macOS 11.  */
++  if (major_vers >= 20)
++    asprintf (&new_flag, "11.%02d.00", major_vers - 20);
++  else if (major_vers - 4 <= 4)
+     /* On 10.4 and earlier, the old linker is used which does not
+        support three-component system versions.
+        FIXME: we should not assume this - a newer linker could be used.  */
+diff --git a/gcc/testsuite/gcc.dg/darwin-minversion-link.c b/gcc/testsuite/gcc.dg/darwin-minversion-link.c
+index 0a80048ba35..765fb799a91 100644
+--- a/gcc/testsuite/gcc.dg/darwin-minversion-link.c
++++ b/gcc/testsuite/gcc.dg/darwin-minversion-link.c
+@@ -13,8 +13,9 @@
+ /* { dg-additional-options "-mmacosx-version-min=010.011.06 -DCHECK=101106" { target *-*-darwin15* } } */
+ /* { dg-additional-options "-mmacosx-version-min=010.012.06 -DCHECK=101206" { target *-*-darwin16* } } */
+ /* { dg-additional-options "-mmacosx-version-min=010.013.06 -DCHECK=101306" { target *-*-darwin17* } } */
+-/* This next test covers 10.18 and (currently unreleased) 10.19 for now. */  
+-/* { dg-additional-options "-mmacosx-version-min=010.014.05 -DCHECK=101405" { target *-*-darwin1[89]* } } */
++/* { dg-additional-options "-mmacosx-version-min=010.014.05 -DCHECK=101405" { target *-*-darwin18* } } */
++/* { dg-additional-options "-mmacosx-version-min=010.015.06 -DCHECK=101506" { target *-*-darwin19* } } */
++/* { dg-additional-options "-mmacosx-version-min=011.000.00 -DCHECK=110000" { target *-*-darwin20 } } */
+ 
+ int
+ main ()

diff --git a/sys-devel/gcc/gcc-10.1.0-r1.ebuild b/sys-devel/gcc/gcc-10.1.0-r1.ebuild
index 4acd295e38..58dd0971ca 100644
--- a/sys-devel/gcc/gcc-10.1.0-r1.ebuild
+++ b/sys-devel/gcc/gcc-10.1.0-r1.ebuild
@@ -45,20 +45,11 @@ src_prepare() {
 			libgcc/config/t-slibgcc-darwin || die
 	fi
 
-	# for Darwin, allow compilation of anything using Authorization
-	# Framework (e.g. gnutls)
-	cat >> fixincludes/inclhack.def <<- EOF
-		/* https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93082 */
-		fix = {
-			hackname  = darwin_authorization;
-			mach      = "*-*-darwin*";
-			files     = Frameworks/Security.framework/Headers/Authorization.h;
-			select    = "static const size_t kAuthorizationExternalFormLength = 32;\n";
-			c_fix     = format;
-			c_fix_arg = "enum { kAuthorizationExternalFormLength = 32 };\n";
-			test_text = "static const size_t kAuthorizationExternalFormLength = 32;\n";
-		};
-	EOF
+	# fix for Big Sur versioning, remove with 11
+	eapply -p1 "${FILESDIR}"/${PN}-10.1.0-macos-bigsur.patch
+
+	# fix complaint about Authorization Framework
+	eapply -p1 "${FILESDIR}"/${PN}-10.1.0-darwin-auth-fixincludes.patch
 
 	eapply_user
 }


             reply	other threads:[~2020-11-24  8:42 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-24  8:42 Fabian Groffen [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
2021-11-03  3:37 Sam James
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=1606207369.ae2fe55112b538d23327e62ef28dfe5e0063b4de.grobian@gentoo \
    --to=grobian@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