Accepting request 713244 from home:marxin:branches:network:chromium

- Enable LTO for x86_64 - add gcc-enable-lto.patch and
  gcc-lto-rsp-clobber.patch patches.

OBS-URL: https://build.opensuse.org/request/show/713244
OBS-URL: https://build.opensuse.org/package/show/network:chromium/chromium?expand=0&rev=1273
This commit is contained in:
Tomáš Chvátal
2019-07-03 13:21:29 +00:00
committed by Git OBS Bridge
parent f7927bbed9
commit c835cf326e
5 changed files with 73 additions and 44 deletions

View File

@@ -8,4 +8,14 @@
<size unit="G">8</size> <size unit="G">8</size>
</memory> </memory>
</hardware> </hardware>
<overwrite>
<conditions>
<arch>x86_64</arch>
</conditions>
<hardware>
<memory>
<size unit="G">16</size>
</memory>
</hardware>
</overwrite>
</constraints> </constraints>

View File

@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Tue Jul 2 08:55:22 UTC 2019 - Martin Liška <mliska@suse.cz>
- Enable LTO for x86_64 - add gcc-enable-lto.patch and
gcc-lto-rsp-clobber.patch patches.
------------------------------------------------------------------- -------------------------------------------------------------------
Tue Jul 2 07:35:44 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com> Tue Jul 2 07:35:44 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com>

View File

@@ -47,6 +47,15 @@
%bcond_with system_vpx %bcond_with system_vpx
%bcond_with clang %bcond_with clang
%bcond_with wayland %bcond_with wayland
%ifarch x86_64
%if %{?suse_version} > 1500
%bcond_without lto
%else
%bcond_with lto
%endif
%else
%bcond_with lto
%endif
Name: chromium Name: chromium
Version: 75.0.3770.100 Version: 75.0.3770.100
Release: 0 Release: 0
@@ -84,6 +93,8 @@ Patch12: chromium-skia-aarch64-buildfix.patch
Patch13: chromium-gcc.patch Patch13: chromium-gcc.patch
Patch14: chromium-75.0.3770.80-SIOCGSTAMP.patch Patch14: chromium-75.0.3770.80-SIOCGSTAMP.patch
Patch15: chromium-75.0.3770.80-pure-virtual-crash-fix.patch Patch15: chromium-75.0.3770.80-pure-virtual-crash-fix.patch
Patch16: gcc-lto-rsp-clobber.patch
Patch17: gcc-enable-lto.patch
# Google seem not too keen on merging this but GPU accel is quite important # Google seem not too keen on merging this but GPU accel is quite important
# https://chromium-review.googlesource.com/c/chromium/src/+/532294 # https://chromium-review.googlesource.com/c/chromium/src/+/532294
# https://github.com/saiarcot895/chromium-ubuntu-build/tree/master/debian/patches # https://github.com/saiarcot895/chromium-ubuntu-build/tree/master/debian/patches
@@ -510,6 +521,9 @@ export CXX=clang++
ARCH_FLAGS="`echo %{optflags} | sed -e 's/^-g / /g' -e 's/ -g / /g' -e 's/ -g$//g'`" ARCH_FLAGS="`echo %{optflags} | sed -e 's/^-g / /g' -e 's/ -g / /g' -e 's/ -g$//g'`"
export CFLAGS="${ARCH_FLAGS} -fpermissive" export CFLAGS="${ARCH_FLAGS} -fpermissive"
export CXXFLAGS="${ARCH_FLAGS} -fpermissive" export CXXFLAGS="${ARCH_FLAGS} -fpermissive"
%if %{with lto}
export LDFLAGS="%{_lto_cflags}"
%endif
export CC=gcc export CC=gcc
export CXX=g++ export CXX=g++
%if 0%{?suse_version} <= 1500 %if 0%{?suse_version} <= 1500
@@ -631,6 +645,9 @@ myconf_gn+=" is_clang=true clang_base_path=\"/usr\" clang_use_chrome_plugins=fal
%else %else
myconf_gn+=" is_clang=false" myconf_gn+=" is_clang=false"
%endif %endif
%if %{with lto}
myconf_gn+=" gcc_lto=true"
%endif
# The proprietary codecs just force the chromium to say they can use it and # The proprietary codecs just force the chromium to say they can use it and
# offload the actual computation to the ffmpeg, otherwise the chromium # offload the actual computation to the ffmpeg, otherwise the chromium

View File

@@ -1,17 +1,17 @@
Index: chromium-120.0.6099.18/build/config/BUILDCONFIG.gn diff --git a/build/config/BUILDCONFIG.gn b/build/config/BUILDCONFIG.gn
=================================================================== index 7175865b3..d345f6ff9 100644
--- chromium-120.0.6099.18.orig/build/config/BUILDCONFIG.gn --- a/build/config/BUILDCONFIG.gn
+++ chromium-120.0.6099.18/build/config/BUILDCONFIG.gn +++ b/build/config/BUILDCONFIG.gn
@@ -135,6 +135,8 @@ declare_args() { @@ -130,6 +130,8 @@ declare_args() {
# set "is_official_build" to true for any build intended to ship to end-users. # separate flags.
is_official_build = false is_official_build = false
+ gcc_lto = false + gcc_lto = false
+ +
# Set to true when compiling with the Clang compiler. # Whether we're a traditional desktop unix.
is_clang = current_os != "linux" || is_desktop_linux = current_os == "linux"
(current_cpu != "s390x" && current_cpu != "s390" &&
@@ -354,6 +356,12 @@ default_compiler_configs = [ @@ -440,6 +442,12 @@ default_compiler_configs = [
"//build/config/sanitizers:default_sanitizer_flags", "//build/config/sanitizers:default_sanitizer_flags",
] ]
@@ -23,13 +23,13 @@ Index: chromium-120.0.6099.18/build/config/BUILDCONFIG.gn
+ +
if (is_win) { if (is_win) {
default_compiler_configs += [ default_compiler_configs += [
"//build/config/win:default_cfg_compiler", "//build/config/win:default_crt",
Index: chromium-120.0.6099.18/build/config/compiler/BUILD.gn diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
=================================================================== index 4b24c762b..7da01887a 100644
--- chromium-120.0.6099.18.orig/build/config/compiler/BUILD.gn --- a/build/config/compiler/BUILD.gn
+++ chromium-120.0.6099.18/build/config/compiler/BUILD.gn +++ b/build/config/compiler/BUILD.gn
@@ -2342,6 +2342,10 @@ if (is_win) { @@ -1921,6 +1921,10 @@ if (is_win) {
common_optimize_on_cflags += [ "-fno-math-errno" ] }
} }
+config("gcc_lto") { +config("gcc_lto") {
@@ -37,34 +37,17 @@ Index: chromium-120.0.6099.18/build/config/compiler/BUILD.gn
+} +}
+ +
config("default_stack_frames") { config("default_stack_frames") {
if (!is_win) { if (is_posix || is_fuchsia) {
if (enable_frame_pointers) { if (enable_frame_pointers) {
Index: chromium-120.0.6099.18/sandbox/linux/BUILD.gn diff --git a/sandbox/linux/BUILD.gn b/sandbox/linux/BUILD.gn
=================================================================== index b00a88cfa..db01e988a 100644
--- chromium-120.0.6099.18.orig/sandbox/linux/BUILD.gn --- a/sandbox/linux/BUILD.gn
+++ chromium-120.0.6099.18/sandbox/linux/BUILD.gn +++ b/sandbox/linux/BUILD.gn
@@ -253,6 +253,9 @@ component("seccomp_bpf") { @@ -256,6 +256,7 @@ component("seccomp_bpf") {
"//base", "//base",
"//sandbox:sandbox_buildflags", "//base/third_party/dynamic_annotations",
] ]
+ if (gcc_lto) { + configs -= [ "//build/config/compiler:gcc_lto" ]
+ configs -= [ "//build/config/compiler:gcc_lto" ]
+ }
if (is_android) { if (is_nacl_nonsfi) {
sources += [ cflags = [ "-fgnu-inline-asm" ]
Index: chromium-120.0.6099.18/base/BUILD.gn
===================================================================
--- chromium-120.0.6099.18.orig/base/BUILD.gn
+++ chromium-120.0.6099.18/base/BUILD.gn
@@ -3561,6 +3561,10 @@
sources += [ "location_unittest.cc" ]
}
+ if (gcc_lto) {
+ configs -= [ "//build/config/compiler:gcc_lto" ]
+ }
+
if (!is_nacl) {
sources += [
"containers/span_rust_unittest.cc",

13
gcc-lto-rsp-clobber.patch Normal file
View File

@@ -0,0 +1,13 @@
diff --git a/third_party/lss/linux_syscall_support.h b/third_party/lss/linux_syscall_support.h
index 5d9c2e858..e64703ba0 100644
--- a/third_party/lss/linux_syscall_support.h
+++ b/third_party/lss/linux_syscall_support.h
@@ -2405,7 +2405,7 @@ struct kernel_statfs {
"d"(LSS_SYSCALL_ARG(parent_tidptr)),
"r"(LSS_SYSCALL_ARG(newtls)),
"r"(LSS_SYSCALL_ARG(child_tidptr))
- : "rsp", "memory", "r8", "r10", "r11", "rcx");
+ : "memory", "r8", "r10", "r11", "rcx");
}
LSS_RETURN(int, __res);
}