summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabian Groffen <grobian@gentoo.org>2012-06-11 18:06:41 +0000
committerFabian Groffen <grobian@gentoo.org>2012-06-11 18:06:41 +0000
commitb88381cacb0db4768a90218019913915be62501c (patch)
tree329b5521adb45016caccdcac74dc4f735f4d6d04 /sys-devel/gcc-apple
parentVersion bump (diff)
downloadgentoo-2-b88381cacb0db4768a90218019913915be62501c.tar.gz
gentoo-2-b88381cacb0db4768a90218019913915be62501c.tar.bz2
gentoo-2-b88381cacb0db4768a90218019913915be62501c.zip
Revbump for patch from Heiko Przybyl to accept -arch argument to gcc if it matches the toolchain default target
(Portage version: 2.2.01.20430-prefix/cvs/Darwin i386)
Diffstat (limited to 'sys-devel/gcc-apple')
-rw-r--r--sys-devel/gcc-apple/ChangeLog12
-rw-r--r--sys-devel/gcc-apple/files/gcc-apple-4.2.1-arch-option.patch57
-rw-r--r--sys-devel/gcc-apple/gcc-apple-4.2.1_p5666-r1.ebuild (renamed from sys-devel/gcc-apple/gcc-apple-4.2.1_p5666.ebuild)9
3 files changed, 74 insertions, 4 deletions
diff --git a/sys-devel/gcc-apple/ChangeLog b/sys-devel/gcc-apple/ChangeLog
index f98dfd60115e..fa965845f19a 100644
--- a/sys-devel/gcc-apple/ChangeLog
+++ b/sys-devel/gcc-apple/ChangeLog
@@ -1,6 +1,14 @@
# ChangeLog for sys-devel/gcc-apple
-# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc-apple/ChangeLog,v 1.21 2011/12/06 19:57:09 grobian Exp $
+# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc-apple/ChangeLog,v 1.22 2012/06/11 18:06:40 grobian Exp $
+
+*gcc-apple-4.2.1_p5666-r1 (11 Jun 2012)
+
+ 11 Jun 2012; Fabian Groffen <grobian@gentoo.org>
+ +files/gcc-apple-4.2.1-arch-option.patch, +gcc-apple-4.2.1_p5666-r1.ebuild,
+ -gcc-apple-4.2.1_p5666.ebuild:
+ Revbump for patch from Heiko Przybyl to accept -arch argument to gcc if it
+ matches the toolchain default target
06 Dec 2011; Fabian Groffen <grobian@gentoo.org>
gcc-apple-4.0.1_p5490-r2.ebuild, gcc-apple-4.0.1_p5493.ebuild,
diff --git a/sys-devel/gcc-apple/files/gcc-apple-4.2.1-arch-option.patch b/sys-devel/gcc-apple/files/gcc-apple-4.2.1-arch-option.patch
new file mode 100644
index 000000000000..94abba89306c
--- /dev/null
+++ b/sys-devel/gcc-apple/files/gcc-apple-4.2.1-arch-option.patch
@@ -0,0 +1,57 @@
+Description: Add dummy -arch option with simplistic check.
+Author: Heiko Przybyl <zuxez@cs.tu-berlin.de>
+
+diff -pruN gcc-5664.orig/gcc/gcc.c gcc-5664/gcc/gcc.c
+--- gcc-5664.orig/gcc/gcc.c 2010-09-21 22:28:11.000000000 +0200
++++ gcc-5664/gcc/gcc.c 2010-09-21 22:28:24.000000000 +0200
+@@ -88,6 +88,8 @@ compilation is specified by a string cal
+ #include "flags.h"
+ #include "opts.h"
+
++#include <mach-o/arch.h>
++
+ /* By default there is no special suffix for target executables. */
+ /* FIXME: when autoconf is fixed, remove the host check - dj */
+ #if defined(TARGET_EXECUTABLE_SUFFIX) && defined(HOST_EXECUTABLE_SUFFIX)
+--- gcc-5664/gcc/gcc.c.orig 2010-09-22 01:30:04.000000000 +0200
++++ gcc-5664/gcc/gcc.c 2010-09-22 01:36:52.000000000 +0200
+@@ -1401,6 +1401,39 @@ translate_options (int *argcp, const cha
+ nskip += 1;
+ else if (! strcmp (p, "Xassembler"))
+ nskip += 1;
++ /* GENTOO_PORTAGE Allow but filter -arch. */
++ if (! strcmp (p, "arch")) {
++ if (i + 1 == argc)
++ fatal ("argument to `-arch' is missing");
++ /* Check current arch vs. given arch if possible. */
++ const NXArchInfo *ai = NXGetLocalArchInfo();
++ if (ai) {
++ /* Returns the most generic setting */
++ /* aka "i386", "x86_64", "ppc", "ppc64", "arm". */
++ const NXArchInfo *gai = NXGetArchInfoFromCpuType(ai->cputype, CPU_SUBTYPE_MULTIPLE);
++ if (gai) {
++ const char *name = gai->name;
++#ifdef __LP64__
++ /* Make sure x64 on 32bit kernel is set correctly. */
++ if (gai->cputype == CPU_TYPE_I386) {
++ name = "x86_64";
++ }
++ else if (gai->cputype == CPU_TYPE_POWERPC) {
++ name = "ppc64";
++ }
++#endif
++ if (strcmp(name, argv[i + 1]) != 0) {
++ fatal ("`-arch %s' does not match current compiler arch `%s'",
++ argv[i + 1], name);
++ }
++ }
++ }
++
++ /* Skip argument. */
++ i += 2;
++ /* Don't add option to the new env. */
++ nskip = 0;
++ }
+
+ /* Watch out for an option at the end of the command line that
+ is missing arguments, and avoid skipping past the end of the
diff --git a/sys-devel/gcc-apple/gcc-apple-4.2.1_p5666.ebuild b/sys-devel/gcc-apple/gcc-apple-4.2.1_p5666-r1.ebuild
index 59b282a26105..f7e11b09e370 100644
--- a/sys-devel/gcc-apple/gcc-apple-4.2.1_p5666.ebuild
+++ b/sys-devel/gcc-apple/gcc-apple-4.2.1_p5666-r1.ebuild
@@ -1,6 +1,6 @@
-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2012 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.ebuild,v 1.3 2011/12/06 19:57:09 grobian Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc-apple/gcc-apple-4.2.1_p5666-r1.ebuild,v 1.1 2012/06/11 18:06:40 grobian Exp $
EAPI="3"
@@ -99,8 +99,13 @@ src_prepare() {
sed -i -e "s:tail +16c:tail -c +16:g" \
gcc/Makefile.in || die "sed gcc/Makefile.in failed."
+ # default to AltiVec on PPC, like for older releases
epatch "${FILESDIR}"/${PN}-4.0.1_p5465-default-altivec.patch
+ # support -arch XXX if XXX is actually what the toolchain targets because
+ # some upstreams insist on setting it
+ epatch "${FILESDIR}"/${PN}-4.2.1-arch-option.patch
+
# dsymutil stuff breaks on 10.4/x86, revert it
[[ ${CHOST} == *86*-apple-darwin8 ]] && \
epatch "${FILESDIR}"/${PN}-${GCC_VERS}-dsymutil.patch