[build] Consistently use either gcc/binutils or clang/llvm.

Change-Id: I855c06f7af1d602d5e83cf547b9f18092062ac83
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/304541
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
This commit is contained in:
Ryan Macnak 2023-05-22 15:57:18 +00:00 committed by Commit Queue
parent 86c18251b4
commit 60441151ce
3 changed files with 14 additions and 11 deletions

View file

@ -42,22 +42,27 @@ template("android_gcc_toolchain") {
is_clang = invoker.is_clang
if (is_clang) {
not_needed([ "tool_prefix" ])
prefix =
rebase_path("//buildtools/${host_os}-x64/clang/bin", root_build_dir)
cc = compiler_prefix + prefix + "/clang"
cxx = compiler_prefix + prefix + "/clang++"
ar = prefix + "/llvm-ar"
ld = cxx
readelf = prefix + "/llvm-readelf"
nm = prefix + "/llvm-nm"
android_strip = prefix + "/llvm-strip"
} else {
cc = compiler_prefix + tool_prefix + "gcc"
cxx = compiler_prefix + tool_prefix + "g++"
ar = tool_prefix + "ar"
ld = cxx
readelf = tool_prefix + "readelf"
nm = tool_prefix + "nm"
android_strip = tool_prefix + "strip"
}
ld = cxx
readelf = compiler_prefix + tool_prefix + "readelf"
nm = compiler_prefix + tool_prefix + "nm"
toolchain_os = "android"
toolchain_cpu = invoker.toolchain_cpu
@ -68,8 +73,6 @@ template("android_gcc_toolchain") {
stripped_soname = "lib.stripped/${soname}"
temp_stripped_soname = "${stripped_soname}.tmp"
android_strip = "${tool_prefix}strip"
strip_command =
"$android_strip --strip-unneeded -o $temp_stripped_soname $soname"
replace_command = "if ! cmp -s $temp_stripped_soname $stripped_soname; then mv $temp_stripped_soname $stripped_soname; fi"

View file

@ -97,7 +97,7 @@ gcc_toolchain("clang_arm64") {
cc = "${compiler_prefix}${prefix}/clang"
cxx = "${compiler_prefix}${prefix}/clang++"
readelf = "readelf"
readelf = "${prefix}/llvm-readelf"
nm = "${prefix}/llvm-nm"
ar = "${prefix}/llvm-ar"
ld = cxx
@ -203,7 +203,7 @@ gcc_toolchain("clang_riscv32") {
cc = "${compiler_prefix}${prefix}/clang"
cxx = "${compiler_prefix}${prefix}/clang++"
readelf = "readelf"
readelf = "${prefix}/llvm-readelf"
nm = "${prefix}/llvm-nm"
ar = "${prefix}/llvm-ar"
ld = cxx
@ -239,7 +239,7 @@ gcc_toolchain("clang_riscv64") {
cc = "${compiler_prefix}${prefix}/clang"
cxx = "${compiler_prefix}${prefix}/clang++"
readelf = "readelf"
readelf = "${prefix}/llvm-readelf"
nm = "${prefix}/llvm-nm"
ar = "${prefix}/llvm-ar"
ld = cxx

View file

@ -228,7 +228,7 @@ mac_toolchain("clang_x64") {
cxx = "${goma_prefix}$prefix/clang++"
ar = "${prefix}/llvm-ar"
ld = cxx
strip = "strip"
strip = "${prefix}/llvm-strip"
is_clang = true
if (mac_enable_relative_sdk_path) {
mac_sdk_path = rebase_path(mac_sdk_path, root_build_dir)
@ -244,7 +244,7 @@ mac_toolchain("clang_arm64") {
cxx = "${goma_prefix}$prefix/clang++"
ar = "${prefix}/llvm-ar"
ld = cxx
strip = "strip"
strip = "${prefix}/llvm-strip"
is_clang = true
if (mac_enable_relative_sdk_path) {
mac_sdk_path = rebase_path(mac_sdk_path, root_build_dir)