diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-01-23 17:03:26 -0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-01-28 10:14:01 +0000 |
commit | c23734c45fb1239406d054039a0f56413b955eb9 (patch) | |
tree | 39cbbea7dbba076db8dc7857848bc99ac21c2398 /meta/recipes-devtools/gcc/gcc-7.3/fix-segmentation-fault-precompiled-hdr.patch | |
parent | c770664d3125a0a0e73444a3a2a97418b7c0d7a5 (diff) | |
download | poky-c23734c45fb1239406d054039a0f56413b955eb9.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: 99b1998157ecbd2bc8ac7c24fae859d48b152f58)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/gcc/gcc-7.3/fix-segmentation-fault-precompiled-hdr.patch')
-rw-r--r-- | meta/recipes-devtools/gcc/gcc-7.3/fix-segmentation-fault-precompiled-hdr.patch | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-7.3/fix-segmentation-fault-precompiled-hdr.patch b/meta/recipes-devtools/gcc/gcc-7.3/fix-segmentation-fault-precompiled-hdr.patch new file mode 100644 index 0000000000..c0adef6f2f --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-7.3/fix-segmentation-fault-precompiled-hdr.patch | |||
@@ -0,0 +1,49 @@ | |||
1 | |||
2 | Prevent a segmentation fault which occurs when using incorrect | ||
3 | structure trying to access name of some named operators, such as | ||
4 | CPP_NOT, CPP_AND etc. "token->val.node.spelling" cannot be used in | ||
5 | those cases, as is may not be initialized at all. | ||
6 | |||
7 | |||
8 | [YOCTO #11738] | ||
9 | |||
10 | Upstream-Status: Pending | ||
11 | |||
12 | Signed-off-by: Juro Bystricky <juro.bystricky@intel.com> | ||
13 | |||
14 | diff --git a/libcpp/lex.c b/libcpp/lex.c | ||
15 | --- a/libcpp/lex.c | ||
16 | +++ b/libcpp/lex.c | ||
17 | @@ -3229,11 +3229,27 @@ | ||
18 | spell_ident: | ||
19 | case SPELL_IDENT: | ||
20 | if (forstring) | ||
21 | - { | ||
22 | - memcpy (buffer, NODE_NAME (token->val.node.spelling), | ||
23 | - NODE_LEN (token->val.node.spelling)); | ||
24 | - buffer += NODE_LEN (token->val.node.spelling); | ||
25 | - } | ||
26 | + { | ||
27 | + if (token->type == CPP_NAME) | ||
28 | + { | ||
29 | + memcpy (buffer, NODE_NAME (token->val.node.spelling), | ||
30 | + NODE_LEN (token->val.node.spelling)); | ||
31 | + buffer += NODE_LEN (token->val.node.spelling); | ||
32 | + break; | ||
33 | + } | ||
34 | + /* NAMED_OP, cannot use node.spelling */ | ||
35 | + if (token->flags & NAMED_OP) | ||
36 | + { | ||
37 | + const char *str = cpp_named_operator2name (token->type); | ||
38 | + if (str) | ||
39 | + { | ||
40 | + size_t len = strlen(str); | ||
41 | + memcpy(buffer, str, len); | ||
42 | + buffer += len; | ||
43 | + } | ||
44 | + break; | ||
45 | + } | ||
46 | + } | ||
47 | else | ||
48 | buffer = _cpp_spell_ident_ucns (buffer, token->val.node.node); | ||
49 | break; | ||