Files
termux-packages/x11-packages/electron-host-tools-for-code-oss/cr-patches/0004-compiler-clang-lib-dir.patch
2025-12-14 12:47:47 +00:00

43 lines
1.4 KiB
Diff

--- a/build/config/clang/clang.gni
+++ b/build/config/clang/clang.gni
@@ -95,6 +95,9 @@
clang_modules_platform_supported && using_tested_sysroot &&
# reclient and icecc don't handle headers in modulemap config.
!use_reclient && !is_cronet_for_aosp_build && cc_wrapper != "icecc"
+
+ 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
@@ -4,6 +4,7 @@
import("//build/config/pch.gni")
import("//build/config/rust.gni")
+import("//v8/gni/snapshot_toolchain.gni")
import("clang.gni")
if (is_ios) {
@@ -216,6 +217,19 @@
}
_clang_lib_dir = "$clang_base_path/lib/clang/$clang_version/lib"
+ 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" ]
}