commit 39a633e0b53e590ebd8ea5ed2f901854f937544e
Author: Akarshan Biswas <akarshan.biswas(a)gmail.com>
Date: Sun Mar 17 09:41:03 2019 +0530
Switched to clang compiler which is supported by upstream
...atch => chromium-color_utils-use-std-sqrt.patch | 5 +-
chromium-gcc8-r630084.patch | 108 ---------------------
chromium-gcc8-r630249.patch | 69 -------------
chromium-gcc8-r630355.patch | 99 -------------------
chromium-gcc8-r631472.patch | 59 -----------
chromium-gcc8-r631962.patch | 65 -------------
chromium-gcc8-r632385.patch | 100 -------------------
chromium-media-fix-build-with-libstdc++.patch | 48 +++++++++
chromium-vaapi.spec | 54 +++++------
gn-gold.patch | 24 -----
silencegcc.patch | 31 ------
11 files changed, 73 insertions(+), 589 deletions(-)
---
diff --git a/chromium-gcc8-r630140.patch b/chromium-color_utils-use-std-sqrt.patch
similarity index 97%
rename from chromium-gcc8-r630140.patch
rename to chromium-color_utils-use-std-sqrt.patch
index 9d1f05a..0f3dbf6 100644
--- a/chromium-gcc8-r630140.patch
+++ b/chromium-color_utils-use-std-sqrt.patch
@@ -34,7 +34,7 @@ Cr-Commit-Position: refs/heads/master@{#630140}
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ui/gfx/color_utils.cc b/ui/gfx/color_utils.cc
-index c868cd54bac3..92ba1407d594 100644
+index c868cd54bac3f..92ba1407d594f 100644
--- a/ui/gfx/color_utils.cc
+++ b/ui/gfx/color_utils.cc
@@ -431,7 +431,7 @@ SkColor SetDarkestColorForTesting(SkColor color) {
@@ -46,6 +46,3 @@ index c868cd54bac3..92ba1407d594 100644
return previous_darkest_color;
}
---
-2.20.1
-
diff --git a/chromium-media-fix-build-with-libstdc++.patch
b/chromium-media-fix-build-with-libstdc++.patch
new file mode 100644
index 0000000..e6ea91c
--- /dev/null
+++ b/chromium-media-fix-build-with-libstdc++.patch
@@ -0,0 +1,48 @@
+From d4824fb46a07f3dbecf6358020f0f0da2c586475 Mon Sep 17 00:00:00 2001
+From: Tom Anderson <thomasanderson(a)chromium.org>
+Date: Sat, 16 Feb 2019 05:35:55 +0000
+Subject: [PATCH] Fix build with libstdc++
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+When building with libstdc++ (use_custom_libcxx=false), we get (different) build
+erros when building with clang and gcc.
+
+clang:
+ base/optional.h:348:61: error: no member named 'value' in
+ 'std::is_constructible<media::learning::Value, const
+ base::Optional<media::learning::Value> &>'
+
+gcc:
+ base/optional.h:347:57: error: incomplete type
+ ‘std::is_constructible<media::learning::Value,
+ base::Optional<media::learning::Value>&>’ used in nested name specifier
+
+BUG=931373
+
+Change-Id: I133ff4f30398202b5726c605fafee8aa916179d3
+Reviewed-on:
https://chromium-review.googlesource.com/c/1475936
+Auto-Submit: Thomas Anderson <thomasanderson(a)chromium.org>
+Commit-Queue: Frank Liberato <liberato(a)chromium.org>
+Reviewed-by: Frank Liberato <liberato(a)chromium.org>
+Cr-Original-Commit-Position: refs/heads/master@{#632921}
+Cr-Mirrored-From:
https://chromium.googlesource.com/chromium/src
+Cr-Mirrored-Commit: 08b9fbc728043c89f21af46796bacd7324b7ce06
+---
+ media/learning/common/value.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/media/learning/common/value.h b/learning/common/value.h
+index 62f4953f6..ef37eebd4 100644
+--- a/media/learning/common/value.h
++++ b/media/learning/common/value.h
+@@ -27,7 +27,7 @@ class COMPONENT_EXPORT(LEARNING_COMMON) Value {
+ public:
+ Value();
+ template <typename T>
+- explicit Value(T x) : value_(x) {
++ explicit Value(const T& x) : value_(x) {
+ // We want to rule out mostly pointers, since they wouldn't make much sense.
+ // Note that the implicit cast would likely fail anyway.
+ static_assert(std::is_arithmetic<T>::value || std::is_enum<T>::value,
diff --git a/chromium-vaapi.spec b/chromium-vaapi.spec
index 171a17b..176e346 100644
--- a/chromium-vaapi.spec
+++ b/chromium-vaapi.spec
@@ -58,7 +58,7 @@
%global jumbo 1
#------------------------------------------------------
#Build debug packages for debugging
-%global debug_pkg 1
+%global debug_pkg 0
#Allow building with Fedora compilation flags
%global fedora_compilation_flags 0
# Gold switch
@@ -101,8 +101,8 @@ Source15: LICENSE
########################################################################################
#Compiler settings
# Make sure we don't encounter any bug
-BuildRequires: gcc
-BuildRequires: gcc-c++
+BuildRequires: clang, llvm
+BuildRequires: lld
# Basic tools and libraries needed for building
BuildRequires: ninja-build, nodejs, bison, gperf, hwdata
BuildRequires: libgcc, glibc, libatomic
@@ -194,19 +194,6 @@ ExclusiveArch: x86_64
Patch1: enable-vaapi.patch
# Enable support for widevine
Patch2: widevine.patch
-#Gcc patches area.
-#Gcc produces way too many warnings. Try to silence some of it.
-Patch8: silencegcc.patch
-# More patches to fix chromium build here
-#Gentoo patches
-Patch9: chromium-gcc8-r630084.patch
-Patch10: chromium-gcc8-r630140.patch
-Patch11: chromium-gcc8-r630249.patch
-Patch12: chromium-gcc8-r630355.patch
-Patch13: chromium-gcc8-r631472.patch
-Patch14: chromium-gcc8-r631962.patch
-Patch15: chromium-gcc8-r632385.patch
-# remove dependency on unrar. That's a nasty code.
Patch50: nounrar.patch
# Bootstrap still uses python command
Patch51: py2-bootstrap.patch
@@ -214,13 +201,14 @@ Patch51: py2-bootstrap.patch
Patch52: chromium-system-icu.patch
# Let's brand chromium!
Patch54: brand.patch
-#Use gold in gn bootstrap
-Patch64: gn-gold.patch
#Stolen from Fedora to fix building with pipewire
#
https://src.fedoraproject.org/rpms/chromium/blob/master/f/chromium-73.0.3...
Patch65: chromium-73.0.3683.75-pipewire-cstring-fix.patch
# Stop Vsync error spam when chromium runs on Wayland (Reviewed upstream)
Patch66: stopVsyncspam.patch
+#Fix chromium color
+Patch67: chromium-color_utils-use-std-sqrt.patch
+Patch68: chromium-media-fix-build-with-libstdc++.patch
%description
chromium-vaapi is an open-source web browser, powered by WebKit (Blink)
############################################PREP###########################################################
@@ -229,14 +217,6 @@ chromium-vaapi is an open-source web browser, powered by WebKit
(Blink)
## Apply patches here ##
%patch1 -p1 -b .vaapi
%patch2 -p1 -b .widevine
-%patch8 -p1 -b .silencegcc
-%patch9 -p1 -b .gcc81
-%patch10 -p1 -b .gcc82
-%patch11 -p1 -b .gcc83
-%patch12 -p1 -b .gcc84
-%patch13 -p1 -b gcc85
-%patch14 -p1 -b .gcc86
-%patch15 -p1 -b .gcc87
%patch50 -p1 -b .nounrar
%patch51 -p1 -b .py2boot
%if %{with system_libicu}
@@ -245,11 +225,13 @@ chromium-vaapi is an open-source web browser, powered by WebKit
(Blink)
%if %{freeworld}
%patch54 -p1 -b .brand
%endif
-%patch64 -p1 -b .gn
+#%patch64 -p1 -b .gn
%if 0%{?fedora} >= 29
%patch65 -p1 -b .pipewire
%endif
%patch66 -p1 -b .vsync
+%patch67 -p1 -b .color
+%patch68 -p1 -b .media
#Let's change the default shebang of python files.
find -depth -type f -writable -name "*.py" -exec sed -iE '1s=^#!
*/usr/bin/\(python\|env python\)[23]\?=#!%{__python2}=' {} +
./build/linux/unbundle/remove_bundled_libraries.py --do-remove \
@@ -485,6 +467,12 @@ sed -i 's|//third_party/usb_ids|/usr/share/hwdata|g'
device/usb/BUILD.gn
# Don't use static libstdc++
sed -i '/-static-libstdc++/d' tools/gn/build/gen.py
+# Remove compiler flags not supported by our system clang
+ sed -i \
+ -e '/"-Wno-ignored-pragma-optimize"/d' \
+ build/config/compiler/BUILD.gn
+
+
rmdir third_party/markupsafe
ln -s %{python2_sitearch}/markupsafe third_party/markupsafe
@@ -501,8 +489,8 @@ sed -i.orig -e
's/getenv("CHROME_VERSION_EXTRA")/"%{name}"/' $FILE
#####################################BUILD#############################################
%build
#export compilar variables
-export AR=ar NM=nm
-export CC=gcc CXX=g++
+export AR=llvm-ar NM=llvm-nm AS=llvm-as
+export CC=clang CXX=clang++
%if %{fedora_compilation_flags}
#Build flags to make hardened binaries
#Remove some flags which are incompatible with chromium code.
@@ -566,11 +554,17 @@ gn_args=(
# Gold is faulty on rawhide so disabled it.
gn_args+=(
is_clang=false
- use_lld=false
+ use_lld=true
%if %{stopgold}
use_gold=false
%endif
)
+#compiler settings
+gn_args+=(
+ is_clang=true
+ 'clang_base_path = "/usr"'
+ clang_use_chrome_plugins=false
+)
#Jumbo stuff
gn_args+=(
%if %{jumbo}