summary refs log tree commit diff
path: root/pkgs/os-specific/linux/chromium-os/common-mk
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/os-specific/linux/chromium-os/common-mk')
-rw-r--r--pkgs/os-specific/linux/chromium-os/common-mk/0001-common-mk-don-t-leak-source-absolute-paths.patch18
-rw-r--r--pkgs/os-specific/linux/chromium-os/common-mk/0002-common-mk-.gn-don-t-hardcode-env-path.patch6
-rw-r--r--pkgs/os-specific/linux/chromium-os/common-mk/0003-Revert-common-mk-Suppress-Wrange-loop-analysis-warni.patch72
-rw-r--r--pkgs/os-specific/linux/chromium-os/common-mk/default.nix1
4 files changed, 85 insertions, 12 deletions
diff --git a/pkgs/os-specific/linux/chromium-os/common-mk/0001-common-mk-don-t-leak-source-absolute-paths.patch b/pkgs/os-specific/linux/chromium-os/common-mk/0001-common-mk-don-t-leak-source-absolute-paths.patch
index 769770db57e..741b50af1b4 100644
--- a/pkgs/os-specific/linux/chromium-os/common-mk/0001-common-mk-don-t-leak-source-absolute-paths.patch
+++ b/pkgs/os-specific/linux/chromium-os/common-mk/0001-common-mk-don-t-leak-source-absolute-paths.patch
@@ -1,7 +1,7 @@
-From 05622922a69bda21677a7f59b19214e3a00855c4 Mon Sep 17 00:00:00 2001
+From 56d3fe9520c1ef2a6400939f4deae06d9b5cdfc2 Mon Sep 17 00:00:00 2001
 From: Alyssa Ross <hi@alyssa.is>
 Date: Sun, 24 Nov 2019 16:56:11 +0000
-Subject: [PATCH 01/10] common-mk: don't leak source-absolute paths
+Subject: [PATCH 1/6] common-mk: don't leak source-absolute paths
 
 Source-absolute paths like //vm_tools/whatever were being leaked to
 subprocesses, which of course didn't know how to understand them.
@@ -55,7 +55,7 @@ index af3c3fb4c..151c49e56 100644
        args += [ "--description=" + description ]
      }
 diff --git a/common-mk/proto_library.gni b/common-mk/proto_library.gni
-index 70e32cafc..f6dce2760 100644
+index 7fcb08341..692704288 100644
 --- a/common-mk/proto_library.gni
 +++ b/common-mk/proto_library.gni
 @@ -56,7 +56,7 @@ template("proto_library") {
@@ -67,7 +67,7 @@ index 70e32cafc..f6dce2760 100644
  
      proto_lib_dirs = [
        proto_in_dir,
-@@ -92,24 +92,23 @@ template("proto_library") {
+@@ -94,24 +94,23 @@ template("proto_library") {
      args += [ "${proto_in_dir}/{{source_name_part}}.proto" ]
      outputs = []
      if (gen_python) {
@@ -97,7 +97,7 @@ index 70e32cafc..f6dce2760 100644
        ]
        outputs += [
          "${cc_dir}/{{source_name_part}}.grpc.pb.cc",
-@@ -119,7 +118,7 @@ template("proto_library") {
+@@ -121,7 +120,7 @@ template("proto_library") {
        ]
      }
      if (!gen_grpc && !gen_python) {
@@ -106,7 +106,7 @@ index 70e32cafc..f6dce2760 100644
        outputs += [
          "${cc_dir}/{{source_name_part}}.pb.cc",
          "${cc_dir}/{{source_name_part}}.pb.h",
-@@ -206,7 +205,9 @@ template("goproto_library") {
+@@ -208,7 +207,9 @@ template("goproto_library") {
      # otherwise file descriptor var name will conflict.
      # cf) https://github.com/golang/protobuf/issues/109
  
@@ -116,7 +116,7 @@ index 70e32cafc..f6dce2760 100644
  
      # Build protoc command line to run.
      script = "//common-mk/file_generator_wrapper.py"
-@@ -222,7 +223,7 @@ template("goproto_library") {
+@@ -224,7 +225,7 @@ template("goproto_library") {
        "--proto_path",
        "${sysroot}/usr/share/proto",
        "--go_out",
@@ -125,7 +125,7 @@ index 70e32cafc..f6dce2760 100644
      ]
      foreach(source, sources) {
        args += [ rebase_path(source) ]
-@@ -232,7 +233,7 @@ template("goproto_library") {
+@@ -234,7 +235,7 @@ template("goproto_library") {
      outputs = []
      foreach(source, invoker.sources) {
        name = get_path_info(source, "name")
@@ -135,5 +135,5 @@ index 70e32cafc..f6dce2760 100644
    }
  }
 -- 
-2.24.1
+2.25.1
 
diff --git a/pkgs/os-specific/linux/chromium-os/common-mk/0002-common-mk-.gn-don-t-hardcode-env-path.patch b/pkgs/os-specific/linux/chromium-os/common-mk/0002-common-mk-.gn-don-t-hardcode-env-path.patch
index 731b9ca1965..51c15dcd4cb 100644
--- a/pkgs/os-specific/linux/chromium-os/common-mk/0002-common-mk-.gn-don-t-hardcode-env-path.patch
+++ b/pkgs/os-specific/linux/chromium-os/common-mk/0002-common-mk-.gn-don-t-hardcode-env-path.patch
@@ -1,7 +1,7 @@
-From d3ea2a8f9f64e2aff9667f03a93540e2e72c0f30 Mon Sep 17 00:00:00 2001
+From ec1afec90fd8e391b93f53f0abd8bc11cdba0a32 Mon Sep 17 00:00:00 2001
 From: Alyssa Ross <hi@alyssa.is>
 Date: Sun, 24 Nov 2019 17:20:46 +0000
-Subject: [PATCH 02/10] common-mk: .gn: don't hardcode env path
+Subject: [PATCH 2/6] common-mk: .gn: don't hardcode env path
 
 This is needlessly non-portable.
 ---
@@ -19,5 +19,5 @@ index e7dba8c91..e29fcd61e 100644
 -script_executable = "/usr/bin/env"
 +script_executable = "env"
 -- 
-2.24.1
+2.25.1
 
diff --git a/pkgs/os-specific/linux/chromium-os/common-mk/0003-Revert-common-mk-Suppress-Wrange-loop-analysis-warni.patch b/pkgs/os-specific/linux/chromium-os/common-mk/0003-Revert-common-mk-Suppress-Wrange-loop-analysis-warni.patch
new file mode 100644
index 00000000000..d3d4e915163
--- /dev/null
+++ b/pkgs/os-specific/linux/chromium-os/common-mk/0003-Revert-common-mk-Suppress-Wrange-loop-analysis-warni.patch
@@ -0,0 +1,72 @@
+From b3add805d98e01488d71cbad51206f3a4949bb1c Mon Sep 17 00:00:00 2001
+From: Denis Nikitin <denik@chromium.org>
+Date: Wed, 5 Feb 2020 18:43:38 +0000
+Subject: [PATCH 3/6] Revert "common-mk: Suppress -Wrange-loop-analysis
+ warning"
+
+This reverts commit 09298dce8d31b5744a83784d027a3fd1e312eb6d.
+
+Reason for revert: <The warning is fixed in the upstream starting from r382025>
+
+Original change's description:
+> common-mk: Suppress -Wrange-loop-analysis warning
+>
+> Disable range-loop-analysis warning in platform2 to unblock llvm-next
+> builds failing with the following warning in libbrillo which can't be
+> easily fixed:
+>
+> data_serialization.h:471:20: error: loop variable 'element' is always a
+> copy because the range of type 'const std::vector<bool, allocator<bool>
+> >' does not return a reference [-Werror,-Wrange-loop-analysis]
+>   for (const auto& element : value) {
+>                                 ^
+> use non-reference type
+> 'std::__1::__bit_const_reference<std::__1::vector<bool,
+> std::__1::allocator<bool> > >'
+>
+> BUG=chromium:1042979
+> TEST=emerge-kevin libbrillo
+>
+> Change-Id: If5b70cb1a836df325d3683217be4c841fc7a5516
+> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform2/+/2008102
+> Reviewed-by: Manoj Gupta <manojgupta@chromium.org>
+> Reviewed-by: Chris McDonald <cjmcdonald@chromium.org>
+> Tested-by: Manoj Gupta <manojgupta@chromium.org>
+
+Bug: chromium:1042979
+Change-Id: Ib86d9f0d61b703d391f60824d8d2ef47eb60f345
+Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform2/+/2039651
+Reviewed-by: Mike Frysinger <vapier@chromium.org>
+Reviewed-by: Chris McDonald <cjmcdonald@chromium.org>
+Commit-Queue: Denis Nikitin <denik@chromium.org>
+Tested-by: Denis Nikitin <denik@chromium.org>
+(cherry picked from commit f53a0117ded343295015e81db68bbe878fae5fac)
+---
+ common-mk/BUILD.gn | 4 ----
+ 1 file changed, 4 deletions(-)
+
+diff --git a/common-mk/BUILD.gn b/common-mk/BUILD.gn
+index 7c0601b18..dc02a6979 100644
+--- a/common-mk/BUILD.gn
++++ b/common-mk/BUILD.gn
+@@ -53,7 +53,6 @@ config("compiler_defaults") {
+   cflags = [
+     "-Wall",
+     "-Wunused",
+-
+     # We use C99 array designators in C++ code.  Our compilers support this
+     # extension since C++ has no equivalent yet (as of C++20).
+     "-Wno-c99-designator",
+@@ -65,9 +64,6 @@ config("compiler_defaults") {
+     "-fvisibility=internal",
+     "-Wa,--noexecstack",
+     "-Wimplicit-fallthrough",
+-
+-    # TODO(crbug.com/1042979): Verify the warning when the issue gets fixed.
+-    "-Wno-range-loop-analysis",
+   ]
+   cflags_c = [ "-std=gnu11" ] + external_cppflags + external_cxxflags
+   cflags_cc = [ "-std=gnu++14" ] + external_cppflags + external_cxxflags
+-- 
+2.25.1
+
diff --git a/pkgs/os-specific/linux/chromium-os/common-mk/default.nix b/pkgs/os-specific/linux/chromium-os/common-mk/default.nix
index 946b2e73d2a..f07e418b56f 100644
--- a/pkgs/os-specific/linux/chromium-os/common-mk/default.nix
+++ b/pkgs/os-specific/linux/chromium-os/common-mk/default.nix
@@ -59,6 +59,7 @@ stdenv.mkDerivation ({
     '') ([
       ./0001-common-mk-don-t-leak-source-absolute-paths.patch
       ./0002-common-mk-.gn-don-t-hardcode-env-path.patch
+      ./0003-Revert-common-mk-Suppress-Wrange-loop-analysis-warni.patch
     ] ++ platform2Patches)}
 
     patchShebangs common-mk