summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Yang <liezhi.yang@windriver.com>2015-09-09 00:08:15 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-09-12 22:48:36 +0100
commit1f868877f109c692fcb8889d1acef09264eaa1ae (patch)
tree0f7e52cf143038876fe557be3a3173b6e8ee0bd9
parent1dbb37d3e5b1dd30264b714651e0e56f2ad15ae2 (diff)
downloadpoky-1f868877f109c692fcb8889d1acef09264eaa1ae.tar.gz
gcc-5.2: remake 0040-nativesdk-gcc-support.patch
It couldn't be applied by sled11's patch, now fix it. (From OE-Core rev: e01b450a419aba2164a86510ca1ae402ec86aff0) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-devtools/gcc/gcc-5.2/0040-nativesdk-gcc-support.patch142
1 files changed, 67 insertions, 75 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-5.2/0040-nativesdk-gcc-support.patch b/meta/recipes-devtools/gcc/gcc-5.2/0040-nativesdk-gcc-support.patch
index ba7360cc78..fd81ae2449 100644
--- a/meta/recipes-devtools/gcc/gcc-5.2/0040-nativesdk-gcc-support.patch
+++ b/meta/recipes-devtools/gcc/gcc-5.2/0040-nativesdk-gcc-support.patch
@@ -19,70 +19,9 @@ b) Add other paths which need relocation into a .gccrelocprefix section
19Upstream-Status: Inappropriate 19Upstream-Status: Inappropriate
20RP 2015/7/28 20RP 2015/7/28
21 21
22Index: gcc-4.9.2/gcc/gcc.c 22diff --git a/gcc/cppdefault.c b/gcc/cppdefault.c
23=================================================================== 23--- a/gcc/cppdefault.c
24--- gcc-4.9.2.orig/gcc/gcc.c 24+++ b/gcc/cppdefault.c
25+++ gcc-4.9.2/gcc/gcc.c
26@@ -120,6 +120,8 @@ static const char *target_system_root =
27 #else
28 static const char *target_system_root = 0;
29 #endif
30+
31+static char target_relocatable_prefix[4096] __attribute__ ((section (".gccrelocprefix"))) = SYSTEMLIBS_DIR;
32
33 /* Nonzero means pass the updated target_system_root to the compiler. */
34
35@@ -384,6 +386,7 @@ or with constant text in a single argume
36 %G process LIBGCC_SPEC as a spec.
37 %R Output the concatenation of target_system_root and
38 target_sysroot_suffix.
39+ %r Output the base path target_relocatable_prefix
40 %S process STARTFILE_SPEC as a spec. A capital S is actually used here.
41 %E process ENDFILE_SPEC as a spec. A capital E is actually used here.
42 %C process CPP_SPEC as a spec.
43@@ -1218,10 +1221,10 @@ static const char *gcc_libexec_prefix;
44 gcc_exec_prefix is set because, in that case, we know where the
45 compiler has been installed, and use paths relative to that
46 location instead. */
47-static const char *const standard_exec_prefix = STANDARD_EXEC_PREFIX;
48-static const char *const standard_libexec_prefix = STANDARD_LIBEXEC_PREFIX;
49-static const char *const standard_bindir_prefix = STANDARD_BINDIR_PREFIX;
50-static const char *const standard_startfile_prefix = STANDARD_STARTFILE_PREFIX;
51+static char standard_exec_prefix[4096] __attribute__ ((section (".gccrelocprefix"))) = STANDARD_EXEC_PREFIX;
52+static char standard_libexec_prefix[4096] __attribute__ ((section (".gccrelocprefix"))) = STANDARD_LIBEXEC_PREFIX;
53+static char standard_bindir_prefix[4096] __attribute__ ((section (".gccrelocprefix"))) = STANDARD_BINDIR_PREFIX;
54+static char *const standard_startfile_prefix = STANDARD_STARTFILE_PREFIX;
55
56 /* For native compilers, these are well-known paths containing
57 components that may be provided by the system. For cross
58@@ -1229,9 +1232,9 @@ static const char *const standard_startf
59 static const char *md_exec_prefix = MD_EXEC_PREFIX;
60 static const char *md_startfile_prefix = MD_STARTFILE_PREFIX;
61 static const char *md_startfile_prefix_1 = MD_STARTFILE_PREFIX_1;
62-static const char *const standard_startfile_prefix_1
63+static char standard_startfile_prefix_1[4096] __attribute__ ((section (".gccrelocprefix")))
64 = STANDARD_STARTFILE_PREFIX_1;
65-static const char *const standard_startfile_prefix_2
66+static char standard_startfile_prefix_2[4096] __attribute__ ((section (".gccrelocprefix")))
67 = STANDARD_STARTFILE_PREFIX_2;
68
69 /* A relative path to be used in finding the location of tools
70@@ -5305,6 +5310,11 @@ do_spec_1 (const char *spec, int inswitc
71 }
72 break;
73
74+ case 'r':
75+ obstack_grow (&obstack, target_relocatable_prefix,
76+ strlen (target_relocatable_prefix));
77+ break;
78+
79 case 'S':
80 value = do_spec_1 (startfile_spec, 0, NULL);
81 if (value != 0)
82Index: gcc-4.9.2/gcc/cppdefault.c
83===================================================================
84--- gcc-4.9.2.orig/gcc/cppdefault.c
85+++ gcc-4.9.2/gcc/cppdefault.c
86@@ -35,6 +35,30 @@ 25@@ -35,6 +35,30 @@
87 # undef CROSS_INCLUDE_DIR 26 # undef CROSS_INCLUDE_DIR
88 #endif 27 #endif
@@ -114,7 +53,7 @@ Index: gcc-4.9.2/gcc/cppdefault.c
114 const struct default_include cpp_include_defaults[] 53 const struct default_include cpp_include_defaults[]
115 #ifdef INCLUDE_DEFAULTS 54 #ifdef INCLUDE_DEFAULTS
116 = INCLUDE_DEFAULTS; 55 = INCLUDE_DEFAULTS;
117@@ -42,38 +66,38 @@ const struct default_include cpp_include 56@@ -42,38 +66,38 @@ const struct default_include cpp_include_defaults[]
118 = { 57 = {
119 #ifdef GPLUSPLUS_INCLUDE_DIR 58 #ifdef GPLUSPLUS_INCLUDE_DIR
120 /* Pick up GNU C++ generic include files. */ 59 /* Pick up GNU C++ generic include files. */
@@ -162,7 +101,7 @@ Index: gcc-4.9.2/gcc/cppdefault.c
162 /* A multilib suffix needs adding if different multilibs use 101 /* A multilib suffix needs adding if different multilibs use
163 different headers. */ 102 different headers. */
164 #ifdef SYSROOT_HEADERS_SUFFIX_SPEC 103 #ifdef SYSROOT_HEADERS_SUFFIX_SPEC
165@@ -85,21 +109,21 @@ const struct default_include cpp_include 104@@ -85,16 +109,16 @@ const struct default_include cpp_include_defaults[]
166 #endif 105 #endif
167 #ifdef CROSS_INCLUDE_DIR 106 #ifdef CROSS_INCLUDE_DIR
168 /* One place the target system's headers might be. */ 107 /* One place the target system's headers might be. */
@@ -183,15 +122,9 @@ Index: gcc-4.9.2/gcc/cppdefault.c
183 #endif 122 #endif
184 { 0, 0, 0, 0, 0, 0 } 123 { 0, 0, 0, 0, 0, 0 }
185 }; 124 };
186 #endif /* no INCLUDE_DEFAULTS */ 125diff --git a/gcc/cppdefault.h b/gcc/cppdefault.h
187 126--- a/gcc/cppdefault.h
188 #ifdef GCC_INCLUDE_DIR 127+++ b/gcc/cppdefault.h
189 const char cpp_GCC_INCLUDE_DIR[] = GCC_INCLUDE_DIR;
190 const size_t cpp_GCC_INCLUDE_DIR_len = sizeof GCC_INCLUDE_DIR - 8;
191Index: gcc-4.9.2/gcc/cppdefault.h
192===================================================================
193--- gcc-4.9.2.orig/gcc/cppdefault.h
194+++ gcc-4.9.2/gcc/cppdefault.h
195@@ -33,7 +33,8 @@ 128@@ -33,7 +33,8 @@
196 129
197 struct default_include 130 struct default_include
@@ -202,3 +135,62 @@ Index: gcc-4.9.2/gcc/cppdefault.h
202 const char *const component; /* The component containing the directory 135 const char *const component; /* The component containing the directory
203 (see update_path in prefix.c) */ 136 (see update_path in prefix.c) */
204 const char cplusplus; /* Only look here if we're compiling C++. */ 137 const char cplusplus; /* Only look here if we're compiling C++. */
138diff --git a/gcc/gcc.c b/gcc/gcc.c
139--- a/gcc/gcc.c
140+++ b/gcc/gcc.c
141@@ -120,6 +120,8 @@ static const char *target_system_root = TARGET_SYSTEM_ROOT;
142 #else
143 static const char *target_system_root = 0;
144 #endif
145+
146+static char target_relocatable_prefix[4096] __attribute__ ((section (".gccrelocprefix"))) = SYSTEMLIBS_DIR;
147
148 /* Nonzero means pass the updated target_system_root to the compiler. */
149
150@@ -390,6 +392,7 @@ or with constant text in a single argument.
151 %G process LIBGCC_SPEC as a spec.
152 %R Output the concatenation of target_system_root and
153 target_sysroot_suffix.
154+ %r Output the base path target_relocatable_prefix
155 %S process STARTFILE_SPEC as a spec. A capital S is actually used here.
156 %E process ENDFILE_SPEC as a spec. A capital E is actually used here.
157 %C process CPP_SPEC as a spec.
158@@ -1286,10 +1289,10 @@ static const char *gcc_libexec_prefix;
159 gcc_exec_prefix is set because, in that case, we know where the
160 compiler has been installed, and use paths relative to that
161 location instead. */
162-static const char *const standard_exec_prefix = STANDARD_EXEC_PREFIX;
163-static const char *const standard_libexec_prefix = STANDARD_LIBEXEC_PREFIX;
164-static const char *const standard_bindir_prefix = STANDARD_BINDIR_PREFIX;
165-static const char *const standard_startfile_prefix = STANDARD_STARTFILE_PREFIX;
166+static char standard_exec_prefix[4096] __attribute__ ((section (".gccrelocprefix"))) = STANDARD_EXEC_PREFIX;
167+static char standard_libexec_prefix[4096] __attribute__ ((section (".gccrelocprefix"))) = STANDARD_LIBEXEC_PREFIX;
168+static char standard_bindir_prefix[4096] __attribute__ ((section (".gccrelocprefix"))) = STANDARD_BINDIR_PREFIX;
169+static char *const standard_startfile_prefix = STANDARD_STARTFILE_PREFIX;
170
171 /* For native compilers, these are well-known paths containing
172 components that may be provided by the system. For cross
173@@ -1297,9 +1300,9 @@ static const char *const standard_startfile_prefix = STANDARD_STARTFILE_PREFIX;
174 static const char *md_exec_prefix = MD_EXEC_PREFIX;
175 static const char *md_startfile_prefix = MD_STARTFILE_PREFIX;
176 static const char *md_startfile_prefix_1 = MD_STARTFILE_PREFIX_1;
177-static const char *const standard_startfile_prefix_1
178+static char standard_startfile_prefix_1[4096] __attribute__ ((section (".gccrelocprefix")))
179 = STANDARD_STARTFILE_PREFIX_1;
180-static const char *const standard_startfile_prefix_2
181+static char standard_startfile_prefix_2[4096] __attribute__ ((section (".gccrelocprefix")))
182 = STANDARD_STARTFILE_PREFIX_2;
183
184 /* A relative path to be used in finding the location of tools
185@@ -5550,6 +5553,11 @@ do_spec_1 (const char *spec, int inswitch, const char *soft_matched_part)
186 }
187 break;
188
189+ case 'r':
190+ obstack_grow (&obstack, target_relocatable_prefix,
191+ strlen (target_relocatable_prefix));
192+ break;
193+
194 case 'S':
195 value = do_spec_1 (startfile_spec, 0, NULL);
196 if (value != 0)