commit dbe488261d6a70d2754643403263e8b77f96f0ee
Author: Leigh Scott <leigh123linux(a)gmail.com>
Date: Sun Sep 26 20:56:22 2021 +0100
Add fixes for old clang
add-a-TODO-about-a-missing-pnacl-flag.patch | 28 +++++++++++++
chromium-freeworld.spec | 7 ++++
use-ffile-compilation-dir.patch | 65 +++++++++++++++++++++++++++++
3 files changed, 100 insertions(+)
---
diff --git a/add-a-TODO-about-a-missing-pnacl-flag.patch
b/add-a-TODO-about-a-missing-pnacl-flag.patch
new file mode 100644
index 0000000..bfeafee
--- /dev/null
+++ b/add-a-TODO-about-a-missing-pnacl-flag.patch
@@ -0,0 +1,28 @@
+From 7a23987acb698c2934958cb42a5e7b1cd73fe142 Mon Sep 17 00:00:00 2001
+From: Nico Weber <thakis(a)chromium.org>
+Date: Tue, 20 Jul 2021 21:54:09 +0000
+Subject: [PATCH] build: Add a TODO about a missing pnacl flag
+
+Change-Id: I1700d185a23afe4120e14c755782450b1bf89289
+Reviewed-on:
https://chromium-review.googlesource.com/c/chromium/src/+/3041785
+Commit-Queue: Nico Weber <thakis(a)chromium.org>
+Commit-Queue: Hans Wennborg <hans(a)chromium.org>
+Auto-Submit: Nico Weber <thakis(a)chromium.org>
+Reviewed-by: Hans Wennborg <hans(a)chromium.org>
+Cr-Commit-Position: refs/heads/master@{#903659}
+---
+ build/config/compiler/BUILD.gn | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
+index b6e095b705..ef6d1dfc12 100644
+--- a/build/config/compiler/BUILD.gn
++++ b/build/config/compiler/BUILD.gn
+@@ -1217,6 +1217,7 @@ config("compiler_deterministic") {
+ # we build same files with same compile flag.
+ # Other paths are already given in relative, no need to normalize them.
+ if (is_nacl) {
++ #
TODO(https://crbug.com/1231236): Use -ffile-compilation-dir= here.
+ cflags += [
+ "-Xclang",
+ "-fdebug-compilation-dir",
diff --git a/chromium-freeworld.spec b/chromium-freeworld.spec
index 8b2d284..236146b 100644
--- a/chromium-freeworld.spec
+++ b/chromium-freeworld.spec
@@ -169,6 +169,8 @@ Patch201: chromium-93-EnumTable-crash.patch
# Arch Linux patches:
Patch226: chromium-93-ffmpeg-4.4.patch
Patch1227: chromium-94-ffmpeg-roll.patch
+Patch1228: add-a-TODO-about-a-missing-pnacl-flag.patch
+Patch1229: use-ffile-compilation-dir.patch
# Suse patches:
Patch231: remove-llvm13-warning-flags.patch
@@ -220,6 +222,11 @@ Patch1406: chromium-rpm-fusion-brand.patch
# Manually apply patches that need an ifdef
%patch1227 -Rp1
+%if 0%{?fedora} < 35
+%patch1228 -Rp1
+%patch1229 -Rp1
+%endif
+
%if 0%{?fedora} >= 35
%patch1303 -p1
%endif
diff --git a/use-ffile-compilation-dir.patch b/use-ffile-compilation-dir.patch
new file mode 100644
index 0000000..eb14513
--- /dev/null
+++ b/use-ffile-compilation-dir.patch
@@ -0,0 +1,65 @@
+From 34a955823630096f5b01c2b01d51c1ea59d22763 Mon Sep 17 00:00:00 2001
+From: Zequan Wu <zequanwu(a)google.com>
+Date: Tue, 20 Jul 2021 14:13:50 +0000
+Subject: [PATCH] Use -ffile-compilation-dir= instead of
+ -fdebug-compilation-dir=
+
+Bug: 1010267
+Change-Id: If2b4ead8535a76490eb466a38e3d8fed6ea91079
+Reviewed-on:
https://chromium-review.googlesource.com/c/chromium/src/+/2770738
+Auto-Submit: Zequan Wu <zequanwu(a)google.com>
+Commit-Queue: Nico Weber <thakis(a)chromium.org>
+Reviewed-by: Nico Weber <thakis(a)chromium.org>
+Cr-Commit-Position: refs/heads/master@{#903456}
+---
+ build/config/compiler/BUILD.gn | 18 ++++++++++++------
+ build/config/compiler/compiler.gni | 7 ++-----
+ 2 files changed, 14 insertions(+), 11 deletions(-)
+
+diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
+index ede07d111c..6db16c1cdd 100644
+--- a/build/config/compiler/BUILD.gn
++++ b/build/config/compiler/BUILD.gn
+@@ -1216,12 +1216,18 @@ config("compiler_deterministic") {
+ # different build directory like "out/feature_a" and
"out/feature_b" if
+ # we build same files with same compile flag.
+ # Other paths are already given in relative, no need to normalize them.
+- cflags += [
+- "-Xclang",
+- "-fdebug-compilation-dir",
+- "-Xclang",
+- ".",
+- ]
++ if (is_nacl) {
++ cflags += [
++ "-Xclang",
++ "-fdebug-compilation-dir",
++ "-Xclang",
++ ".",
++ ]
++ } else {
++ # -ffile-compilation-dir is an alias for both -fdebug-compilation-dir=
++ # and -fcoverage-compilation-dir=.
++ cflags += [ "-ffile-compilation-dir=." ]
++ }
+ if (!is_win) {
+ # We don't use clang -cc1as on Windows (yet?
https://crbug.com/762167)
+ asmflags = [ "-Wa,-fdebug-compilation-dir,." ]
+diff --git a/build/config/compiler/compiler.gni b/build/config/compiler/compiler.gni
+index 8c259c360a..642319b4f4 100644
+--- a/build/config/compiler/compiler.gni
++++ b/build/config/compiler/compiler.gni
+@@ -225,11 +225,8 @@ declare_args() {
+ # deterministic builds to reduce compile times, so this is less relevant for
+ # official builders.
+ strip_absolute_paths_from_debug_symbols_default =
+- #
TODO(crbug.com/1010267): remove '!use_clang_coverage', coverage build has
+- # dependency to absolute path of source files.
+- !use_clang_coverage &&
+- (is_android || is_fuchsia || is_nacl || (is_win && use_lld) || is_linux ||
+- is_chromeos || (is_apple && !enable_dsyms))
++ is_android || is_fuchsia || is_nacl || (is_win && use_lld) || is_linux ||
++ is_chromeos || (is_apple && !enable_dsyms)
+
+ # If the platform uses stripped absolute paths by default, then we don't expose
+ # it as a configuration option. If this is causing problems, please file a bug.