1 Star 0 Fork 12

chrisshangguan/distributed-build

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0013-feature-use-llvm-tools-version-15-for-build.patch 3.51 KB
一键复制 编辑 原始数据 按行查看 历史
tianhang 提交于 2023-06-12 14:05 +08:00 . init and add patches for openeuler build
From f368525248e0bd5f4b101bfa7b4bff98a0eb45af Mon Sep 17 00:00:00 2001
From: tian2020 <tian_hang@hoperun.com>
Date: Tue, 13 Jun 2023 16:33:47 +0800
Subject: [PATCH] feature:use llvm tools version 15 for build
---
build_scripts/build.sh | 3 +--
config/clang/clang.gni | 4 ++--
config/ohos/BUILD.gn | 2 +-
config/ohos/config.gni | 2 +-
toolchain/gcc_toolchain.gni | 2 +-
toolchain/toolchain.gni | 2 +-
6 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/build_scripts/build.sh b/build_scripts/build.sh
index dea04e9..f17f9fe 100755
--- a/build_scripts/build.sh
+++ b/build_scripts/build.sh
@@ -114,7 +114,6 @@ esac
PYTHON3_DIR=/usr
PYTHON3=${PYTHON3_DIR}/bin/python3
PYTHON=${PYTHON3_DIR}/bin/python
-LLVM=/usr/lib64/llvm15/bin
if [[ ! -f "${PYTHON3}" ]]; then
echo -e "\033[33m Please execute the build/prebuilts_download.sh \033[0m"
exit 1
@@ -124,7 +123,7 @@ else
fi
fi
-export PATH=${source_root_dir}/prebuilts/build-tools/${HOST_DIR}/bin:${PYTHON3_DIR}/bin:${LLVM}:$PATH
+export PATH=${source_root_dir}/prebuilts/build-tools/${HOST_DIR}/bin:${PYTHON3_DIR}/bin:$PATH
${PYTHON3} ${source_root_dir}/build/scripts/tools_checker.py
diff --git a/config/clang/clang.gni b/config/clang/clang.gni
index 38719bb..9728e12 100755
--- a/config/clang/clang.gni
+++ b/config/clang/clang.gni
@@ -4,9 +4,9 @@
import("//build/toolchain/toolchain.gni")
-default_clang_base_path = "//prebuilts/clang/ohos/${host_platform_dir}/llvm"
+default_clang_base_path = "/usr/lib64/llvm15/"
clang_lib_path =
- "//prebuilts/clang/ohos/${host_platform_dir}/llvm/lib/clang/12.0.1/lib"
+ "${default_clang_base_path}/lib/clang/15.0.7/lib"
declare_args() {
# Indicates if the build should use the Chrome-specific plugins for enforcing
diff --git a/config/ohos/BUILD.gn b/config/ohos/BUILD.gn
index f177a03..84a3ea1 100755
--- a/config/ohos/BUILD.gn
+++ b/config/ohos/BUILD.gn
@@ -79,7 +79,7 @@ config("runtime_library") {
ldflags += [
"-L" + rebase_path("${musl_sysroot}/usr/lib/${abi_target}", root_build_dir),
- "-L" + rebase_path("${clang_base_path}/lib/clang/12.0.1/lib/${abi_target}",
+ "-L" + rebase_path("${clang_base_path}/lib/clang/15.0.7/lib/${abi_target}",
root_build_dir),
]
diff --git a/config/ohos/config.gni b/config/ohos/config.gni
index b7e1c45..e5d4d54 100644
--- a/config/ohos/config.gni
+++ b/config/ohos/config.gni
@@ -37,5 +37,5 @@ if (is_ohos) {
assert(false, "Architecture not supported")
}
- libclang_rt_file = "${clang_base_path}/lib/clang/12.0.1/lib/${abi_target}/libclang_rt.builtins.a"
+ libclang_rt_file = "${clang_base_path}/lib/clang/15.0.7/lib/${abi_target}/libclang_rt.builtins.a"
}
diff --git a/toolchain/gcc_toolchain.gni b/toolchain/gcc_toolchain.gni
index 0c91ccf..6a68e42 100755
--- a/toolchain/gcc_toolchain.gni
+++ b/toolchain/gcc_toolchain.gni
@@ -585,7 +585,7 @@ template("clang_toolchain") {
gcc_toolchain(target_name) {
# prefix = rebase_path("$clang_base_path/bin", root_build_dir)
- prefix = "/usr/bin"
+ prefix = "/usr/lib64/llvm15/bin"
cc = "$prefix/clang"
cxx = "$prefix/clang++"
ld = cxx
diff --git a/toolchain/toolchain.gni b/toolchain/toolchain.gni
index 1e95b63..7794e6f 100755
--- a/toolchain/toolchain.gni
+++ b/toolchain/toolchain.gni
@@ -46,7 +46,7 @@ hermetic_xcode_path =
declare_args() {
if (is_clang) {
# Clang compiler version. Clang files are placed at version-dependent paths.
- clang_version = "12.0.1"
+ clang_version = "15.0.7"
}
use_custom_clang = true
}
--
2.33.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/chrisshangguan/distributed-build.git
git@gitee.com:chrisshangguan/distributed-build.git
chrisshangguan
distributed-build
distributed-build
master

搜索帮助