mirror of
https://abf.rosa.ru/djam/chromium-browser-stable-test.git
synced 2025-02-23 17:42:45 +00:00
Fix memory usage when linking with is_official_build=true, initial support of building with debuginfo, but debugsource subpackage is still empty
This commit is contained in:
parent
703a7ad6bf
commit
ee81ef8a57
3 changed files with 89 additions and 8 deletions
|
@ -10,21 +10,31 @@
|
||||||
# Get the version number of latest stable version
|
# Get the version number of latest stable version
|
||||||
# $ curl -s 'https://omahaproxy.appspot.com/all?os=linux&channel=stable' | sed 1d | cut -d , -f 3
|
# $ curl -s 'https://omahaproxy.appspot.com/all?os=linux&channel=stable' | sed 1d | cut -d , -f 3
|
||||||
|
|
||||||
%define debug_package %{nil}
|
|
||||||
|
|
||||||
%ifarch %{x86_64} %ix86
|
%ifarch %{x86_64} %ix86
|
||||||
%bcond_without gost
|
%bcond_without gost
|
||||||
%else
|
%else
|
||||||
%bcond_with gost
|
%bcond_with gost
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
|
# Gold linker
|
||||||
|
# http://a3f.at/lists/linkers
|
||||||
|
%bcond_with gold
|
||||||
|
|
||||||
|
# Linker is out of memory on 32 bit with -g2
|
||||||
|
# XXX debugsource package is empty, probably there are odd compiler flags
|
||||||
|
# TODO: fix building with debuginfo
|
||||||
|
%bcond_with debug
|
||||||
|
|
||||||
|
%if %{without debug}
|
||||||
|
%define debug_package %{nil}
|
||||||
|
%endif
|
||||||
|
|
||||||
# eol 'fix' corrupts some .bin
|
# eol 'fix' corrupts some .bin
|
||||||
%define dont_fix_eol 1
|
%define dont_fix_eol 1
|
||||||
%define _disable_lto 1
|
%define _disable_lto 1
|
||||||
|
|
||||||
%define crname chromium-browser
|
%define crname chromium-browser
|
||||||
%define _crdir %{_libdir}/%{crname}
|
%define _crdir %{_libdir}/%{crname}
|
||||||
%define _src %{_topdir}/SOURCES
|
|
||||||
|
|
||||||
%define ffmpeg 1
|
%define ffmpeg 1
|
||||||
%define icu 0
|
%define icu 0
|
||||||
|
@ -61,10 +71,13 @@
|
||||||
# Chromium build scripts are not compatible with Python 3 yet
|
# Chromium build scripts are not compatible with Python 3 yet
|
||||||
%define __python %{__python2}
|
%define __python %{__python2}
|
||||||
|
|
||||||
|
# workaround rpmlint bugs (?)
|
||||||
|
%global _build_pkgcheck_set /bin/sh %{_sourcedir}/rpmlint-wrapper.sh %{_build_pkgcheck_set}
|
||||||
|
|
||||||
Summary: A fast web browser based on the Blink engine
|
Summary: A fast web browser based on the Blink engine
|
||||||
Name: chromium-browser-stable
|
Name: chromium-browser-stable
|
||||||
Version: 89.0.4389.90
|
Version: 89.0.4389.90
|
||||||
Release: 1
|
Release: 3
|
||||||
License: BSD, LGPL
|
License: BSD, LGPL
|
||||||
Group: Networking/WWW
|
Group: Networking/WWW
|
||||||
Url: https://www.chromium.org/Home
|
Url: https://www.chromium.org/Home
|
||||||
|
@ -72,6 +85,7 @@ Source0: https://commondatastorage.googleapis.com/chromium-browser-official/chro
|
||||||
Source1: chromium-wrapper
|
Source1: chromium-wrapper
|
||||||
Source2: %{crname}.desktop
|
Source2: %{crname}.desktop
|
||||||
Source10: %{name}.rpmlintrc
|
Source10: %{name}.rpmlintrc
|
||||||
|
Source11: rpmlint-wrapper.sh
|
||||||
# Bring xcb-proto with us (might need more than python on EPEL?)
|
# Bring xcb-proto with us (might need more than python on EPEL?)
|
||||||
Source20: https://www.x.org/releases/individual/proto/xcb-proto-%{xcb_version}.tar.xz
|
Source20: https://www.x.org/releases/individual/proto/xcb-proto-%{xcb_version}.tar.xz
|
||||||
Source30: master_preferences
|
Source30: master_preferences
|
||||||
|
@ -139,6 +153,8 @@ Patch644: enable-vaapi-on-linux.diff
|
||||||
# https://github.com/saiarcot895/chromium-ubuntu-build/blob/master/debian/patches/vdpau-support.patch
|
# https://github.com/saiarcot895/chromium-ubuntu-build/blob/master/debian/patches/vdpau-support.patch
|
||||||
Patch645: vdpau-support.patch
|
Patch645: vdpau-support.patch
|
||||||
Patch646: ALT-allow-to-override-clang-through-env-variables.patch
|
Patch646: ALT-allow-to-override-clang-through-env-variables.patch
|
||||||
|
# XXX This patch is not enough to fully fix debuginfo and debugsource subpackages
|
||||||
|
Patch647: fix-debugsource.patch
|
||||||
|
|
||||||
BuildRequires: bison
|
BuildRequires: bison
|
||||||
BuildRequires: llvm11
|
BuildRequires: llvm11
|
||||||
|
@ -360,6 +376,7 @@ cp -f %{_gostsourcedir}/src/msspi/third_party/cprocsp/include/* third_party/bori
|
||||||
%patch644 -p1
|
%patch644 -p1
|
||||||
%patch645 -p1
|
%patch645 -p1
|
||||||
%patch646 -p1
|
%patch646 -p1
|
||||||
|
%patch647 -p1
|
||||||
|
|
||||||
# fatal error: 'fuzzer/FuzzedDataProvider.h' file not found
|
# fatal error: 'fuzzer/FuzzedDataProvider.h' file not found
|
||||||
# (Available in Clang10)
|
# (Available in Clang10)
|
||||||
|
@ -425,11 +442,16 @@ export PYTHONPATH="../../third_party/pyjson5/src:../../xcb-proto-%{xcb_version}"
|
||||||
%define is_widevine false
|
%define is_widevine false
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%define lld 1
|
%if %{with gold}
|
||||||
%if 0%{lld}
|
|
||||||
%define linker_params use_gold=false use_lld=true
|
|
||||||
%else
|
|
||||||
%define linker_params use_gold=true use_lld=false
|
%define linker_params use_gold=true use_lld=false
|
||||||
|
%else
|
||||||
|
%define linker_params use_gold=false use_lld=true
|
||||||
|
%endif
|
||||||
|
|
||||||
|
%if %{with debug}
|
||||||
|
%define symbol_level 2
|
||||||
|
%else
|
||||||
|
%define symbol_level 0
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%if %{without bundled_llvm}
|
%if %{without bundled_llvm}
|
||||||
|
@ -460,6 +482,8 @@ export PYTHONPATH="../../third_party/pyjson5/src:../../xcb-proto-%{xcb_version}"
|
||||||
%define gn_config use_sysroot=false \
|
%define gn_config use_sysroot=false \
|
||||||
%{target_cpu} \
|
%{target_cpu} \
|
||||||
is_official_build=true \
|
is_official_build=true \
|
||||||
|
symbol_level=%{symbol_level} \
|
||||||
|
strip_debug_info=false \
|
||||||
system_libdir="%{_lib}" \
|
system_libdir="%{_lib}" \
|
||||||
icu_use_data_file=true \
|
icu_use_data_file=true \
|
||||||
enable_nacl=false \
|
enable_nacl=false \
|
||||||
|
@ -550,6 +574,20 @@ CXXFLAGS="-nostdinc++ \
|
||||||
" \
|
" \
|
||||||
%{__python} tools/gn/bootstrap/bootstrap.py --gn-gen-args='%{gn_config}'
|
%{__python} tools/gn/bootstrap/bootstrap.py --gn-gen-args='%{gn_config}'
|
||||||
unset LDFLAGS CXXFLAGS
|
unset LDFLAGS CXXFLAGS
|
||||||
|
|
||||||
|
# Reduce memory usage by linker
|
||||||
|
%ifarch %{ix86}
|
||||||
|
%if %{with gold}
|
||||||
|
# https://lwn.net/Articles/797303/
|
||||||
|
export LDFLAGS="-Wl,--no-map-whole-files -Wl,--no-keep-memory -Wl,--no-keep-files-mapped -Wl,--no-mmap-output-file"
|
||||||
|
sed -i -e 's/--threads/--no-threads/' -e '/--thread-count=4/d' build/config/compiler/BUILD.gn
|
||||||
|
%else
|
||||||
|
# Try to reduce memory usage by ld.lld. Multi threads are enabled by default.
|
||||||
|
# XXX Will it reduce it? It is not really needed, lld does not get out of memory without it, at least without debuginfo.
|
||||||
|
export LDFLAGS="-Wl,--threads=1"
|
||||||
|
%endif
|
||||||
|
%endif
|
||||||
|
|
||||||
out/Release/gn gen --script-executable=%{__python} --args='%{gn_config}' out/Release
|
out/Release/gn gen --script-executable=%{__python} --args='%{gn_config}' out/Release
|
||||||
|
|
||||||
pushd out/Release
|
pushd out/Release
|
||||||
|
|
16
fix-debugsource.patch
Normal file
16
fix-debugsource.patch
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
Off -fdebug-compilation-dir to generate debugsource RPM package
|
||||||
|
|
||||||
|
Make the condition which adds those flags always false for us.
|
||||||
|
|
||||||
|
// mikhailnov, 23.03.2021
|
||||||
|
--- a/build/config/compiler/BUILD.gn.orig 2021-03-14 05:19:49.661818000 +0300
|
||||||
|
+++ b/build/config/compiler/BUILD.gn 2021-03-22 21:23:36.664972000 +0300
|
||||||
|
@@ -1134,7 +1134,7 @@
|
||||||
|
}
|
||||||
|
|
||||||
|
# Makes builds independent of absolute file path.
|
||||||
|
- if (is_clang && strip_absolute_paths_from_debug_symbols) {
|
||||||
|
+ if (is_clang && is_win) {
|
||||||
|
# If debug option is given, clang includes $cwd in debug info by default.
|
||||||
|
# For such build, this flag generates reproducible obj files even we use
|
||||||
|
# different build directory like "out/feature_a" and "out/feature_b" if
|
27
rpmlint-wrapper.sh
Executable file
27
rpmlint-wrapper.sh
Executable file
|
@ -0,0 +1,27 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# rpmlint crashes when checking debuginfo/debugsource subpackages of chromium:
|
||||||
|
|
||||||
|
# 3 packages and 0 specfiles checked; 43 errors, 67 warnings.
|
||||||
|
# Traceback (most recent call last):
|
||||||
|
# File "/usr/bin/rpmlint", line 380, in <module>
|
||||||
|
# main()
|
||||||
|
# File "/usr/bin/rpmlint", line 172, in main
|
||||||
|
# runChecks(pkg)
|
||||||
|
# File "/usr/bin/rpmlint", line 228, in runChecks
|
||||||
|
# check.check(pkg)
|
||||||
|
# File "/usr/share/rpmlint/AbstractCheck.py", line 51, in check
|
||||||
|
# return self.check_binary(pkg)
|
||||||
|
# File "/usr/share/rpmlint/DistributionCheck.py", line 40, in check_binary
|
||||||
|
# for fname in pkg.files():
|
||||||
|
# File "/usr/share/rpmlint/Pkg.py", line 633, in files
|
||||||
|
# self._gatherFilesInfo()
|
||||||
|
# File "/usr/share/rpmlint/Pkg.py", line 718, in _gatherFilesInfo
|
||||||
|
# pkgfile.size = sizes[idx]
|
||||||
|
# IndexError: list index out of range
|
||||||
|
|
||||||
|
# For now workaround it by skipping debugsource and debuginfo packages
|
||||||
|
|
||||||
|
# DEBUG: Executing "/usr/bin/rpmlint -f /builddir/build/SOURCES/chromium-browser-stable.rpmlintrc /builddir/build/RPMS/chromium-browser-stable-89.0.4389.90-3-rosa2019.1.aarch64.rpm /builddir/build/RPMS/chromedriver-89.0.4389.90-3-rosa2019.1.aarch64.rpm /builddir/build/RPMS/chromium-browser-stable-debugsource-89.0.4389.90-3-rosa2019.1.aarch64.rpm /builddir/build/RPMS/chromium-browser-stable-debuginfo-89.0.4389.90-3-rosa2019.1.aarch64.rpm /builddir/build/RPMS/chromedriver-debuginfo-89.0.4389.90-3-rosa2019.1.aarch64.rpm ":
|
||||||
|
|
||||||
|
eval $(echo "$*" | tr ' ' '\n' | grep -vE '\-debugsource\-|\-debuginfo\-' | tr '\n' ' ')
|
Loading…
Add table
Reference in a new issue