mirror of
https://github.com/termux/termux-packages.git
synced 2025-06-03 15:25:17 +00:00
45 lines
1.4 KiB
Diff
45 lines
1.4 KiB
Diff
--- a/build/config/clang/clang.gni
|
|
+++ b/build/config/clang/clang.gni
|
|
@@ -35,6 +35,9 @@
|
|
# Set to true to enable output of ThinLTO index and import files used for
|
|
# creating a Chromium MLGO corpus in the ThinLTO case.
|
|
lld_emit_indexes_and_imports = false
|
|
+
|
|
+ custom_toolchain_clang_base_path = ""
|
|
+ custom_toolchain_clang_version = ""
|
|
}
|
|
|
|
# We don't really need to collect a corpus for the host tools, just for the target.
|
|
--- a/build/config/clang/BUILD.gn
|
|
+++ b/build/config/clang/BUILD.gn
|
|
@@ -5,6 +5,8 @@
|
|
import("//build/config/rust.gni")
|
|
import("clang.gni")
|
|
|
|
+import("//v8/gni/snapshot_toolchain.gni")
|
|
+
|
|
if (is_ios) {
|
|
import("//build/config/ios/config.gni") # For `target_environment`
|
|
}
|
|
@@ -236,6 +236,20 @@
|
|
assert(false) # Unhandled target platform
|
|
}
|
|
|
|
+ if (is_a_target_toolchain && current_toolchain != v8_snapshot_toolchain) {
|
|
+ _dir = "linux"
|
|
+ _clang_lib_dir = "$custom_toolchain_clang_base_path/lib/clang/$custom_toolchain_clang_version/lib"
|
|
+ if (current_cpu == "x64") {
|
|
+ _suffix = "-x86_64-android"
|
|
+ } else if (current_cpu == "arm") {
|
|
+ _suffix = "-arm-android"
|
|
+ } else if (current_cpu == "arm64") {
|
|
+ _suffix = "-aarch64-android"
|
|
+ } else {
|
|
+ assert(false) # Unhandled cpu type
|
|
+ }
|
|
+ }
|
|
+
|
|
_lib_file = "${_prefix}clang_rt.${_libname}${_suffix}.${_ext}"
|
|
libs = [ "$_clang_lib_dir/$_dir/$_lib_file" ]
|
|
|