diff mbox series

[v2,1/4] package/odb: backport more upstream commits to fix build with gcc 11.x

Message ID 20220310095602.2435745-2-kamel.bouhara@bootlin.com
State Accepted
Headers show
Series Add odb host variant and fix gcc-11 build | expand

Commit Message

Kamel Bouhara March 10, 2022, 9:55 a.m. UTC
From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>

Commit ac9855e761443dee4f9d461b83e12443d37e8678 ("package/odb: fix
build with gcc 11") already fixed some gcc 11.x issues, but not all of
them. This commit backports two upstream patches fixing the remaining
issues, ensuring host-odb can be built on a gcc 11.x machine.

Fixes:

  http://autobuild.buildroot.net/results/d37c4271e66d923f7af6a4e3dbad603fcd1c8119/

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Kamel Bouhara <kamel.bouhara@bootlin.com>
---
Note: the above autobuilder issue has stopped appearing after
September 29, 2021, which initially sounded odd. However, on October
3, we started rejecting build results from Xogium's autobuilder (for
other reasons), and all those issues were coming from Xogium's
autobuilder. And this is pretty logical: Xogium's autobuilder was
known to be running a very recent Arch Linux, and therefore was the
only autobuild machine running gcc 11.x as the host compiler.
---
 .../0012-Adjust-to-changes-in-GCC-11.patch    | 50 ++++++++++++++
 ...kup-ambiguity-causing-error-with-GCC.patch | 68 +++++++++++++++++++
 2 files changed, 118 insertions(+)
 create mode 100644 package/odb/0012-Adjust-to-changes-in-GCC-11.patch
 create mode 100644 package/odb/0013-Resolve-name-lookup-ambiguity-causing-error-with-GCC.patch

Comments

Peter Korsgaard March 23, 2022, 9:02 p.m. UTC | #1
>>>>> "Kamel" == Kamel Bouhara via buildroot <buildroot@buildroot.org> writes:

 > From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
 > Commit ac9855e761443dee4f9d461b83e12443d37e8678 ("package/odb: fix
 > build with gcc 11") already fixed some gcc 11.x issues, but not all of
 > them. This commit backports two upstream patches fixing the remaining
 > issues, ensuring host-odb can be built on a gcc 11.x machine.

 > Fixes:

 >   http://autobuild.buildroot.net/results/d37c4271e66d923f7af6a4e3dbad603fcd1c8119/

 > Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
 > Signed-off-by: Kamel Bouhara <kamel.bouhara@bootlin.com>
 > ---
 > Note: the above autobuilder issue has stopped appearing after
 > September 29, 2021, which initially sounded odd. However, on October
 > 3, we started rejecting build results from Xogium's autobuilder (for
 > other reasons), and all those issues were coming from Xogium's
 > autobuilder. And this is pretty logical: Xogium's autobuilder was
 > known to be running a very recent Arch Linux, and therefore was the
 > only autobuild machine running gcc 11.x as the host compiler.

Committed to 2021.02.x, 2021.11.x and 2022.02.x, thanks.
diff mbox series

Patch

diff --git a/package/odb/0012-Adjust-to-changes-in-GCC-11.patch b/package/odb/0012-Adjust-to-changes-in-GCC-11.patch
new file mode 100644
index 0000000000..2959a71dea
--- /dev/null
+++ b/package/odb/0012-Adjust-to-changes-in-GCC-11.patch
@@ -0,0 +1,50 @@ 
+From 5a5656920c6b49902ae0da6a0da84efe6e5a66f0 Mon Sep 17 00:00:00 2001
+From: Boris Kolpackov <boris@codesynthesis.com>
+Date: Wed, 31 Mar 2021 10:45:21 +0200
+Subject: [PATCH] Adjust to changes in GCC 11
+
+[Upstream: 61d80f051293a7449a09081f60f48b8377bfbbad]
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
+---
+ odb/gcc.hxx | 20 ++++++++++++++++++++
+ 1 file changed, 20 insertions(+)
+
+diff --git a/odb/gcc.hxx b/odb/gcc.hxx
+index fb6a1bf..d8ad590 100644
+--- a/odb/gcc.hxx
++++ b/odb/gcc.hxx
+@@ -164,6 +164,7 @@ gcc_tree_code_name (gcc_tree_code_type tc) {return tree_code_name[tc];}
+ // In GCC 9:
+ //
+ // INCLUDED_FROM     Became linemap_included_from_linemap().
++//
+ // LAST_SOURCE_LINE  Was removed apparently as no longer used. Studying
+ //                   the line-map.h diff from 8.3 suggests that the old
+ //                   implementation should still work.
+@@ -193,4 +194,23 @@ LAST_SOURCE_LINE (const line_map_ordinary* map)
+ 
+ #endif
+ 
++// In GCC 11:
++//
++// lookup_qualified_name() has a new interface.
++//
++// DECL_IS_BUILTIN became DECL_IS_UNDECLARED_BUILTIN.
++//
++#if BUILDING_GCC_MAJOR >= 11
++
++inline tree
++lookup_qualified_name (tree scope, tree name, bool type, bool complain)
++{
++  return lookup_qualified_name (
++    scope, name, (type ? LOOK_want::TYPE : LOOK_want::NORMAL), complain);
++}
++
++#define DECL_IS_BUILTIN(decl) DECL_IS_UNDECLARED_BUILTIN(decl)
++
++#endif
++
+ #endif // ODB_GCC_HXX
+-- 
+2.34.1
+
diff --git a/package/odb/0013-Resolve-name-lookup-ambiguity-causing-error-with-GCC.patch b/package/odb/0013-Resolve-name-lookup-ambiguity-causing-error-with-GCC.patch
new file mode 100644
index 0000000000..79c3d982fa
--- /dev/null
+++ b/package/odb/0013-Resolve-name-lookup-ambiguity-causing-error-with-GCC.patch
@@ -0,0 +1,68 @@ 
+From 60460df2a6d7b43a860a8f8b614c049ec0127ea8 Mon Sep 17 00:00:00 2001
+From: Boris Kolpackov <boris@codesynthesis.com>
+Date: Wed, 7 Jul 2021 09:26:57 +0200
+Subject: [PATCH] Resolve name lookup ambiguity causing error with GCC 11
+
+[Upstream: 47035c0f72efd99a2210cd45db6e42423fb74533]
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
+---
+ odb/relational/header.hxx | 2 ++
+ odb/relational/source.hxx | 8 ++++++++
+ 2 files changed, 10 insertions(+)
+
+diff --git a/odb/relational/header.hxx b/odb/relational/header.hxx
+index 63dea09..d7f78fa 100644
+--- a/odb/relational/header.hxx
++++ b/odb/relational/header.hxx
+@@ -50,6 +50,8 @@ namespace relational
+ 
+       typedef typename member_base_impl<T>::member_info member_info;
+ 
++      using member_base_impl<T>::container;
++
+       virtual bool
+       pre (member_info& mi)
+       {
+diff --git a/odb/relational/source.hxx b/odb/relational/source.hxx
+index 716aa10..7da25fc 100644
+--- a/odb/relational/source.hxx
++++ b/odb/relational/source.hxx
+@@ -1360,6 +1360,8 @@ namespace relational
+ 
+       typedef typename member_base_impl<T>::member_info member_info;
+ 
++      using member_base_impl<T>::container;
++
+       virtual bool
+       pre (member_info& mi)
+       {
+@@ -1744,6 +1746,8 @@ namespace relational
+ 
+       typedef typename member_base_impl<T>::member_info member_info;
+ 
++      using member_base_impl<T>::container;
++
+       virtual bool
+       pre (member_info& mi)
+       {
+@@ -2007,6 +2011,8 @@ namespace relational
+ 
+       typedef typename member_base_impl<T>::member_info member_info;
+ 
++      using member_base_impl<T>::container;
++
+       virtual void
+       set_null (member_info&) = 0;
+ 
+@@ -2458,6 +2464,8 @@ namespace relational
+ 
+       typedef typename member_base_impl<T>::member_info member_info;
+ 
++      using member_base_impl<T>::container;
++
+       virtual void
+       get_null (string const& var) const = 0;
+ 
+-- 
+2.34.1
+