summaryrefslogtreecommitdiffstats
path: root/llvm/utils
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/utils')
-rw-r--r--llvm/utils/gn/build/BUILD.gn2
-rw-r--r--llvm/utils/gn/build/toolchain/compiler.gni2
-rw-r--r--llvm/utils/gn/build/toolchain/target_flags.gni26
-rw-r--r--llvm/utils/gn/secondary/compiler-rt/test/BUILD.gn1
-rw-r--r--llvm/utils/gn/secondary/compiler-rt/test/test.gni3
5 files changed, 7 insertions, 27 deletions
diff --git a/llvm/utils/gn/build/BUILD.gn b/llvm/utils/gn/build/BUILD.gn
index e33cde23773..e323f99ac65 100644
--- a/llvm/utils/gn/build/BUILD.gn
+++ b/llvm/utils/gn/build/BUILD.gn
@@ -10,7 +10,7 @@ config("compiler_defaults") {
defines += [ "NDEBUG" ]
}
- cflags = target_flags + target_cflags
+ cflags = target_flags
ldflags = target_flags + target_ldflags
if (host_os == "mac" && clang_base_path != "") {
diff --git a/llvm/utils/gn/build/toolchain/compiler.gni b/llvm/utils/gn/build/toolchain/compiler.gni
index 3c419fb29a1..37ad1f5bc31 100644
--- a/llvm/utils/gn/build/toolchain/compiler.gni
+++ b/llvm/utils/gn/build/toolchain/compiler.gni
@@ -10,7 +10,7 @@ declare_args() {
# Example value: getenv("HOME") + "/src/llvm-build/Release+Asserts"
clang_base_path = ""
- # Set this to the path to Android NDK r18b. If set, cross compilation targeting
+ # Set this to the path to Android NDK r19. If set, cross compilation targeting
# Android will be enabled.
android_ndk_path = ""
}
diff --git a/llvm/utils/gn/build/toolchain/target_flags.gni b/llvm/utils/gn/build/toolchain/target_flags.gni
index 6b6373a0093..3ad02a969fd 100644
--- a/llvm/utils/gn/build/toolchain/target_flags.gni
+++ b/llvm/utils/gn/build/toolchain/target_flags.gni
@@ -2,33 +2,13 @@ import("//llvm/triples.gni")
import("//llvm/utils/gn/build/toolchain/compiler.gni")
target_flags = []
-target_cflags = []
target_ldflags = []
if (current_os == "android") {
- assert(current_cpu == "arm64", "current_cpu not supported")
-
- libcxx_path = "$android_ndk_path/sources/cxx-stl/llvm-libc++"
- platform_lib_path =
- "$android_ndk_path/platforms/android-21/arch-arm64/usr/lib"
- libgcc_path = "$android_ndk_path/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/lib/gcc/aarch64-linux-android/4.9.x"
-
target_flags += [
"--target=$llvm_current_triple",
- "--sysroot=$android_ndk_path/sysroot",
- ]
- target_cflags += [
- "-isystem",
- "$libcxx_path/include",
- ]
- target_ldflags += [
- "-B$platform_lib_path",
- "-L$platform_lib_path",
- "-L$libgcc_path",
- ]
- target_ldflags += [
- "-nostdlib++",
- "-L$libcxx_path/libs/arm64-v8a",
- "-l:libc++.a.21",
+ "--sysroot=$android_ndk_path/toolchains/llvm/prebuilt/linux-x86_64/sysroot",
+ "-B$android_ndk_path/toolchains/llvm/prebuilt/linux-x86_64",
]
+ target_ldflags += [ "-static-libstdc++" ]
}
diff --git a/llvm/utils/gn/secondary/compiler-rt/test/BUILD.gn b/llvm/utils/gn/secondary/compiler-rt/test/BUILD.gn
index 90a9201681a..a5fa1a3f9fb 100644
--- a/llvm/utils/gn/secondary/compiler-rt/test/BUILD.gn
+++ b/llvm/utils/gn/secondary/compiler-rt/test/BUILD.gn
@@ -47,6 +47,7 @@ write_cmake_config("lit_common_configured") {
"SANITIZER_CAN_USE_CXXABI_PYBOOL=True",
"COMPILER_RT_HAS_LLD_PYBOOL=True",
"HAVE_RPC_XDR_H=0",
+ "ANDROID_NDK_VERSION=19",
"ANDROID_SERIAL_FOR_TESTING=$android_serial_for_testing",
]
diff --git a/llvm/utils/gn/secondary/compiler-rt/test/test.gni b/llvm/utils/gn/secondary/compiler-rt/test/test.gni
index 4144482bcbd..e2335933659 100644
--- a/llvm/utils/gn/secondary/compiler-rt/test/test.gni
+++ b/llvm/utils/gn/secondary/compiler-rt/test/test.gni
@@ -7,8 +7,7 @@ declare_args() {
target_flags_string = ""
-foreach(flag,
- target_flags + target_cflags + target_ldflags + [ "-fuse-ld=lld" ]) {
+foreach(flag, target_flags + target_ldflags + [ "-fuse-ld=lld" ]) {
if (target_flags_string != "") {
target_flags_string += " "
}
OpenPOWER on IntegriCloud