/[gentoo-x86]/sys-devel/gcc-apple/files/gcc-apple-4.2.1-arch-option.patch
Gentoo

Contents of /sys-devel/gcc-apple/files/gcc-apple-4.2.1-arch-option.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Mon Jun 11 18:06:41 2012 UTC (5 years, 3 months ago) by grobian
Branch: MAIN
CVS Tags: HEAD
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)

1 Description: Add dummy -arch option with simplistic check.
2 Author: Heiko Przybyl <zuxez@cs.tu-berlin.de>
3
4 diff -pruN gcc-5664.orig/gcc/gcc.c gcc-5664/gcc/gcc.c
5 --- gcc-5664.orig/gcc/gcc.c 2010-09-21 22:28:11.000000000 +0200
6 +++ gcc-5664/gcc/gcc.c 2010-09-21 22:28:24.000000000 +0200
7 @@ -88,6 +88,8 @@ compilation is specified by a string cal
8 #include "flags.h"
9 #include "opts.h"
10
11 +#include <mach-o/arch.h>
12 +
13 /* By default there is no special suffix for target executables. */
14 /* FIXME: when autoconf is fixed, remove the host check - dj */
15 #if defined(TARGET_EXECUTABLE_SUFFIX) && defined(HOST_EXECUTABLE_SUFFIX)
16 --- gcc-5664/gcc/gcc.c.orig 2010-09-22 01:30:04.000000000 +0200
17 +++ gcc-5664/gcc/gcc.c 2010-09-22 01:36:52.000000000 +0200
18 @@ -1401,6 +1401,39 @@ translate_options (int *argcp, const cha
19 nskip += 1;
20 else if (! strcmp (p, "Xassembler"))
21 nskip += 1;
22 + /* GENTOO_PORTAGE Allow but filter -arch. */
23 + if (! strcmp (p, "arch")) {
24 + if (i + 1 == argc)
25 + fatal ("argument to `-arch' is missing");
26 + /* Check current arch vs. given arch if possible. */
27 + const NXArchInfo *ai = NXGetLocalArchInfo();
28 + if (ai) {
29 + /* Returns the most generic setting */
30 + /* aka "i386", "x86_64", "ppc", "ppc64", "arm". */
31 + const NXArchInfo *gai = NXGetArchInfoFromCpuType(ai->cputype, CPU_SUBTYPE_MULTIPLE);
32 + if (gai) {
33 + const char *name = gai->name;
34 +#ifdef __LP64__
35 + /* Make sure x64 on 32bit kernel is set correctly. */
36 + if (gai->cputype == CPU_TYPE_I386) {
37 + name = "x86_64";
38 + }
39 + else if (gai->cputype == CPU_TYPE_POWERPC) {
40 + name = "ppc64";
41 + }
42 +#endif
43 + if (strcmp(name, argv[i + 1]) != 0) {
44 + fatal ("`-arch %s' does not match current compiler arch `%s'",
45 + argv[i + 1], name);
46 + }
47 + }
48 + }
49 +
50 + /* Skip argument. */
51 + i += 2;
52 + /* Don't add option to the new env. */
53 + nskip = 0;
54 + }
55
56 /* Watch out for an option at the end of the command line that
57 is missing arguments, and avoid skipping past the end of the

  ViewVC Help
Powered by ViewVC 1.1.20