-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path0001-Apply-gcc_42-5574.patch.patch
122 lines (114 loc) · 3.37 KB
/
0001-Apply-gcc_42-5574.patch.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
From 742078ae792ed378502cc7f2c2766b950f0f764b Mon Sep 17 00:00:00 2001
From: Lubomir Rintel <[email protected]>
Date: Tue, 4 Oct 2011 23:22:50 +0200
Subject: [PATCH 1/3] Apply gcc_42-5574.patch
---
driverdriver.c | 41 +++++++++++++++++++++++++++++++++++++++++
gcc/config/darwin-driver.c | 4 ++++
gcc/configure | 2 +-
gcc/configure.ac | 2 +-
4 files changed, 47 insertions(+), 2 deletions(-)
diff --git a/driverdriver.c b/driverdriver.c
index eacc1dc..c39719b 100644
--- a/driverdriver.c
+++ b/driverdriver.c
@@ -196,6 +196,7 @@ static int get_prog_name_len (const char *prog);
static const char *
get_arch_name (const char *name)
{
+#if 0
NXArchInfo * a_info;
const NXArchInfo * all_info;
cpu_type_t cputype;
@@ -250,6 +251,46 @@ get_arch_name (const char *name)
}
return all_info->name;
+#else
+ /* Architectures from Mac "man 3 arch" that we're willing to handle. */
+ const char* known_archs[] = {
+ "i386", /* The first item is the default to use when none is specified. */
+ "x86_64",
+ "ppc",
+ "ppc64",
+ "i486",
+ "i486SX",
+ "pentium",
+ "i586",
+ "pentpro",
+ "i686",
+ "pentIIm3",
+ "pentIIm5",
+ "pentium4",
+ "ppc601",
+ "ppc603",
+ "ppc604",
+ "ppc604e",
+ "ppc750",
+ "ppc7400",
+ "ppc7450",
+ "ppc970",
+ NULL
+ };
+ const char** known_arch;
+
+ if (name) {
+ for (known_arch = known_archs; *known_arch; ++known_arch) {
+ if (!strcmp(name, *known_arch)) {
+ return name;
+ }
+ }
+
+ fatal ("Invalid arch name : %s", name);
+ }
+
+ return known_archs[0];
+#endif
}
/* Find driver name based on input arch name. */
diff --git a/gcc/config/darwin-driver.c b/gcc/config/darwin-driver.c
index 3d738e3..e849317 100644
--- a/gcc/config/darwin-driver.c
+++ b/gcc/config/darwin-driver.c
@@ -156,6 +156,7 @@ darwin_default_min_version (int * argc_p, char *** argv_p,
gcc_assert (vers_type == DARWIN_VERSION_MACOSX);
+#if 0
/* 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,
@@ -195,6 +196,9 @@ darwin_default_min_version (int * argc_p, char *** argv_p,
else
sprintf (new_flag, "-mmacosx-version-min=10.%d.%s", major_vers - 4,
minor_vers);
+#else
+ strncpy(new_flag, "-mmacosx-version-min=10.5", sizeof(new_flag));
+#endif
/* Add the new flag. */
++*argc_p;
diff --git a/gcc/configure b/gcc/configure
index 9edf890..f52b123 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -13325,7 +13325,7 @@ fi
if test x$host != x$target
then
# APPLE LOCAL begin mainline 4.3 2006-12-13 CROSS_DIRECTORY_STRUCTURE 4697325
- CROSS="-DCROSS_DIRECTORY_STRUCTURE"
+# CROSS="-DCROSS_DIRECTORY_STRUCTURE"
# APPLE LOCAL end mainline 4.3 2006-12-13 CROSS_DIRECTORY_STRUCTURE 4697325
ALL=all.cross
SYSTEM_HEADER_DIR=$build_system_header_dir
diff --git a/gcc/configure.ac b/gcc/configure.ac
index cd76979..724853b 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -1754,7 +1754,7 @@ fi
if test x$host != x$target
then
# APPLE LOCAL begin mainline 4.3 2006-12-13 CROSS_DIRECTORY_STRUCTURE 4697325
- CROSS="-DCROSS_DIRECTORY_STRUCTURE"
+# CROSS="-DCROSS_DIRECTORY_STRUCTURE"
# APPLE LOCAL end mainline 4.3 2006-12-13 CROSS_DIRECTORY_STRUCTURE 4697325
ALL=all.cross
SYSTEM_HEADER_DIR=$build_system_header_dir
--
1.7.4.1