diff options
author | Khem Raj <raj.khem@gmail.com> | 2017-10-14 08:48:57 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-03-14 07:54:06 -0700 |
commit | 42c804e351ac5261be7fb3d0b684ddf1ebb6c645 (patch) | |
tree | 6529682b2abea79484c0adacc18c38a4bc44b16f /meta/recipes-devtools/gcc/gcc-6.4/0038-Search-target-sysroot-gcc-version-specific-dirs-with.patch | |
parent | 5ed61141e10b13bb9731c0d6398d3f30d6f7a65d (diff) | |
download | poky-42c804e351ac5261be7fb3d0b684ddf1ebb6c645.tar.gz |
gcc6: Upgrade to 6.4
Cherry-picked from oe-core master 7874fa86cb583fe6a178b95ead09430486197197
(From OE-Core rev: 86ffec0971b521bdaf9b031005bd3561ff97bdf8)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/gcc/gcc-6.4/0038-Search-target-sysroot-gcc-version-specific-dirs-with.patch')
-rw-r--r-- | meta/recipes-devtools/gcc/gcc-6.4/0038-Search-target-sysroot-gcc-version-specific-dirs-with.patch | 102 |
1 files changed, 102 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-6.4/0038-Search-target-sysroot-gcc-version-specific-dirs-with.patch b/meta/recipes-devtools/gcc/gcc-6.4/0038-Search-target-sysroot-gcc-version-specific-dirs-with.patch new file mode 100644 index 0000000000..89ee79db89 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-6.4/0038-Search-target-sysroot-gcc-version-specific-dirs-with.patch | |||
@@ -0,0 +1,102 @@ | |||
1 | From 42e4cdcaad590536246866b0846ec279e124fa16 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Mon, 7 Dec 2015 23:41:45 +0000 | ||
4 | Subject: [PATCH 38/46] Search target sysroot gcc version specific dirs with | ||
5 | multilib. | ||
6 | |||
7 | We install the gcc libraries (such as crtbegin.p) into | ||
8 | <sysroot><libdir>/<target-sys>/5.2.0/ | ||
9 | which is a default search path for GCC (aka multi_suffix in the | ||
10 | code below). <target-sys> is 'machine' in gcc's terminology. We use | ||
11 | these directories so that multiple gcc versions could in theory | ||
12 | co-exist on target. | ||
13 | |||
14 | We only want to build one gcc-cross-canadian per arch and have this work | ||
15 | for all multilibs. <target-sys> can be handled by mapping the multilib | ||
16 | <target-sys> to the one used by gcc-cross-canadian, e.g. | ||
17 | mips64-polkmllib32-linux | ||
18 | is symlinked to by mips64-poky-linux. | ||
19 | |||
20 | The default gcc search path in the target sysroot for a "lib64" mutlilib | ||
21 | is: | ||
22 | |||
23 | <sysroot>/lib32/mips64-poky-linux/5.2.0/ | ||
24 | <sysroot>/lib32/../lib64/ | ||
25 | <sysroot>/usr/lib32/mips64-poky-linux/5.2.0/ | ||
26 | <sysroot>/usr/lib32/../lib64/ | ||
27 | <sysroot>/lib32/ | ||
28 | <sysroot>/usr/lib32/ | ||
29 | |||
30 | which means that the lib32 crtbegin.o will be found and the lib64 ones | ||
31 | will not which leads to compiler failures. | ||
32 | |||
33 | This patch injects a multilib version of that path first so the lib64 | ||
34 | binaries can be found first. With this change the search path becomes: | ||
35 | |||
36 | <sysroot>/lib32/../lib64/mips64-poky-linux/5.2.0/ | ||
37 | <sysroot>/lib32/mips64-poky-linux/5.2.0/ | ||
38 | <sysroot>/lib32/../lib64/ | ||
39 | <sysroot>/usr/lib32/../lib64/mips64-poky-linux/5.2.0/ | ||
40 | <sysroot>/usr/lib32/mips64-poky-linux/5.2.0/ | ||
41 | <sysroot>/usr/lib32/../lib64/ | ||
42 | <sysroot>/lib32/ | ||
43 | <sysroot>/usr/lib32/ | ||
44 | |||
45 | Upstream-Status: Pending | ||
46 | RP 2015/7/31 | ||
47 | |||
48 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
49 | --- | ||
50 | gcc/gcc.c | 29 ++++++++++++++++++++++++++++- | ||
51 | 1 file changed, 28 insertions(+), 1 deletion(-) | ||
52 | |||
53 | diff --git a/gcc/gcc.c b/gcc/gcc.c | ||
54 | index 94c240e..2812819 100644 | ||
55 | --- a/gcc/gcc.c | ||
56 | +++ b/gcc/gcc.c | ||
57 | @@ -2507,7 +2507,7 @@ for_each_path (const struct path_prefix *paths, | ||
58 | if (path == NULL) | ||
59 | { | ||
60 | len = paths->max_len + extra_space + 1; | ||
61 | - len += MAX (MAX (suffix_len, multi_os_dir_len), multiarch_len); | ||
62 | + len += MAX ((suffix_len + multi_os_dir_len), multiarch_len); | ||
63 | path = XNEWVEC (char, len); | ||
64 | } | ||
65 | |||
66 | @@ -2519,6 +2519,33 @@ for_each_path (const struct path_prefix *paths, | ||
67 | /* Look first in MACHINE/VERSION subdirectory. */ | ||
68 | if (!skip_multi_dir) | ||
69 | { | ||
70 | + if (!(pl->os_multilib ? skip_multi_os_dir : skip_multi_dir)) | ||
71 | + { | ||
72 | + const char *this_multi; | ||
73 | + size_t this_multi_len; | ||
74 | + | ||
75 | + if (pl->os_multilib) | ||
76 | + { | ||
77 | + this_multi = multi_os_dir; | ||
78 | + this_multi_len = multi_os_dir_len; | ||
79 | + } | ||
80 | + else | ||
81 | + { | ||
82 | + this_multi = multi_dir; | ||
83 | + this_multi_len = multi_dir_len; | ||
84 | + } | ||
85 | + | ||
86 | + /* Look in multilib MACHINE/VERSION subdirectory first */ | ||
87 | + if (this_multi_len) | ||
88 | + { | ||
89 | + memcpy (path + len, this_multi, this_multi_len + 1); | ||
90 | + memcpy (path + len + this_multi_len, multi_suffix, suffix_len + 1); | ||
91 | + ret = callback (path, callback_info); | ||
92 | + if (ret) | ||
93 | + break; | ||
94 | + } | ||
95 | + } | ||
96 | + | ||
97 | memcpy (path + len, multi_suffix, suffix_len + 1); | ||
98 | ret = callback (path, callback_info); | ||
99 | if (ret) | ||
100 | -- | ||
101 | 2.8.2 | ||
102 | |||