Added 2 patches from ALT: ALT-allow-_FORTIFY_SOURCE-for-clang.patch, ALT-allow-to-override-clang-through-env-variables.patch

This commit is contained in:
Mikhail Novosyolov 2018-10-16 01:34:36 +03:00
parent 2711c106b2
commit 7e028c1879
3 changed files with 94 additions and 0 deletions

View file

@ -0,0 +1,40 @@
From 0ae8906d7a52a7ab305c236668555c37fbbc1e76 Mon Sep 17 00:00:00 2001
From: Alexey Gladkov <legion@altlinux.org>
Date: Fri, 30 Mar 2018 21:27:10 +0300
Subject: [PATCH 19/24] ALT: allow _FORTIFY_SOURCE for clang
Signed-off-by: Alexey Gladkov <legion@altlinux.org>
---
build/config/compiler/BUILD.gn | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
index 959a5923174..988708210b1 100644
--- a/build/config/compiler/BUILD.gn
+++ b/build/config/compiler/BUILD.gn
@@ -1516,21 +1516,21 @@ config("chromium_code") {
}
# In Chromium code, we define __STDC_foo_MACROS in order to get the
# C99 macros on Mac and Linux.
defines = [
"__STDC_CONSTANT_MACROS",
"__STDC_FORMAT_MACROS",
]
if (!is_debug && !using_sanitizer &&
- (!is_linux || !is_clang || is_official_build) &&
+ (!is_linux || is_official_build) &&
current_cpu != "s390x" && current_cpu != "s390" &&
current_cpu != "ppc64" && current_cpu != "ppc64" &&
current_cpu != "mips" && current_cpu != "mips64") {
# _FORTIFY_SOURCE isn't really supported by Clang now, see
# http://llvm.org/bugs/show_bug.cgi?id=16821.
# It seems to work fine with Ubuntu 12 headers though, so use it in
# official builds.
#
# Non-chromium code is not guaranteed to compile cleanly with
# _FORTIFY_SOURCE. Also, fortified build may fail when optimizations are
--
2.17.1

View file

@ -0,0 +1,49 @@
From c2f9928e44be384c349b70890543726dbfc7d3e9 Mon Sep 17 00:00:00 2001
From: Alexey Gladkov <legion@altlinux.org>
Date: Mon, 27 Aug 2018 14:59:55 +0300
Subject: [PATCH 24/24] ALT: allow to override clang through env variables
---
build/toolchain/gcc_toolchain.gni | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/build/toolchain/gcc_toolchain.gni b/build/toolchain/gcc_toolchain.gni
index b6f63d7556a..c09ad531b8d 100644
--- a/build/toolchain/gcc_toolchain.gni
+++ b/build/toolchain/gcc_toolchain.gni
@@ -597,27 +597,27 @@ template("gcc_toolchain") {
# actually just be doing a native compile. The invoker can optionally override
# use_gold too.
template("clang_toolchain") {
if (defined(invoker.toolprefix)) {
toolprefix = invoker.toolprefix
} else {
toolprefix = ""
}
gcc_toolchain(target_name) {
- prefix = rebase_path("$clang_base_path/bin", root_build_dir)
- cc = "$prefix/clang"
- cxx = "$prefix/clang++"
+ cc = getenv("CC")
+ cxx = getenv("CXX")
+ ar = getenv("AR")
ld = cxx
readelf = "${toolprefix}readelf"
- ar = "${prefix}/llvm-ar"
- nm = "${toolprefix}nm"
+ readelf = "readelf"
+ nm = "nm"
forward_variables_from(invoker,
[
"strip",
"is_clang_analysis_supported",
"enable_linker_map",
"use_unstripped_as_runtime_outputs",
])
toolchain_args = {
--
2.17.1

View file

@ -114,6 +114,9 @@ Patch631: chromium-69.0.3497.100-build-error-in-clang6.patch
Patch710: Debian-Fixes-gpu-timeout.patch
# https://build.opensuse.org/package/show/network:chromium/chromium
Patch720: openSUSE-Compile-the-sandbox-with-fPIE-settings.patch
# https://packages.altlinux.org/ru/Sisyphus/srpms/chromium/patches
Patch730: ALT-allow-to-override-clang-through-env-variables.patch
Patch731: ALT-allow-_FORTIFY_SOURCE-for-clang.patch
Provides: %{crname} = %{EVRD}
Conflicts: chromium-browser-unstable
@ -340,6 +343,8 @@ members of the Chromium and WebDriver teams.
%patch710 -p1
%patch720 -p1
%patch730 -p1
%patch731 -p1
mkdir -p third_party/llvm-build/Release+Asserts/bin
pushd third_party/llvm-build/Release+Asserts/bin