summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabian Groffen <grobian@gentoo.org>2015-01-31 16:15:23 +0000
committerFabian Groffen <grobian@gentoo.org>2015-01-31 16:15:23 +0000
commitab2f6c2564066c7706c5005c024085322e2a18ba (patch)
treea3e42161df047688d6f53abae16bfd4ae0f085a4 /sys-devel/gcc-apple
parentamd64/x86 stable. bug #519280. remove old (diff)
downloadgentoo-2-ab2f6c2564066c7706c5005c024085322e2a18ba.tar.gz
gentoo-2-ab2f6c2564066c7706c5005c024085322e2a18ba.tar.bz2
gentoo-2-ab2f6c2564066c7706c5005c024085322e2a18ba.zip
Update darwin14 patch with much better approach by Michael Weisner, not revbumping because darwin14 bootstrapping should be broken anyway
(Portage version: 2.2.14-prefix/cvs/SunOS i386, signed Manifest commit with key 0x5F75F607C5C74E89)
Diffstat (limited to 'sys-devel/gcc-apple')
-rw-r--r--sys-devel/gcc-apple/ChangeLog9
-rw-r--r--sys-devel/gcc-apple/files/gcc-apple-4.2.1_p5666-darwin14.patch167
-rw-r--r--sys-devel/gcc-apple/gcc-apple-4.2.1_p5666-r2.ebuild9
3 files changed, 140 insertions, 45 deletions
diff --git a/sys-devel/gcc-apple/ChangeLog b/sys-devel/gcc-apple/ChangeLog
index 3bbafdf7e050..c61e480da7e1 100644
--- a/sys-devel/gcc-apple/ChangeLog
+++ b/sys-devel/gcc-apple/ChangeLog
@@ -1,6 +1,11 @@
# ChangeLog for sys-devel/gcc-apple
-# Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc-apple/ChangeLog,v 1.30 2014/11/23 15:37:36 redlizard Exp $
+# Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc-apple/ChangeLog,v 1.31 2015/01/31 16:15:23 grobian Exp $
+
+ 31 Jan 2015; Fabian Groffen <grobian@gentoo.org>
+ files/gcc-apple-4.2.1_p5666-darwin14.patch, gcc-apple-4.2.1_p5666-r2.ebuild:
+ Update darwin14 patch with much better approach by Michael Weisner, not
+ revbumping because darwin14 bootstrapping should be broken anyway
23 Nov 2014; redlizard <redlizard@gentoo.org> gcc-apple-4.2.1_p5666-r2.ebuild:
Change the portage-2.2.14 dependency to a blocker, as the upgrade needs to
diff --git a/sys-devel/gcc-apple/files/gcc-apple-4.2.1_p5666-darwin14.patch b/sys-devel/gcc-apple/files/gcc-apple-4.2.1_p5666-darwin14.patch
index a06c78365578..fb785b0ad9c4 100644
--- a/sys-devel/gcc-apple/files/gcc-apple-4.2.1_p5666-darwin14.patch
+++ b/sys-devel/gcc-apple/files/gcc-apple-4.2.1_p5666-darwin14.patch
@@ -1,43 +1,16 @@
-Darwin 14 is 10.10, but the encoding scheme doesn't allow this, so
-encode everything from Darwin 14 and up as 10.9.
+https://537826.bugs.gentoo.org/attachment.cgi?id=394896
+https://bugs.gentoo.org/show_bug.cgi?id=537826
+Michael Weiser
-Darwin 14 has some newer preprocessor stuff in its headers, work around
-that.
+Backport of https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=218873 (as
+per https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61407) to correctly encode Mac
+OS X versions >10.9 into __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__.
+Extended to also encode patch level the way clang and Apple GCC 4.2.1 do.
+
+https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63810 has a much more generic
+patch. But it's not yet in-tree pending legal paperwork. Once that's done, we
+can backport that.
---- gcc/config/darwin-c.c
-+++ gcc/config/darwin-c.c
-@@ -945,6 +945,11 @@
- result[2] = darwin_macosx_version_min[3];
- if (darwin_macosx_version_min[4] != '\0')
- {
-+ if (ISDIGIT(darwin_macosx_version_min[4]))
-+ {
-+ result[2] = '9'; /* latest version we can encode */
-+ result[3] = '0';
-+ } else {
- if (darwin_macosx_version_min[4] != '.')
- goto fail;
- if (! ISDIGIT (darwin_macosx_version_min[5]))
-@@ -952,6 +956,7 @@
- if (darwin_macosx_version_min[6] != '\0')
- goto fail;
- result[3] = darwin_macosx_version_min[5];
-+ }
- }
- else
- result[3] = '0';
---- gcc/config/darwin-driver.c
-+++ gcc/config/darwin-driver.c
-@@ -174,8 +174,8 @@
- version_p = osversion + 1;
- if (ISDIGIT (*version_p))
- major_vers = major_vers * 10 + (*version_p++ - '0');
- if (major_vers > 4 + 9)
-- goto parse_failed;
-+ major_vers = 4 + 9;
- if (*version_p++ != '.')
- goto parse_failed;
- version_pend = strchr(version_p, '.');
--- gcc/libgcov.c
+++ gcc/libgcov.c
@@ -34,6 +34,14 @@
@@ -55,3 +28,121 @@ that.
/* APPLE LOCAL begin instant off 6414141 */
#if defined(__APPLE__) && !defined(__STATIC__) && !defined(__ppc__) && !defined(__ppc64__) && !defined(__arm__)
#include <vproc.h>
+--- gcc/config/darwin-driver.c.orig 2010-10-14 22:27:53.000000000 +0200
++++ gcc/config/darwin-driver.c 2015-01-25 21:15:09.000000000 +0100
+@@ -174,8 +174,6 @@
+ version_p = osversion + 1;
+ if (ISDIGIT (*version_p))
+ major_vers = major_vers * 10 + (*version_p++ - '0');
+- if (major_vers > 4 + 9)
+- goto parse_failed;
+ if (*version_p++ != '.')
+ goto parse_failed;
+ version_pend = strchr(version_p, '.');
+--- gcc/config/darwin-c.c.orig 2015-01-25 19:44:40.000000000 +0100
++++ gcc/config/darwin-c.c 2015-01-25 21:05:47.000000000 +0100
+@@ -930,31 +930,91 @@
+
+ /* Return the value of darwin_macosx_version_min suitable for the
+ __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ macro,
+- so '10.4.2' becomes 1042.
++ so '10.4.2' becomes 1042 and '10.10.2' becomes 101002.
++ Cap patch level to 9 in the old format.
+ Print a warning if the version number is not known. */
+ static const char *
+ /* APPLE LOCAL ARM 5683689 */
+ macosx_version_as_macro (void)
+ {
+- static char result[] = "1000";
++ static char result[7] = "1000";
++ int inputindex = 3, outputindex = 2;
+
++ /* make sure version starts with "10." - makes sure we can safely start
++ * parsing at inputindex == 3 */
+ if (strncmp (darwin_macosx_version_min, "10.", 3) != 0)
+ goto fail;
++
++ /* first character of minor version needs to be digit */
+ if (! ISDIGIT (darwin_macosx_version_min[3]))
+ goto fail;
+- result[2] = darwin_macosx_version_min[3];
+- if (darwin_macosx_version_min[4] != '\0')
++
++ result[outputindex++] = darwin_macosx_version_min[inputindex++];
++
++ if (ISDIGIT (darwin_macosx_version_min[inputindex])) {
++ /* Starting with OS X 10.10, the macro ends '00' rather than '0',
++ i.e. 10.10.x becomes 101000 rather than 10100. */
++ result[outputindex++] = darwin_macosx_version_min[inputindex++];
++ result[4] = '0';
++ result[5] = '0';
++ result[6] = '\0';
++ }
++
++ /* if we're out of input, leave patch level at 0 or 00 and finish */
++ if (darwin_macosx_version_min[inputindex] == '\0')
++ return result;
++
++ /* a dot *must* follow now */
++ if (darwin_macosx_version_min[inputindex++] != '.')
++ goto fail;
++
++ /* a digit must follow after the dot */
++ if (! ISDIGIT (darwin_macosx_version_min[inputindex]))
++ goto fail;
++
++ /* old-style macro */
++ if (outputindex == 3)
++ {
++ /* one-digit patch level */
++ if (darwin_macosx_version_min[inputindex + 1] == '\0')
+ {
+- if (darwin_macosx_version_min[4] != '.')
+- goto fail;
+- if (! ISDIGIT (darwin_macosx_version_min[5]))
+- goto fail;
+- if (darwin_macosx_version_min[6] != '\0')
+- goto fail;
+- result[3] = darwin_macosx_version_min[5];
++ result[outputindex] = darwin_macosx_version_min[inputindex];
++ return result;
+ }
+- else
+- result[3] = '0';
++
++ inputindex++;
++ if (! ISDIGIT (darwin_macosx_version_min[inputindex++]))
++ goto fail;
++
++ /* three digits? */
++ if (darwin_macosx_version_min[inputindex] != '\0')
++ goto fail;
++
++ /* no room for another digit. Traditional Apple GCC 4.2.1 doesn't accept
++ * it but current clang caps it to 9. We choose to be in line with clang. */
++ result[outputindex] = '9';
++ return result;
++ }
++
++ /* new-style macro */
++
++ /* leave a leading zero if only one digit is following */
++ if (darwin_macosx_version_min[inputindex + 1] == '\0') {
++ result[outputindex + 1] = darwin_macosx_version_min[inputindex];
++ return result;
++ }
++
++ result[outputindex++] = darwin_macosx_version_min[inputindex++];
++
++ /* a digit must follow now */
++ if (! ISDIGIT (darwin_macosx_version_min[inputindex]))
++ goto fail;
++
++ result[outputindex] = darwin_macosx_version_min[inputindex++];
++
++ /* no more input allowed */
++ if (darwin_macosx_version_min[inputindex] != '\0')
++ goto fail;
+
+ return result;
+
diff --git a/sys-devel/gcc-apple/gcc-apple-4.2.1_p5666-r2.ebuild b/sys-devel/gcc-apple/gcc-apple-4.2.1_p5666-r2.ebuild
index 50c104a9a85d..17f18efe1de9 100644
--- a/sys-devel/gcc-apple/gcc-apple-4.2.1_p5666-r2.ebuild
+++ b/sys-devel/gcc-apple/gcc-apple-4.2.1_p5666-r2.ebuild
@@ -1,6 +1,6 @@
-# Copyright 1999-2014 Gentoo Foundation
+# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc-apple/gcc-apple-4.2.1_p5666-r2.ebuild,v 1.2 2014/11/23 15:37:36 redlizard Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc-apple/gcc-apple-4.2.1_p5666-r2.ebuild,v 1.3 2015/01/31 16:15:23 grobian Exp $
EAPI="3"
@@ -119,9 +119,8 @@ src_prepare() {
[[ ${CHOST} == *86*-apple-darwin8 ]] && \
epatch "${FILESDIR}"/${PN}-${GCC_VERS}-dsymutil.patch
- # Pseudo-support OS X 10.10
- [[ ${CHOST} == *-darwin14 ]] && \
- epatch "${FILESDIR}"/${P}-darwin14.patch
+ # support OS X 10.10
+ epatch "${FILESDIR}"/${P}-darwin14.patch
# bootstrapping might fail with host provided gcc on 10.4/x86
if ! is_crosscompile && ! echo "int main(){return 0;}" | gcc -o "${T}"/foo \