summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/gcc/gcc-6.4/0044-gcc-final.c-fdebug-prefix-map-support-to-remap-sourc.patch
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2017-10-14 08:48:57 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-03-14 07:55:02 -0700
commit02b66069c561be3d5567712e5fc43b6340109ed1 (patch)
tree7804665cba85ae6a4d25a8110455a85e9d048031 /meta/recipes-devtools/gcc/gcc-6.4/0044-gcc-final.c-fdebug-prefix-map-support-to-remap-sourc.patch
parentfbf0a745375c293b92cd2584364d7a3c3731fe7e (diff)
downloadpoky-02b66069c561be3d5567712e5fc43b6340109ed1.tar.gz
gcc6: Upgrade to 6.4
Cherry-picked from oe-core master 7874fa86cb583fe6a178b95ead09430486197197 (From OE-Core rev: 4a9eee06a6d15a23f58bc981c83138964702b735) 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/0044-gcc-final.c-fdebug-prefix-map-support-to-remap-sourc.patch')
-rw-r--r--meta/recipes-devtools/gcc/gcc-6.4/0044-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-6.4/0044-gcc-final.c-fdebug-prefix-map-support-to-remap-sourc.patch b/meta/recipes-devtools/gcc/gcc-6.4/0044-gcc-final.c-fdebug-prefix-map-support-to-remap-sourc.patch
new file mode 100644
index 0000000000..5d41af44a4
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-6.4/0044-gcc-final.c-fdebug-prefix-map-support-to-remap-sourc.patch
@@ -0,0 +1,54 @@
1From 6ab23e88aef22bbabee7b9600c459ff39547bb66 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 44/46] 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 55cf509..23293e5 100644
21--- a/gcc/final.c
22+++ b/gcc/final.c
23@@ -1554,16 +1554,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.8.2
54