summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/gcc/gcc-7.3/0043-gcc-final.c-fdebug-prefix-map-support-to-remap-sourc.patch
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2018-01-23 17:03:26 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-01-27 13:15:28 +0000
commitc391593402109944bacc6f75693a6d21adb0b071 (patch)
treea7a04369eeb6e90610041ff4559199cf4b01cc9f /meta/recipes-devtools/gcc/gcc-7.3/0043-gcc-final.c-fdebug-prefix-map-support-to-remap-sourc.patch
parentfa2fcaee9785f7eeadad890c40fd075fb85aaa78 (diff)
downloadpoky-c391593402109944bacc6f75693a6d21adb0b071.tar.gz
gcc: Upgrade 7.2 -> 7.3
The static PIE patch was updated by Juro Bystricky <juro.bystricky@intel.com> to work with gcc 7.3. This update from the stable gcc 7 branch includes the retpoline functionality which is useful to assist with recent security issues. Two backported patches were dropped as they're included in 7.3. (From OE-Core rev: a4c1ede6876ad6b84ab2b3bece14bf0afdc9d6b7) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/gcc/gcc-7.3/0043-gcc-final.c-fdebug-prefix-map-support-to-remap-sourc.patch')
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.3/0043-gcc-final.c-fdebug-prefix-map-support-to-remap-sourc.patch54
1 files changed, 54 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-7.3/0043-gcc-final.c-fdebug-prefix-map-support-to-remap-sourc.patch b/meta/recipes-devtools/gcc/gcc-7.3/0043-gcc-final.c-fdebug-prefix-map-support-to-remap-sourc.patch
new file mode 100644
index 0000000000..74a5c86446
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-7.3/0043-gcc-final.c-fdebug-prefix-map-support-to-remap-sourc.patch
@@ -0,0 +1,54 @@
1From 5bc97be388485a5f8dd85db34372a1299bffd263 Mon Sep 17 00:00:00 2001
2From: Hongxu Jia <hongxu.jia@windriver.com>
3Date: Thu, 24 Mar 2016 11:23:14 -0400
4Subject: [PATCH 43/47] gcc/final.c: -fdebug-prefix-map support to remap
5 sources with relative path
6
7PR other/70428
8* final.c (remap_debug_filename): Use lrealpath to translate
9relative path before remapping
10
11https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70428
12Upstream-Status: Submitted [gcc-patches@gcc.gnu.org]
13
14Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
15---
16 gcc/final.c | 15 ++++++++++++---
17 1 file changed, 12 insertions(+), 3 deletions(-)
18
19diff --git a/gcc/final.c b/gcc/final.c
20index 820162b2d28..d74cb901abd 100644
21--- a/gcc/final.c
22+++ b/gcc/final.c
23@@ -1559,16 +1559,25 @@ remap_debug_filename (const char *filename)
24 const char *name;
25 size_t name_len;
26
27+ /* Support to remap filename with relative path */
28+ char *realpath = lrealpath (filename);
29+ if (realpath == NULL)
30+ return filename;
31+
32 for (map = debug_prefix_maps; map; map = map->next)
33- if (filename_ncmp (filename, map->old_prefix, map->old_len) == 0)
34+ if (filename_ncmp (realpath, map->old_prefix, map->old_len) == 0)
35 break;
36 if (!map)
37- return filename;
38- name = filename + map->old_len;
39+ {
40+ free (realpath);
41+ return filename;
42+ }
43+ name = realpath + map->old_len;
44 name_len = strlen (name) + 1;
45 s = (char *) alloca (name_len + map->new_len);
46 memcpy (s, map->new_prefix, map->new_len);
47 memcpy (s + map->new_len, name, name_len);
48+ free (realpath);
49 return ggc_strdup (s);
50 }
51
52--
532.12.2
54