diff options
author | Dan Albert <danalbert@google.com> | 2020-03-06 16:40:03 -0800 |
---|---|---|
committer | Dan Albert <danalbert@google.com> | 2020-03-06 17:23:17 -0800 |
commit | cf1601f23199d6f257d6d99f5bf7bca57a1c38d7 (patch) | |
tree | 8e075ab7329f84bc2eede2b85c3980c1bdd1f39e /build | |
parent | 5d2277df00aa4c3b197f1121d3fd041f3273bcaf (diff) | |
download | ndk-cf1601f23199d6f257d6d99f5bf7bca57a1c38d7.tar.gz |
Fix API 30+ in ndk-build for LP64 ABIs.
Test: Targeted API 30, saw compiler get API 30. Targeted API 16, saw
compiler get API 16 for LP32 and 21 for LP64. Once API 30 sysroot is
submitted I can also add a test that builds against API 30.
Bug: https://github.com/android/ndk/issues/1201
Change-Id: I0183d5e803234b25993944df0de9c8c88e7e2004
Diffstat (limited to 'build')
-rw-r--r-- | build/core/setup-abi.mk | 19 | ||||
-rw-r--r-- | build/core/setup-app.mk | 3 | ||||
-rw-r--r-- | build/core/setup-toolchain.mk | 4 |
3 files changed, 10 insertions, 16 deletions
diff --git a/build/core/setup-abi.mk b/build/core/setup-abi.mk index 0e278c5d8..bdb350119 100644 --- a/build/core/setup-abi.mk +++ b/build/core/setup-abi.mk @@ -26,17 +26,19 @@ endif TARGET_OUT := $(NDK_APP_OUT)/$(_app)/$(TARGET_ARCH_ABI) -# For x86 and mips: the minimal platform level is android-9 -TARGET_PLATFORM_SAVED := $(TARGET_PLATFORM) +TARGET_PLATFORM_LEVEL := $(APP_PLATFORM_LEVEL) -# For 64-bit ABIs: the minimal platform level is android-21 +# 64-bit ABIs were first supported in API 21. Pull up these ABIs if the app has +# a lower minSdkVersion. ifneq ($(filter $(NDK_KNOWN_DEVICE_ABI64S),$(TARGET_ARCH_ABI)),) -$(foreach _plat,3 4 5 8 9 10 11 12 13 14 15 16 17 18 19 20,\ - $(eval TARGET_PLATFORM := $$(subst android-$(_plat),android-21,$$(TARGET_PLATFORM)))\ -) + ifneq ($(call lt,$(TARGET_PLATFORM_LEVEL),21),) + TARGET_PLATFORM_LEVEL := 21 + endif endif -TARGET_PLATFORM_LEVEL := $(strip $(subst android-,,$(TARGET_PLATFORM))) +# Not used by ndk-build, but are documented for use by Android.mk files. +TARGET_PLATFORM := android-$(TARGET_PLATFORM_LEVEL) +TARGET_ABI := $(TARGET_PLATFORM)-$(TARGET_ARCH_ABI) # If we're targeting a new enough platform version, we don't actually need to # cover any gaps in libc for libc++ support. In those cases, save size in the @@ -82,6 +84,3 @@ ifeq ($(TARGET_ARCH_ABI),x86_64) endif include $(BUILD_SYSTEM)/setup-toolchain.mk - -# Restore TARGET_PLATFORM, see above. -TARGET_PLATFORM := $(TARGET_PLATFORM_SAVED) diff --git a/build/core/setup-app.mk b/build/core/setup-app.mk index dbd25e142..f893c73a7 100644 --- a/build/core/setup-app.mk +++ b/build/core/setup-app.mk @@ -39,9 +39,6 @@ $(foreach __name,$(NDK_APP_VARS),\ ndk-app-$(_app): $(NDK_APP_MODULES) all: ndk-app-$(_app) -# which platform/abi/toolchain are we going to use? -TARGET_PLATFORM := $(call get,$(_map),APP_PLATFORM) - # The ABI(s) to use NDK_APP_ABI := $(subst $(comma),$(space),$(strip $(NDK_APP_ABI))) ifndef NDK_APP_ABI diff --git a/build/core/setup-toolchain.mk b/build/core/setup-toolchain.mk index 7c058ba55..6973dd4d3 100644 --- a/build/core/setup-toolchain.mk +++ b/build/core/setup-toolchain.mk @@ -17,7 +17,7 @@ # to setup the target toolchain for a given platform/abi combination. # -$(call assert-defined,TARGET_PLATFORM TARGET_ARCH TARGET_ARCH_ABI) +$(call assert-defined,TARGET_PLATFORM_LEVEL TARGET_ARCH TARGET_ARCH_ABI) $(call assert-defined,NDK_APPS NDK_APP_STL) # Check that we have a toolchain that supports the current ABI. @@ -61,8 +61,6 @@ else # NDK_TOOLCHAIN is not empty TARGET_TOOLCHAIN := $(NDK_TOOLCHAIN) endif # NDK_TOOLCHAIN is not empty -TARGET_ABI := $(TARGET_PLATFORM)-$(TARGET_ARCH_ABI) - TARGET_PREBUILT_SHARED_LIBRARIES := # Define default values for TOOLCHAIN_NAME, this can be overriden in |