diff options
author | Mike Klein <mtklein@chromium.org> | 2016-10-11 11:21:36 -0400 |
---|---|---|
committer | Mike Klein <mtklein@chromium.org> | 2016-10-11 17:07:49 +0000 |
commit | 4fdc54385a84ea9fc94a72b3dbf12e9571feffa4 (patch) | |
tree | 4aa8abaf4cdfd98e845fae72119a6507e48eeff7 /gn | |
parent | 9df16b5e85ef37c44e02257e49eb996efca0e173 (diff) |
Update to Android NDK r13.
The libc++ include paths have changed very slightly. I've left GN compatible with both older r12 NDKs and the new r13 to smooth the transition.
The libc++ in r13 depends on long-double math.h functions (cosl, atanl, etc.) only available in Android API v21 (Lollipop) and up. That's what the 64-bit bots were already on, so we just pull the 32-bit bots up to the same target. Conveniently, the oldest bots we have (N7 and N10) are on Lollipop.
The r13 MIPS64 sysroots are a little weird... /usr/include and /usr/lib64 but no /usr/lib. That'd be fine---we only want 64-bit builds---but Clang searches for /usr/lib64 via its path to /usr/lib, and without at least an empty /usr/lib, it can't find /usr/lib64. So you'll see a special mips64el section in the GN config where we do this all manually (other platforms pick this all up correctly from --sysroot). I've chosen to do this rather than fix it up in the asset create.py scripts so that we stay compatible with vanilla NDKs, which is convenient for developers.
CQ_INCLUDE_TRYBOTS=master.client.skia.compile:Build-Mac-Clang-arm64-Debug-GN_Android-Trybot,Build-Ubuntu-Clang-arm-Debug-GN_Android-Trybot,Build-Ubuntu-Clang-arm-Release-GN_Android-Trybot,Build-Ubuntu-Clang-arm64-Debug-GN_Android-Trybot,Build-Ubuntu-Clang-arm64-Debug-GN_Android_FrameworkDefs-Trybot,Build-Ubuntu-Clang-arm64-Debug-GN_Android_Vulkan-Trybot,Build-Ubuntu-Clang-arm64-Release-GN_Android-Trybot,Build-Ubuntu-Clang-mips64el-Debug-GN_Android-Trybot,Build-Ubuntu-Clang-mips64el-Release-GN_Android-Trybot,Build-Ubuntu-Clang-mips64el-Release-GN_Android-Trybot,Build-Ubuntu-Clang-mipsel-Debug-GN_Android-Trybot,Build-Ubuntu-Clang-mipsel-Release-GN_Android-Trybot,Build-Ubuntu-Clang-x64-Debug-GN_Android-Trybot,Build-Ubuntu-Clang-x64-Release-GN_Android-Trybot,Build-Ubuntu-Clang-x86-Debug-GN_Android-Trybot,Build-Ubuntu-Clang-x86-Release-GN_Android-Trybot
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=3180
Change-Id: I6f3b5d9411ded0ee49c1099490f41fa86a8736f8
Reviewed-on: https://skia-review.googlesource.com/3180
Reviewed-by: Eric Boren <borenet@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Diffstat (limited to 'gn')
-rw-r--r-- | gn/BUILD.gn | 16 | ||||
-rw-r--r-- | gn/BUILDCONFIG.gn | 10 |
2 files changed, 16 insertions, 10 deletions
diff --git a/gn/BUILD.gn b/gn/BUILD.gn index 5622149d0c..a19394214d 100644 --- a/gn/BUILD.gn +++ b/gn/BUILD.gn @@ -174,7 +174,8 @@ config("default") { ] cflags_cc += [ "-isystem$ndk/sources/android/support/include", - "-isystem$ndk/sources/cxx-stl/llvm-libc++/libcxx/include", + "-isystem$ndk/sources/cxx-stl/llvm-libc++/libcxx/include", # Through r12b. + "-isystem$ndk/sources/cxx-stl/llvm-libc++/include", # Since r13. ] ldflags += [ "--sysroot=$ndk/platforms/$ndk_platform", @@ -187,6 +188,19 @@ config("default") { "$ndk/toolchains/$ndk_gccdir-4.9/prebuilt/$ndk_host/lib/gcc/$ndk_target/4.9.x", ] + if (current_cpu == "mips64el") { + # The r13 NDK omits /usr/lib from the MIPS64 sysroots, but Clang searches + # for /usr/lib64 as $PATH_TO_USR_LIB/../lib64. If there's no /usr/lib, + # it can't find /usr/lib64. We must point Clang at /usr/lib64 manually. + lib_dirs += [ "$ndk/platforms/$ndk_platform/usr/lib64" ] + ldflags += [ + # Clang will try to link these two files, but not find them. Again, do it manually. + "-nostartfiles", + "$ndk/platforms/$ndk_platform/usr/lib64/crtbegin_dynamic.o", + "$ndk/platforms/$ndk_platform/usr/lib64/crtend_android.o", + ] + } + libs = [ # Order matters here! Keep these three in exactly this order. "c++_static", diff --git a/gn/BUILDCONFIG.gn b/gn/BUILDCONFIG.gn index 2f8670a563..eccffdb924 100644 --- a/gn/BUILDCONFIG.gn +++ b/gn/BUILDCONFIG.gn @@ -11,7 +11,7 @@ declare_args() { is_official_build = false is_component_build = false ndk = "" - ndk_api = 0 # 0 == picked automatically for target_cpu. + ndk_api = 21 sanitize = "" } declare_args() { @@ -55,14 +55,6 @@ if (is_android) { ndk_stdlib = "" ndk_gccdir = "" - if (ndk_api == 0) { - ndk_api = 18 - if (target_cpu == "arm64" || target_cpu == "mips64el" || - target_cpu == "x64") { - ndk_api = 21 - } - } - if (host_os == "linux") { ndk_host = "linux-x86_64" } else if (host_os == "mac") { |