forked from OSchip/llvm-project
[gn build] Fix Android compiler-rt targets
If a sysroot was specified, it would take precedence over the Android NDK sysroot since it would appear after in the command line. Also only build runtimes for enabled target arches. Many places have copied this around so create and use supported_android_toolchains. Reviewed By: pcc Differential Revision: https://reviews.llvm.org/D113606
This commit is contained in:
parent
1a6c26d1f5
commit
463ee15e33
|
@ -269,7 +269,8 @@ config("compiler_defaults") {
|
|||
if (current_os == "win") {
|
||||
assert(is_clang, "sysroot only works with clang-cl as host compiler")
|
||||
cflags += [ "/winsysroot" + rebase_path(sysroot, root_build_dir) ]
|
||||
} else if (current_os != "ios" && current_os != "mac") {
|
||||
} else if (current_os != "ios" && current_os != "mac" &&
|
||||
current_os != "android") {
|
||||
cflags += [ "--sysroot=" + rebase_path(sysroot, root_build_dir) ]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,12 +11,7 @@ if (current_os == "win") {
|
|||
} else {
|
||||
supported_toolchains = [ "//llvm/utils/gn/build/toolchain:stage2_unix" ]
|
||||
}
|
||||
if (android_ndk_path != "") {
|
||||
supported_toolchains += [
|
||||
"//llvm/utils/gn/build/toolchain:stage2_android_aarch64",
|
||||
"//llvm/utils/gn/build/toolchain:stage2_android_arm",
|
||||
]
|
||||
}
|
||||
supported_toolchains += supported_android_toolchains
|
||||
group("compiler-rt") {
|
||||
deps = [ "//compiler-rt/include($host_toolchain)" ]
|
||||
foreach(toolchain, supported_toolchains) {
|
||||
|
|
|
@ -1,15 +1,11 @@
|
|||
import("//llvm/lib/Target/targets.gni")
|
||||
import("//llvm/utils/gn/build/toolchain/compiler.gni")
|
||||
|
||||
supported_toolchains = []
|
||||
if (target_os == "linux" || target_os == "fuchsia") {
|
||||
supported_toolchains += [ "//llvm/utils/gn/build/toolchain:stage2_unix" ]
|
||||
}
|
||||
if (android_ndk_path != "") {
|
||||
supported_toolchains += [
|
||||
"//llvm/utils/gn/build/toolchain:stage2_android_aarch64",
|
||||
"//llvm/utils/gn/build/toolchain:stage2_android_arm",
|
||||
]
|
||||
}
|
||||
supported_toolchains += supported_android_toolchains
|
||||
|
||||
group("scudo") {
|
||||
deps = []
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import("//compiler-rt/target.gni")
|
||||
import("//compiler-rt/test/test.gni")
|
||||
import("//llvm/lib/Target/targets.gni")
|
||||
import("//llvm/utils/gn/build/toolchain/compiler.gni")
|
||||
import("//llvm/utils/gn/build/write_cmake_config.gni")
|
||||
import("//llvm/version.gni")
|
||||
|
@ -59,7 +60,7 @@ supported_toolchains = []
|
|||
if (host_os == "linux" && host_cpu == "x64") {
|
||||
supported_toolchains += [ "//llvm/utils/gn/build/toolchain:stage2_unix" ]
|
||||
}
|
||||
if (android_ndk_path != "") {
|
||||
if (llvm_build_AArch64 && android_ndk_path != "") {
|
||||
supported_toolchains +=
|
||||
[ "//llvm/utils/gn/build/toolchain:stage2_android_aarch64" ]
|
||||
}
|
||||
|
|
|
@ -1,12 +1,8 @@
|
|||
import("//llvm/lib/Target/targets.gni")
|
||||
import("//llvm/utils/gn/build/toolchain/compiler.gni")
|
||||
|
||||
supported_toolchains = [ "//llvm/utils/gn/build/toolchain:stage2_unix" ]
|
||||
if (android_ndk_path != "") {
|
||||
supported_toolchains += [
|
||||
"//llvm/utils/gn/build/toolchain:stage2_android_aarch64",
|
||||
"//llvm/utils/gn/build/toolchain:stage2_android_arm",
|
||||
]
|
||||
}
|
||||
supported_toolchains = [ "//llvm/utils/gn/build/toolchain:stage2_unix" ] +
|
||||
supported_android_toolchains
|
||||
|
||||
group("libunwind") {
|
||||
deps = []
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import("//llvm/lib/Target/targets.gni")
|
||||
import("//llvm/utils/TableGen/tablegen.gni")
|
||||
import("//llvm/utils/gn/build/toolchain/compiler.gni")
|
||||
import("//llvm/utils/gn/build/write_cmake_config.gni")
|
||||
|
@ -16,13 +17,7 @@ if (current_os == "mac") {
|
|||
}
|
||||
}
|
||||
|
||||
supported_toolchains = []
|
||||
if (android_ndk_path != "") {
|
||||
supported_toolchains += [
|
||||
"//llvm/utils/gn/build/toolchain:stage2_android_aarch64",
|
||||
"//llvm/utils/gn/build/toolchain:stage2_android_arm",
|
||||
]
|
||||
}
|
||||
supported_toolchains = supported_android_toolchains
|
||||
|
||||
executable("lldb") {
|
||||
configs += [ "//llvm/utils/gn/build:lldb_code" ]
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import("//llvm/utils/gn/build/toolchain/compiler.gni")
|
||||
|
||||
declare_args() {
|
||||
# The target archs LLVM should support. Defaults to the host arch.
|
||||
# Set to a list, e.g. `llvm_targets_to_build = [ "X86", "ARM" ]`,
|
||||
|
@ -97,3 +99,16 @@ if (host_cpu == "arm64") {
|
|||
} else {
|
||||
assert(false, "Unsuppored host_cpu '$host_cpu'.")
|
||||
}
|
||||
|
||||
supported_android_toolchains = []
|
||||
|
||||
if (android_ndk_path != "") {
|
||||
if (llvm_build_AArch64) {
|
||||
supported_android_toolchains +=
|
||||
[ "//llvm/utils/gn/build/toolchain:stage2_android_aarch64" ]
|
||||
}
|
||||
if (llvm_build_ARM) {
|
||||
supported_android_toolchains +=
|
||||
[ "//llvm/utils/gn/build/toolchain:stage2_android_arm" ]
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue