chromium-browser-stable-sla.../ALT-allow-to-override-clang-through-env-variables.patch
Mikhail Novosyolov ba619fbf46 Restore buildability on rosa2016.1
Commit 6aceefa0 lost using CXXFLAGS / LDFLAGS when building gn.
Fix incorrect position of unset() (noted by alzim@, thanks to him)
2021-03-13 15:49:46 +03:00

49 lines
1.5 KiB
Diff

From debe8e9f69d128e2113e53d7303f5b8e1b5604bb Mon Sep 17 00:00:00 2001
From: Alexey Gladkov <legion@altlinux.org>
Date: Mon, 27 Aug 2018 14:59:55 +0300
Subject: [PATCH] ALT: allow to override clang through env variables
[ mikhailnov@ROSA: added *FLAGS envs. ]
---
build/toolchain/gcc_toolchain.gni | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/build/toolchain/gcc_toolchain.gni b/build/toolchain/gcc_toolchain.gni
index 6e3c02444d0..bc6c6d705d3 100644
--- a/build/toolchain/gcc_toolchain.gni
+++ b/build/toolchain/gcc_toolchain.gni
@@ -627,20 +627,32 @@ template("clang_toolchain") {
gcc_toolchain(target_name) {
prefix = rebase_path("$clang_base_path/bin", root_build_dir)
cc = "$prefix/clang"
cxx = "$prefix/clang++"
ld = cxx
readelf = "${toolprefix}readelf"
ar = "${prefix}/llvm-ar"
nm = "${toolprefix}nm"
+ cc = getenv("CC")
+ cxx = getenv("CXX")
+ ld = getenv("CXX")
+ readelf = getenv("READELF")
+ ar = getenv("AR")
+ nm = getenv("NM")
+
+ extra_cflags = getenv("CFLAGS")
+ extra_cppflags = getenv("CPPFLAGS")
+ extra_cxxflags = getenv("CXXFLAGS")
+ extra_ldflags = getenv("LDFLAGS")
+
forward_variables_from(invoker,
[
"strip",
"default_shlib_subdir",
"enable_linker_map",
"use_unstripped_as_runtime_outputs",
])
toolchain_args = {
if (defined(invoker.toolchain_args)) {
--
2.25.4