gn build: Unbreak Android cross-compilation.

- D96404 defaulted to libunwind which isn't provided by NDK r21
  (or r22), so specify -rtlib=libgcc on non-arm32.
- D97993 means that we need to use --gcc-toolchain instead of -B
  to let the driver find libgcc.
This commit is contained in:
Peter Collingbourne 2021-03-19 16:23:30 -07:00
parent d90270e9e8
commit eef8b74ef5
1 changed files with 4 additions and 1 deletions

View File

@ -13,8 +13,11 @@ if (current_os == "android") {
target_flags += [
"--target=$llvm_current_triple",
"--sysroot=$android_ndk_path/toolchains/llvm/prebuilt/linux-x86_64/sysroot",
"-B$android_ndk_path/toolchains/llvm/prebuilt/linux-x86_64",
"--gcc-toolchain=$android_ndk_path/toolchains/llvm/prebuilt/linux-x86_64",
]
if (current_cpu != "arm") {
target_flags += [ "-rtlib=libgcc" ]
}
target_ldflags += [ "-static-libstdc++" ]
if (current_cpu == "arm") {
target_flags += [ "-march=armv7-a" ]