mirror of
https://abf.rosa.ru/djam/chromium-browser-stable-test.git
synced 2025-02-24 01:52:45 +00:00
Build with llvm11
llvm11 (https://abf.io/import/llvm11) is a separately packaged LLVM 11 + Clang 11. It is easier to use it than update system clang+llvm in stable platforms which causes lots of problems and regressions. Reduced amount of compiler-related patches. TODO: drop chromium-compiler-r4.patch ? Renamed "netive_clang" to "bundled_llvm" for clearity, it is not clear to me that "native" means "bundled binary blob/source".
This commit is contained in:
parent
93cf45c5ad
commit
d9f0d84840
4 changed files with 21 additions and 81 deletions
|
@ -1,12 +0,0 @@
|
|||
diff -urN chromium-66.0.3359.81.orig/build/config/clang/clang.gni chromium-66.0.3359.81/build/config/clang/clang.gni
|
||||
--- chromium-66.0.3359.81.orig/build/config/clang/clang.gni 2018-04-11 18:07:36.127271285 +0300
|
||||
+++ chromium-66.0.3359.81/build/config/clang/clang.gni 2018-04-11 18:07:47.817410409 +0300
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
import("//build/toolchain/toolchain.gni")
|
||||
|
||||
-default_clang_base_path = "//third_party/llvm-build/Release+Asserts"
|
||||
+default_clang_base_path = "/usr"
|
||||
|
||||
declare_args() {
|
||||
# Indicates if the build should use the Chrome-specific plugins for enforcing
|
|
@ -1,17 +0,0 @@
|
|||
--- chromium-69.0.3497.100/build/config/compiler/BUILD.gn.orig
|
||||
+++ chromium-69.0.3497.100/build/config/compiler/BUILD.gn
|
||||
@@ -666,10 +666,10 @@
|
||||
# This flag enforces that member pointer base types are complete. It helps
|
||||
# prevent us from running into problems in the Microsoft C++ ABI (see
|
||||
# https://crbug.com/847724).
|
||||
- if (is_clang && !is_nacl && target_os != "chromeos" && !use_xcode_clang &&
|
||||
- (is_win || use_custom_libcxx)) {
|
||||
- cflags += [ "-fcomplete-member-pointers" ]
|
||||
- }
|
||||
+ #if (is_clang && !is_nacl && target_os != "chromeos" && !use_xcode_clang &&
|
||||
+ # (is_win || use_custom_libcxx)) {
|
||||
+ # cflags += [ "-fcomplete-member-pointers" ]
|
||||
+ #}
|
||||
|
||||
# Pass the same C/C++ flags to the objective C/C++ compiler.
|
||||
cflags_objc += cflags_c
|
|
@ -1,11 +0,0 @@
|
|||
--- dev.orig/third_party/nearby/src/cpp/core_v2/internal/payload_manager.cc
|
||||
+++ dev/third_party/nearby/src/cpp/core_v2/internal/payload_manager.cc
|
||||
@@ -946,7 +946,7 @@ PayloadManager::PendingPayload::PendingP
|
||||
for (const auto& id : endpoint_ids) {
|
||||
endpoints_.emplace(id, EndpointInfo{
|
||||
.id = id,
|
||||
- .status {EndpointInfo::Status::kAvailable},
|
||||
+ .status = AtomicReference<EndpointInfo::Status>(EndpointInfo::Status::kAvailable),
|
||||
});
|
||||
}
|
||||
}
|
|
@ -31,8 +31,6 @@
|
|||
%define jsoncpp 0
|
||||
%bcond_without native_libpng
|
||||
|
||||
%bcond_without clang
|
||||
|
||||
# Set up Google API keys, see http://www.chromium.org/developers/how-tos/api-keys
|
||||
# Note: these are for Mageia use ONLY.
|
||||
# For your own builds, please get your own set of keys.
|
||||
|
@ -47,10 +45,13 @@
|
|||
|
||||
%define xcb_version 1.14.1
|
||||
|
||||
%bcond_without clang
|
||||
|
||||
%if %{mdvver} <= 201410
|
||||
%bcond_without native_clang
|
||||
%bcond_without bundled_llvm
|
||||
%else
|
||||
%bcond_with native_clang
|
||||
%bcond_with bundled_llvm
|
||||
%define llvm_prefix /opt/llvm11
|
||||
%endif
|
||||
|
||||
# Verbose logging during build
|
||||
|
@ -66,7 +67,7 @@
|
|||
Summary: A fast web browser based on the Blink engine
|
||||
Name: chromium-browser-stable
|
||||
Version: 88.0.4324.96
|
||||
Release: 0.1
|
||||
Release: 1
|
||||
License: BSD, LGPL
|
||||
Group: Networking/WWW
|
||||
Url: https://www.chromium.org/Home
|
||||
|
@ -135,33 +136,27 @@ Patch600: chromium-buildname-60.0.3112.90.patch
|
|||
# Patch to fix build
|
||||
Patch601: chromium-62-include-cstdlib.patch
|
||||
|
||||
# https://github.com/RussianFedora/chromium/blob/fedora-stable/chromium-66.0.3359.81-system-clang.patch
|
||||
Patch603: chromium-66.0.3359.81-system-clang.patch
|
||||
# https://mirror.yandex.ru/gentoo-portage/www-client/chromium/files/
|
||||
Patch604: chromium-compiler-r4.patch
|
||||
# Add "ROSA" to the user agent string
|
||||
Patch627: chromium-68.0.3440.106-rosa-user-agent.patch
|
||||
# Do not prefix libpng functions
|
||||
Patch629: chromium-60.0.3112.78-no-libpng-prefix.patch
|
||||
# Fix errors build in 69
|
||||
Patch631: chromium-69.0.3497.100-build-error-in-clang6.patch
|
||||
# Fix build /sandbox/policy/linux/bpf_gpu_policy_linux.cc
|
||||
Patch637: chromium-86.0.4240.80-fcntl-h.patch
|
||||
# Fix build nearby/src/cpp/core_v2/internal/payload_manager.cc
|
||||
Patch638: chromium-86.0.4240.111-nearby-payload_manager.patch
|
||||
# Fix building third_party/wayland on rosa2016.1
|
||||
Patch639: wayland-strndup.patch
|
||||
|
||||
BuildRequires: bison
|
||||
%if %{with clang}
|
||||
BuildRequires: clang
|
||||
BuildRequires: lld
|
||||
BuildRequires: llvm11
|
||||
BuildRequires: libcxx-devel
|
||||
BuildRequires: libcxxabi-devel
|
||||
BuildRequires: lld
|
||||
%endif
|
||||
# gn needs these
|
||||
BuildRequires: flex
|
||||
%if %{with native_clang}
|
||||
%if %{with bundled_llvm}
|
||||
BuildRequires: cmake
|
||||
BuildRequires: git
|
||||
%endif
|
||||
|
@ -372,31 +367,22 @@ cp -f %{_gostsourcedir}/src/msspi/third_party/cprocsp/include/* third_party/bori
|
|||
%patch600 -p1
|
||||
%patch601 -p1
|
||||
|
||||
%if %{without native_clang}
|
||||
%patch603 -p1
|
||||
%endif
|
||||
%patch604 -p1
|
||||
|
||||
%patch627 -p1
|
||||
%if %{without native_libpng}
|
||||
%patch629 -p1
|
||||
%endif
|
||||
%if %{without native_clang}
|
||||
%patch631 -p1 -b .clang6
|
||||
%endif
|
||||
%patch637 -p1 -b .fcntl
|
||||
%if %{mdvver} == 201905
|
||||
%patch638 -p1
|
||||
%endif
|
||||
%patch639 -p1
|
||||
|
||||
# fatal error: 'fuzzer/FuzzedDataProvider.h' file not found
|
||||
# (Available in Clang10)
|
||||
%if %{without native_clang}
|
||||
%if %{without bundled_llvm}
|
||||
mkdir -p third_party/llvm-build/Release+Asserts/bin
|
||||
pushd third_party/llvm-build/Release+Asserts/bin
|
||||
ln -sf /usr/bin/clang clang
|
||||
ln -sf /usr/bin/clang++ clang++
|
||||
ln -sf %{llvm_prefix}/bin/clang clang
|
||||
ln -sf %{llvm_prefix}/bin/clang++ clang++
|
||||
popd
|
||||
%endif
|
||||
|
||||
|
@ -405,11 +391,6 @@ FILE=chrome/common/channel_info_posix.cc
|
|||
sed -i.orig -e 's/getenv("CHROME_VERSION_EXTRA")/"%{product_vendor} %{product_version}"/' $FILE
|
||||
cmp $FILE $FILE.orig && exit 1
|
||||
|
||||
# Remove compiler flags not supported by our system clang
|
||||
sed -i \
|
||||
-e '/"-Wno-defaulted-function-deleted"/d' \
|
||||
build/config/compiler/BUILD.gn
|
||||
|
||||
# Use native page size on aarch64 ("if (current_cpu == "arm64")"), otherwise:
|
||||
# /lib64/ld-linux-aarch64.so.1 ./bytecode_builtins_list_generator
|
||||
# ./bytecode_builtins_list_generator: error while loading shared libraries:
|
||||
|
@ -486,7 +467,7 @@ export PYTHONPATH="../../third_party/pyjson5/src:../../xcb-proto-%{xcb_version}"
|
|||
%define is_libpng false
|
||||
%endif
|
||||
|
||||
%if %{without native_clang}
|
||||
%if %{without bundled_llvm}
|
||||
%define clang_use_chrome_plugins clang_use_chrome_plugins=false
|
||||
%else
|
||||
%define clang_use_chrome_plugins clang_use_chrome_plugins=true
|
||||
|
@ -552,7 +533,7 @@ export PYTHONPATH="../../third_party/pyjson5/src:../../xcb-proto-%{xcb_version}"
|
|||
# We don't need to cross compile while building on an aarch64 system.
|
||||
sed -i 's|aarch64-linux-gnu-||g' build/toolchain/linux/BUILD.gn
|
||||
|
||||
%if %{with native_clang}
|
||||
%if %{with bundled_llvm}
|
||||
# Build clang from Google
|
||||
# python2 tools/clang/scripts/build.py \
|
||||
# --without-android \
|
||||
|
@ -563,11 +544,12 @@ sed -i 's|aarch64-linux-gnu-||g' build/toolchain/linux/BUILD.gn
|
|||
%endif
|
||||
|
||||
%if %{with clang}
|
||||
%if %{without native_clang}
|
||||
export CC=clang
|
||||
export CXX=clang++
|
||||
export AR=ar
|
||||
export NM=nm
|
||||
%if %{without bundled_llvm}
|
||||
export CC=%{llvm_prefix}/bin/clang
|
||||
export CXX=%{llvm_prefix}/bin/clang++
|
||||
export AR=%{llvm_prefix}/bin/llvm-ar
|
||||
export NM=%{llvm_prefix}/bin/llvm-nm
|
||||
sed -i -e 's,//third_party/llvm-build/Release+Asserts,%{llvm_prefix},g' build/config/clang/clang.gni
|
||||
%else
|
||||
%define clang_path "%{_builddir}/chromium-%{version}/third_party/llvm-build/Release+Asserts/bin/"
|
||||
export CC="%{clang_path}clang"
|
||||
|
@ -575,10 +557,8 @@ export CXX="%{clang_path}clang++"
|
|||
export AR="%{clang_path}llvm-ar"
|
||||
export NM=nm
|
||||
%endif
|
||||
export CFLAGS="$CFLAGS -stdlib=libc++ -Wno-unused-command-line-argument"
|
||||
export CXXFLAGS="$CXXFLAGS -stdlib=libc++ -Wno-unused-command-line-argument"
|
||||
# flags to fix i586 builds
|
||||
export LDFLAGS="$LDFLAGS -Wl,-z,notext -pthread -stdlib=libc++"
|
||||
export LDFLAGS="$LDFLAGS -Wl,-z,notext -pthread"
|
||||
%else
|
||||
%setup_compile_flags
|
||||
CC=%{__cc}; export CC
|
||||
|
|
Loading…
Add table
Reference in a new issue