summaryrefslogtreecommitdiff
path: root/meta/recipes-devtools/gcc/gcc-7.3/fix-segmentation-fault-precompiled-hdr.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-26 23:24:45 +0000
commita4c1ede6876ad6b84ab2b3bece14bf0afdc9d6b7 (patch)
tree6dc7862e6065db64b254f5daceb673f96db0037c /meta/recipes-devtools/gcc/gcc-7.3/fix-segmentation-fault-precompiled-hdr.patch
parent222537d8dcf103d8dcce2df7e915594c480ef110 (diff)
downloadopenembedded-core-a4c1ede6876ad6b84ab2b3bece14bf0afdc9d6b7.tar.gz
openembedded-core-a4c1ede6876ad6b84ab2b3bece14bf0afdc9d6b7.tar.bz2
openembedded-core-a4c1ede6876ad6b84ab2b3bece14bf0afdc9d6b7.zip
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. 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.patch49
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 @@
+
+Prevent a segmentation fault which occurs when using incorrect
+structure trying to access name of some named operators, such as
+CPP_NOT, CPP_AND etc. "token->val.node.spelling" cannot be used in
+those cases, as is may not be initialized at all.
+
+
+[YOCTO #11738]
+
+Upstream-Status: Pending
+
+Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
+
+diff --git a/libcpp/lex.c b/libcpp/lex.c
+--- a/libcpp/lex.c
++++ b/libcpp/lex.c
+@@ -3229,11 +3229,27 @@
+ spell_ident:
+ case SPELL_IDENT:
+ if (forstring)
+- {
+- memcpy (buffer, NODE_NAME (token->val.node.spelling),
+- NODE_LEN (token->val.node.spelling));
+- buffer += NODE_LEN (token->val.node.spelling);
+- }
++ {
++ if (token->type == CPP_NAME)
++ {
++ memcpy (buffer, NODE_NAME (token->val.node.spelling),
++ NODE_LEN (token->val.node.spelling));
++ buffer += NODE_LEN (token->val.node.spelling);
++ break;
++ }
++ /* NAMED_OP, cannot use node.spelling */
++ if (token->flags & NAMED_OP)
++ {
++ const char *str = cpp_named_operator2name (token->type);
++ if (str)
++ {
++ size_t len = strlen(str);
++ memcpy(buffer, str, len);
++ buffer += len;
++ }
++ break;
++ }
++ }
+ else
+ buffer = _cpp_spell_ident_ucns (buffer, token->val.node.node);
+ break;