Commit a3e6fdee authored by gsell's avatar gsell

Merge branch '106-gcc-build-version-10-2' into 'master'

Resolve "gcc: build version 10.2"

Closes #106

See merge request Pmodules/buildblocks!141
parents 8718e4fb 93dbfffd
...@@ -28,6 +28,9 @@ pbuild::pre_prep() { ...@@ -28,6 +28,9 @@ pbuild::pre_prep() {
if (( V_MAJOR == 5 )) || (( V_MAJOR == 6 )); then if (( V_MAJOR == 5 )) || (( V_MAJOR == 6 )); then
pbuild::add_patch_Darwin "${V_MAJOR}/PR57438_avoiding_empty_function_bodies_and_trailing_labels.patch" pbuild::add_patch_Darwin "${V_MAJOR}/PR57438_avoiding_empty_function_bodies_and_trailing_labels.patch"
fi fi
if (( V_MAJOR == 10 && V_MINOR == 2 )); then
pbuild::add_patch "files/gcc-10.2.0-cpp-__has_include.patch"
fi
} }
pbuild::pre_configure() { pbuild::pre_configure() {
......
From b7bb13d4a5fcb593dc745ca3b6180f8babb54893 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tiziano=20M=C3=BCller?= <tiziano.mueller@chem.uzh.ch>
Date: Mon, 27 Jul 2020 15:40:38 +0200
Subject: [PATCH] libcpp: fix __has_include handling with traditional-cpp
fixes #95889
---
libcpp/init.c | 3 +++
libcpp/traditional.c | 4 +++-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/libcpp/init.c b/libcpp/init.c
index 0aac5acd0a35..b0cf71192589 100644
--- a/libcpp/init.c
+++ b/libcpp/init.c
@@ -400,6 +400,9 @@ static const struct builtin_macro builtin_array[] =
B("__LINE__", BT_SPECLINE, true),
B("__INCLUDE_LEVEL__", BT_INCLUDE_LEVEL, true),
B("__COUNTER__", BT_COUNTER, true),
+ /* Make sure to update the list of built-in
+ function-like macros in traditional.c:
+ fun_like_macro() when adding more following */
B("__has_attribute", BT_HAS_ATTRIBUTE, true),
B("__has_cpp_attribute", BT_HAS_ATTRIBUTE, true),
B("__has_builtin", BT_HAS_BUILTIN, true),
diff --git a/libcpp/traditional.c b/libcpp/traditional.c
index 77adb3bf595f..b087072c9b4c 100644
--- a/libcpp/traditional.c
+++ b/libcpp/traditional.c
@@ -330,7 +330,9 @@ fun_like_macro (cpp_hashnode *node)
{
if (cpp_builtin_macro_p (node))
return (node->value.builtin == BT_HAS_ATTRIBUTE
- || node->value.builtin == BT_HAS_BUILTIN);
+ || node->value.builtin == BT_HAS_BUILTIN
+ || node->value.builtin == BT_HAS_INCLUDE
+ || node->value.builtin == BT_HAS_INCLUDE_NEXT);
return node->value.macro->fun_like;
}
...@@ -36,3 +36,4 @@ gcc/9.2.0 stable b:gmp/6.1.2-1 b:mpfr/4.0.2 b:mpc/1.1.0-3 b:isl/0.21 ...@@ -36,3 +36,4 @@ gcc/9.2.0 stable b:gmp/6.1.2-1 b:mpfr/4.0.2 b:mpc/1.1.0-3 b:isl/0.21
gcc/9.3.0 stable b:gmp/6.2.0 b:mpfr/4.0.2-1 b:mpc/1.1.0-4 gcc/9.3.0 stable b:gmp/6.2.0 b:mpfr/4.0.2-1 b:mpc/1.1.0-4
gcc/10.1.0 stable b:gmp/6.2.0 b:mpfr/4.0.2-1 b:mpc/1.1.0-4 gcc/10.1.0 stable b:gmp/6.2.0 b:mpfr/4.0.2-1 b:mpc/1.1.0-4
gcc/10.2.0 unstable b:gmp/6.2.0 b:mpfr/4.0.2-1 b:mpc/1.1.0-4
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment