Files
operating-system/buildroot/package/odb/0006-Adapt-to-changes-in-GCC-8.patch
Stefan Agner a0871be6c0 Bump buildroot to 2020.11-rc1 (#985)
* Update buildroot-patches for 2020.11-rc1 buildroot

* Update buildroot to 2020.11-rc1

Signed-off-by: Stefan Agner <stefan@agner.ch>

* Don't rely on sfdisk --list-free output

The --list-free (-F) argument does not allow machine readable mode. And
it seems that the output format changes over time (different spacing,
using size postfixes instead of raw blocks).

Use sfdisk json output and calculate free partition space ourselfs. This
works for 2.35 and 2.36 and is more robust since we rely on output which
is meant for scripts to parse.

* Migrate defconfigs for Buildroot 2020.11-rc1

In particular, rename BR2_TARGET_UBOOT_BOOT_SCRIPT(_SOURCE) to
BR2_PACKAGE_HOST_UBOOT_TOOLS_BOOT_SCRIPT(_SOURCE).

* Rebase/remove systemd patches for systemd 246

* Drop apparmor/libapparmor from buildroot-external

* hassos-persists: use /run as directory for lockfiles

The U-Boot tools use /var/lock by default which is not created any more
by systemd by default (it is under tmpfiles legacy.conf, which we no
longer install).

* Disable systemd-update-done.service

The service is not suited for pure read-only systems. In particular the
service needs to be able to write a file in /etc and /var. Remove the
service. Note: This is a static service and cannot be removed using
systemd-preset.

* Disable apparmor.service for now

The service loads all default profiles. Some might actually cause
problems. E.g. the profile for ping seems not to match our setup for
/etc/resolv.conf:
[85503.634653] audit: type=1400 audit(1605286002.684:236): apparmor="DENIED" operation="open" profile="ping" name="/run/resolv.conf" pid=27585 comm="ping" requested_mask="r" denied_mask="r" fsuid=0 ouid=0
2020-11-13 18:25:44 +01:00

229 lines
7.0 KiB
Diff

From aca617685045b1984c19c415a474893407578394 Mon Sep 17 00:00:00 2001
From: Boris Kolpackov <boris@codesynthesis.com>
Date: Tue, 7 Nov 2017 14:58:43 +0200
Subject: [PATCH] Adapt to changes in GCC 8
[Upstream: 356630ced28f3101e8e2d88e3c52f8d3008515c7]
Signed-off-by: Kamel Bouhara <kamel.bouhara@bootlin.com>
---
odb/cxx-lexer.cxx | 16 ++++++++++++++--
odb/parser.cxx | 27 ++++++++++++++++++++++++++-
odb/processor.cxx | 30 ++++++++++++++++++++++--------
odb/semantics/elements.cxx | 8 ++++++++
odb/validator.cxx | 10 +++++++++-
5 files changed, 79 insertions(+), 12 deletions(-)
diff --git a/odb/cxx-lexer.cxx b/odb/cxx-lexer.cxx
index ae045d9..cfebbb5 100644
--- a/odb/cxx-lexer.cxx
+++ b/odb/cxx-lexer.cxx
@@ -93,7 +93,13 @@ next (string& token, tree* node)
// See if this is a keyword using the C++ parser machinery and
// the current C++ dialect.
//
- if (*type_ == CPP_NAME && C_IS_RESERVED_WORD (*token_))
+ if (*type_ == CPP_NAME &&
+#if BUILDING_GCC_MAJOR >= 8
+ IDENTIFIER_KEYWORD_P (*token_)
+#else
+ C_IS_RESERVED_WORD (*token_)
+#endif
+ )
*type_ = CPP_KEYWORD;
if (node != 0 && node != token_)
@@ -281,7 +287,13 @@ next (string& token, tree* node)
//
tree id (get_identifier (name));
- if (C_IS_RESERVED_WORD (id))
+ if (
+#if BUILDING_GCC_MAJOR >= 8
+ IDENTIFIER_KEYWORD_P (id)
+#else
+ C_IS_RESERVED_WORD (id)
+#endif
+ )
tt = CPP_KEYWORD;
if (node != 0)
diff --git a/odb/parser.cxx b/odb/parser.cxx
index a9d22fb..927063b 100644
--- a/odb/parser.cxx
+++ b/odb/parser.cxx
@@ -889,8 +889,23 @@ collect (tree ns)
// Traverse namespaces.
//
- for (decl = level->namespaces; decl != NULL_TREE; decl = TREE_CHAIN (decl))
+ for (
+#if BUILDING_GCC_MAJOR >= 8
+ decl = level->names;
+#else
+ decl = level->namespaces;
+#endif
+ decl != NULL_TREE;
+ decl = TREE_CHAIN (decl))
{
+#if BUILDING_GCC_MAJOR >= 8
+ // Now namespaces are interleaved with other declarations. In fact, we
+ // could probably collect everything in a single pass.
+ //
+ if (TREE_CODE (decl) != NAMESPACE_DECL)
+ continue;
+#endif
+
if (!DECL_IS_BUILTIN (decl) || DECL_NAMESPACE_STD_P (decl))
{
if (trace)
@@ -960,9 +975,15 @@ emit ()
// approximation for this namespace origin. Also resolve
// the tree node for this namespace.
//
+#if BUILDING_GCC_MAJOR >= 8
+ tree tree_node (
+ get_namespace_binding (
+ scope_->tree_node (), get_identifier (n.c_str ())));
+#else
tree tree_node (
namespace_binding (
get_identifier (n.c_str ()), scope_->tree_node ()));
+#endif
namespace_& node (unit_->new_node<namespace_> (f, l, c, tree_node));
unit_->new_edge<defines> (*scope_, node, n);
@@ -2218,7 +2239,11 @@ fq_scope (tree decl)
// If this is an inline namespace, pretend it doesn't exist.
//
+#if BUILDING_GCC_MAJOR >= 8
+ if (!is_nested_namespace (prev, scope, true))
+#else
if (!is_associated_namespace (prev, scope))
+#endif
{
tree n = DECL_NAME (scope);
diff --git a/odb/processor.cxx b/odb/processor.cxx
index 3a2cb1d..bea3624 100644
--- a/odb/processor.cxx
+++ b/odb/processor.cxx
@@ -423,12 +423,17 @@ namespace
// OVL_* macros work for both FUNCTION_DECL and OVERLOAD.
//
- for (tree o (BASELINK_FUNCTIONS (decl));
- o != 0;
- o = OVL_NEXT (o))
+#if BUILDING_GCC_MAJOR >= 8
+ for (ovl_iterator i (BASELINK_FUNCTIONS (decl)); i; ++i)
+#else
+ for (tree o (BASELINK_FUNCTIONS (decl)); o != 0; o = OVL_NEXT (o))
+#endif
{
+#if BUILDING_GCC_MAJOR >= 8
+ tree f (*i);
+#else
tree f (OVL_CURRENT (o));
-
+#endif
// We are only interested in public non-static member
// functions. Note that TREE_PUBLIC() returns something
// other than what we need.
@@ -530,12 +535,17 @@ namespace
{
// OVL_* macros work for both FUNCTION_DECL and OVERLOAD.
//
- for (tree o (BASELINK_FUNCTIONS (decl));
- o != 0;
- o = OVL_NEXT (o))
+#if BUILDING_GCC_MAJOR >= 8
+ for (ovl_iterator i (BASELINK_FUNCTIONS (decl)); i; ++i)
+#else
+ for (tree o (BASELINK_FUNCTIONS (decl)); o != 0; o = OVL_NEXT (o))
+#endif
{
+#if BUILDING_GCC_MAJOR >= 8
+ tree f (*i);
+#else
tree f (OVL_CURRENT (o));
-
+#endif
// We are only interested in non-static member functions.
//
if (!DECL_NONSTATIC_MEMBER_FUNCTION_P (f))
@@ -2934,7 +2944,11 @@ namespace
{
tree prev (CP_DECL_CONTEXT (scope));
+#if BUILDING_GCC_MAJOR >= 8
+ if (!is_nested_namespace (prev, scope, true))
+#else
if (!is_associated_namespace (prev, scope))
+#endif
break;
scope = prev;
diff --git a/odb/semantics/elements.cxx b/odb/semantics/elements.cxx
index 399d5e9..4c380d8 100644
--- a/odb/semantics/elements.cxx
+++ b/odb/semantics/elements.cxx
@@ -126,7 +126,11 @@ namespace semantics
{
tree prev (CP_DECL_CONTEXT (s));
+#if BUILDING_GCC_MAJOR >= 8
+ if (!is_nested_namespace (prev, s, true))
+#else
if (!is_associated_namespace (prev, s))
+#endif
break;
s = prev;
@@ -223,7 +227,11 @@ namespace semantics
{
// Check if this is an inline namespace and skip it if so.
//
+#if BUILDING_GCC_MAJOR >= 8
+ if (is_nested_namespace (ns, new_ns, true))
+#else
if (is_associated_namespace (ns, new_ns))
+#endif
{
// Skip also the following scope operator. Strictly speaking
// there could be none (i.e., this is a name of an inline
diff --git a/odb/validator.cxx b/odb/validator.cxx
index 91d91e5..aac52e4 100644
--- a/odb/validator.cxx
+++ b/odb/validator.cxx
@@ -520,9 +520,17 @@ namespace
// Figure out if we have a const version of the callback. OVL_*
// macros work for both FUNCTION_DECL and OVERLOAD.
//
+#if BUILDING_GCC_MAJOR >= 8
+ for (ovl_iterator i (BASELINK_FUNCTIONS (decl)); i; ++i)
+#else
for (tree o (BASELINK_FUNCTIONS (decl)); o != 0; o = OVL_NEXT (o))
+#endif
{
+#if BUILDING_GCC_MAJOR >= 8
+ tree f (*i);
+#else
tree f (OVL_CURRENT (o));
+#endif
if (DECL_CONST_MEMFUNC_P (f))
{
c.set ("callback-const", true);
@@ -1223,7 +1231,7 @@ namespace
compiler, get_identifier ("has_lt_operator"), false, false);
if (has_lt_operator_ != error_mark_node)
- has_lt_operator_ = OVL_CURRENT (has_lt_operator_);
+ has_lt_operator_ = OVL_FIRST (has_lt_operator_);
else
{
os << unit.file () << ": error: unable to resolve has_lt_operator "
--
2.25.0