summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/gcc/gcc-5.4/0058-fdebug-prefix-map-support-to-remap-relative-path.patch
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2016-06-24 08:53:09 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-07-01 16:22:44 +0100
commit1bf0944925dc0bb53b12b0f6623be0401e236e53 (patch)
tree77a614bca62066e300df6c307251d43dcd20c3ac /meta/recipes-devtools/gcc/gcc-5.4/0058-fdebug-prefix-map-support-to-remap-relative-path.patch
parent0412b6d90d9eaa424cd0e6b7f205ba7f6622625c (diff)
downloadpoky-1bf0944925dc0bb53b12b0f6623be0401e236e53.tar.gz
gcc5: Upgrade to gcc 5.4
Drop patches which has been applied to gcc5 branch until 5.4 release (From OE-Core rev: 42487843f846ae61f8bd1b2278d148ff37f0d667) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/gcc/gcc-5.4/0058-fdebug-prefix-map-support-to-remap-relative-path.patch')
-rw-r--r--meta/recipes-devtools/gcc/gcc-5.4/0058-fdebug-prefix-map-support-to-remap-relative-path.patch51
1 files changed, 51 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-5.4/0058-fdebug-prefix-map-support-to-remap-relative-path.patch b/meta/recipes-devtools/gcc/gcc-5.4/0058-fdebug-prefix-map-support-to-remap-relative-path.patch
new file mode 100644
index 0000000000..0b91fdbbcf
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-5.4/0058-fdebug-prefix-map-support-to-remap-relative-path.patch
@@ -0,0 +1,51 @@
1From 289ad2969a5966c603bf6928ce442db74c4cbb25 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] gcc/final.c: -fdebug-prefix-map support to remap sources with
5 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---
16diff --git a/gcc/final.c b/gcc/final.c
17index 55cf509..c3594c2 100644
18--- a/gcc/final.c
19+++ b/gcc/final.c
20@@ -1554,16 +1554,25 @@ remap_debug_filename (const char *filename)
21 const char *name;
22 size_t name_len;
23
24+ /* Support to remap filename with relative path */
25+ char *realpath = lrealpath (filename);
26+ if (realpath == NULL)
27+ return filename;
28+
29 for (map = debug_prefix_maps; map; map = map->next)
30- if (filename_ncmp (filename, map->old_prefix, map->old_len) == 0)
31+ if (filename_ncmp (realpath, map->old_prefix, map->old_len) == 0)
32 break;
33 if (!map)
34- return filename;
35- name = filename + map->old_len;
36+ {
37+ free (realpath);
38+ return filename;
39+ }
40+ name = realpath + map->old_len;
41 name_len = strlen (name) + 1;
42 s = (char *) alloca (name_len + map->new_len);
43 memcpy (s, map->new_prefix, map->new_len);
44 memcpy (s + map->new_len, name, name_len);
45+ free (realpath);
46 return ggc_strdup (s);
47 }
48
49--
502.7.4
51