diff mbox series

arm/gn: fix build with GCC <13

Message ID 20230620140137.481227-1-ross.burton@arm.com
State New
Headers show
Series arm/gn: fix build with GCC <13 | expand

Commit Message

Ross Burton June 20, 2023, 2:01 p.m. UTC
From: Ross Burton <ross.burton@arm.com>

The previous commit fixed the build of GN with GCC 13, but broke it for
any other version.

Remove the patch and simply disable the fatal warning that causes the
breakage. Interestingly, this warning is already disabled for Windows
builds.

Signed-off-by: Ross Burton <ross.burton@arm.com>
---
 ...Remove-redundant-move-in-return-stat.patch | 43 -------------------
 meta-arm/recipes-devtools/gn/gn_git.bb        |  7 ++-
 2 files changed, 6 insertions(+), 44 deletions(-)
 delete mode 100644 meta-arm/recipes-devtools/gn/gn/0001-desc_builder.cc-Remove-redundant-move-in-return-stat.patch

Comments

Jon Mason June 21, 2023, 4:08 a.m. UTC | #1
On Tue, 20 Jun 2023 15:01:37 +0100, ross.burton@arm.com wrote:
> The previous commit fixed the build of GN with GCC 13, but broke it for
> any other version.
> 
> Remove the patch and simply disable the fatal warning that causes the
> breakage. Interestingly, this warning is already disabled for Windows
> builds.

Applied, thanks!

[1/1] arm/gn: fix build with GCC <13
      commit: 533cbfd10b56cf4ed53c8fefc60095434544d450

Best regards,
diff mbox series

Patch

diff --git a/meta-arm/recipes-devtools/gn/gn/0001-desc_builder.cc-Remove-redundant-move-in-return-stat.patch b/meta-arm/recipes-devtools/gn/gn/0001-desc_builder.cc-Remove-redundant-move-in-return-stat.patch
deleted file mode 100644
index f712037a..00000000
--- a/meta-arm/recipes-devtools/gn/gn/0001-desc_builder.cc-Remove-redundant-move-in-return-stat.patch
+++ /dev/null
@@ -1,43 +0,0 @@ 
-From 45673f4f62eb063d6d5aa0ad68a6171936ad9347 Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Tue, 24 Jan 2023 00:13:57 -0800
-Subject: [PATCH] desc_builder.cc: Remove redundant move in return statement
-
-Fixes build with gcc13
-
-../git/src/gn/desc_builder.cc: In member function 'base::Value {anonymous}::BaseDescBuilder::ToBaseValue(const Scope*)':
-../git/src/gn/desc_builder.cc:179:21: error: redundant move in return statement [-Werror=redundant-move]
-  179 |     return std::move(res);
-      |            ~~~~~~~~~^~~~~
-
-Upstream-Status: Submitted [https://gn-review.googlesource.com/c/gn/+/15000]
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
- src/gn/desc_builder.cc | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/src/gn/desc_builder.cc b/src/gn/desc_builder.cc
-index 444a5e02..3ef170c3 100644
---- a/src/gn/desc_builder.cc
-+++ b/src/gn/desc_builder.cc
-@@ -167,7 +167,7 @@ class BaseDescBuilder {
-     base::ListValue res;
-     for (const auto& v : vector)
-       res.GetList().emplace_back(ToBaseValue(v));
--    return std::move(res);
-+    return res;
-   }
- 
-   base::Value ToBaseValue(const Scope* scope) {
-@@ -176,7 +176,7 @@ class BaseDescBuilder {
-     scope->GetCurrentScopeValues(&map);
-     for (const auto& v : map)
-       res.SetKey(v.first, ToBaseValue(v.second));
--    return std::move(res);
-+    return res;
-   }
- 
-   base::Value ToBaseValue(const Value& val) {
--- 
-2.39.1
-
diff --git a/meta-arm/recipes-devtools/gn/gn_git.bb b/meta-arm/recipes-devtools/gn/gn_git.bb
index 44a7f3a6..3713787a 100644
--- a/meta-arm/recipes-devtools/gn/gn_git.bb
+++ b/meta-arm/recipes-devtools/gn/gn_git.bb
@@ -5,7 +5,6 @@  LICENSE = "BSD-3-Clause"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=0fca02217a5d49a14dfe2d11837bb34d"
 
 SRC_URI = "git://gn.googlesource.com/gn;protocol=https;branch=main \
-           file://0001-desc_builder.cc-Remove-redundant-move-in-return-stat.patch \
            file://0001-Replace-lstat64-stat64-functions-on-linux.patch"
 SRCREV = "4bd1a77e67958fb7f6739bd4542641646f264e5d"
 PV = "0+git${SRCPV}"
@@ -13,6 +12,12 @@  PV = "0+git${SRCPV}"
 S = "${WORKDIR}/git"
 B = "${WORKDIR}/build"
 
+# Work around this fatal warning:
+# ../git/src/gn/desc_builder.cc: In member function 'base::Value {anonymous}::BaseDescBuilder::ToBaseValue(const Scope*)':
+# ../git/src/gn/desc_builder.cc:179:21: error: redundant move in return statement [-Werror=redundant-move]
+#   179 |     return std::move(res);
+CFLAGS:append = " -Wno-redundant-move"
+
 # Map from our _OS strings to the GN's platform values.
 def gn_platform(variable, d):
     os = d.getVar(variable)