diff options
author | Dan Albert <danalbert@google.com> | 2021-03-30 20:36:14 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2021-03-30 20:36:14 +0000 |
commit | 9f83511841f673330aa3e58e03dfa04811dff3cd (patch) | |
tree | a4aadd2829642304d5c5c6c805bf56fbc17c14ce | |
parent | 50dac6796356ccb97d5e5e889a8aa4c163237bcf (diff) | |
parent | 23698b3a5c9d7e00324d01e6becd87dc34931fd8 (diff) | |
download | ndk-9f83511841f673330aa3e58e03dfa04811dff3cd.tar.gz |
Merge changes I23e1d8fe,I3e1fac66,I9380689f,I14b9d12c
* changes:
Enable the NDK libunwind.a prebuilt for all archs
Reapply: Hack libc++ support header to work in the platform.
Update NDK prebuilts to build 7243079.
Preserve libunwind from the NDK.
18 files changed, 43 insertions, 43 deletions
diff --git a/Android.bp b/Android.bp index 4bafd8785..dba243ef7 100644 --- a/Android.bp +++ b/Android.bp @@ -57,15 +57,8 @@ ndk_prebuilt_static_stl { min_sdk_version: "16", } -// The LLVM libunwind unwinder. This unwinder is only used for arm32. ndk_prebuilt_static_stl { name: "ndk_libunwind", - enabled: false, - arch: { - arm: { - enabled: true, - }, - }, min_sdk_version: "16", } diff --git a/r23/source.properties b/r23/source.properties index f3ef85239..1fbecca6d 100644 --- a/r23/source.properties +++ b/r23/source.properties @@ -1,2 +1,2 @@ Pkg.Desc = Android NDK -Pkg.Revision = 23.0.7219278 +Pkg.Revision = 23.0.7243079 diff --git a/r23/sources/android/cpufeatures/Android.mk b/r23/sources/android/cpufeatures/Android.mk index 7b53d2318..e42fdf8a2 100644 --- a/r23/sources/android/cpufeatures/Android.mk +++ b/r23/sources/android/cpufeatures/Android.mk @@ -2,9 +2,6 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := cpufeatures -LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD -LOCAL_LICENSE_CONDITIONS := notice -LOCAL_NOTICE_FILE := $(LOCAL_PATH)/NOTICE LOCAL_SRC_FILES := cpu-features.c LOCAL_CFLAGS := -Wall -Wextra -Werror LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) diff --git a/r23/sources/android/native_app_glue/Android.mk b/r23/sources/android/native_app_glue/Android.mk index a41b80f38..e18a14eaf 100644 --- a/r23/sources/android/native_app_glue/Android.mk +++ b/r23/sources/android/native_app_glue/Android.mk @@ -3,9 +3,6 @@ LOCAL_PATH:= $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE:= android_native_app_glue -LOCAL_LICENSE_KINDS:= SPDX-license-identifier-Apache-2.0 -LOCAL_LICENSE_CONDITIONS:= notice -LOCAL_NOTICE_FILE:= $(LOCAL_PATH)/NOTICE LOCAL_SRC_FILES:= android_native_app_glue.c LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) LOCAL_EXPORT_LDLIBS := -llog -landroid diff --git a/r23/sources/android/support/Android.mk b/r23/sources/android/support/Android.mk index 7cefed18e..b6b9ce9b6 100644 --- a/r23/sources/android/support/Android.mk +++ b/r23/sources/android/support/Android.mk @@ -9,9 +9,6 @@ LIBCXX_LIBS := ../../cxx-stl/llvm-libc++/libs/$(TARGET_ARCH_ABI) include $(CLEAR_VARS) LOCAL_MODULE := android_support -LOCAL_LICENSE_KINDS := SPDX-license-identifier-BSD -LOCAL_LICENSE_CONDITIONS := notice -LOCAL_NOTICE_FILE := $(LOCAL_PATH)/NOTICE LOCAL_SRC_FILES := $(LIBCXX_LIBS)/lib$(LOCAL_MODULE)$(TARGET_LIB_EXTENSION) include $(PREBUILT_STATIC_LIBRARY) @@ -119,9 +116,6 @@ endif include $(CLEAR_VARS) LOCAL_MODULE := android_support -LOCAL_LICENSE_KINDS := SPDX-license-identifier-BSD -LOCAL_LICENSE_CONDITIONS := notice -LOCAL_NOTICE_FILE := $(LOCAL_PATH)/NOTICE LOCAL_SRC_FILES := $(android_support_sources) LOCAL_C_INCLUDES := $(android_support_c_includes) LOCAL_CFLAGS := $(android_support_cflags) diff --git a/r23/sources/cxx-stl/llvm-libc++/Android.mk b/r23/sources/cxx-stl/llvm-libc++/Android.mk index 9c19a9ac9..0415fb2c2 100644 --- a/r23/sources/cxx-stl/llvm-libc++/Android.mk +++ b/r23/sources/cxx-stl/llvm-libc++/Android.mk @@ -92,9 +92,6 @@ libcxxabi_c_includes := $(LOCAL_PATH)/../llvm-libc++abi/include include $(CLEAR_VARS) LOCAL_MODULE := c++_static -LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0 -LOCAL_LICENSE_CONDITIONS := notice -LOCAL_NOTICE_FILE := $(LOCAL_PATH)/../../../../NOTICE LOCAL_SRC_FILES := libs/$(TARGET_ARCH_ABI)/lib$(LOCAL_MODULE)$(TARGET_LIB_EXTENSION) LOCAL_EXPORT_C_INCLUDES := $(libcxx_export_includes) LOCAL_STATIC_LIBRARIES := libc++abi @@ -115,9 +112,6 @@ include $(PREBUILT_STATIC_LIBRARY) include $(CLEAR_VARS) LOCAL_MODULE := c++_shared -LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0 -LOCAL_LICENSE_CONDITIONS := notice -LOCAL_NOTICE_FILE := $(LOCAL_PATH)/../../../../NOTICE LOCAL_SRC_FILES := libs/$(TARGET_ARCH_ABI)/lib$(LOCAL_MODULE)$(TARGET_SONAME_EXTENSION) LOCAL_EXPORT_C_INCLUDES := \ $(libcxx_export_includes) \ @@ -146,9 +140,6 @@ $(call ndk_log,Rebuilding libc++ libraries from sources) include $(CLEAR_VARS) LOCAL_MODULE := c++_static -LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0 -LOCAL_LICENSE_CONDITIONS := notice -LOCAL_NOTICE_FILE := $(LOCAL_PATH)/../../../../NOTICE LOCAL_SRC_FILES := $(libcxx_sources) LOCAL_C_INCLUDES := $(libcxx_includes) LOCAL_CPPFLAGS := $(libcxx_cxxflags) -ffunction-sections -fdata-sections @@ -169,9 +160,6 @@ include $(BUILD_STATIC_LIBRARY) include $(CLEAR_VARS) LOCAL_MODULE := c++_shared -LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0 -LOCAL_LICENSE_CONDITIONS := notice -LOCAL_NOTICE_FILE := $(LOCAL_PATH)/../../../../NOTICE LOCAL_STRIP_MODE := none LOCAL_SRC_FILES := $(libcxx_sources) LOCAL_C_INCLUDES := $(libcxx_includes) diff --git a/r23/sources/cxx-stl/llvm-libc++/include/support/android/locale_bionic.h b/r23/sources/cxx-stl/llvm-libc++/include/support/android/locale_bionic.h index f05a6a052..dd1c088f4 100644 --- a/r23/sources/cxx-stl/llvm-libc++/include/support/android/locale_bionic.h +++ b/r23/sources/cxx-stl/llvm-libc++/include/support/android/locale_bionic.h @@ -25,11 +25,22 @@ extern "C" { #if defined(__ANDROID__) -#include <android/api-level.h> -#include <android/ndk-version.h> #if __ANDROID_API__ < 21 #include <support/xlocale/__posix_l_fallback.h> #endif + +// HACK: Not in upstream NDK or libc++. +// Upstream now supports using ToT libc++ with old NDKs, but as such it is now +// *only* compatible with the NDK. That will need to be fixed both for the +// platorm and for the NDK-in-platform use case since neither has +// android/ndk-version.h. + +// If we do not have this header, we are in a platform build rather than an NDK +// build, which will always be at least as new as the ToT NDK, in which case we +// don't need any of the inlines below since libc provides them. +#if __has_include(<android/ndk-version.h>) +#include <android/api-level.h> +#include <android/ndk-version.h> // In NDK versions later than 16, locale-aware functions are provided by // legacy_stdlib_inlines.h #if __NDK_MAJOR__ <= 16 @@ -63,6 +74,7 @@ inline _LIBCPP_INLINE_VISIBILITY long strtol_l(const char* __nptr, char** __endp #endif // __ANDROID_API__ < 26 #endif // __NDK_MAJOR__ <= 16 +#endif // __has_include(<android/ndk-version.h>) #endif // defined(__ANDROID__) #endif // defined(__BIONIC__) diff --git a/r23/sources/cxx-stl/llvm-libc++/libs/arm64-v8a/libc++_shared.so b/r23/sources/cxx-stl/llvm-libc++/libs/arm64-v8a/libc++_shared.so Binary files differindex 8de0c228f..564577c3c 100755 --- a/r23/sources/cxx-stl/llvm-libc++/libs/arm64-v8a/libc++_shared.so +++ b/r23/sources/cxx-stl/llvm-libc++/libs/arm64-v8a/libc++_shared.so diff --git a/r23/sources/cxx-stl/llvm-libc++/libs/arm64-v8a/libc++abi.a b/r23/sources/cxx-stl/llvm-libc++/libs/arm64-v8a/libc++abi.a Binary files differindex 3bed7f3fe..c4b888fca 100644 --- a/r23/sources/cxx-stl/llvm-libc++/libs/arm64-v8a/libc++abi.a +++ b/r23/sources/cxx-stl/llvm-libc++/libs/arm64-v8a/libc++abi.a diff --git a/r23/sources/cxx-stl/llvm-libc++/libs/arm64-v8a/libunwind.a b/r23/sources/cxx-stl/llvm-libc++/libs/arm64-v8a/libunwind.a Binary files differnew file mode 100644 index 000000000..ea80bd52f --- /dev/null +++ b/r23/sources/cxx-stl/llvm-libc++/libs/arm64-v8a/libunwind.a diff --git a/r23/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a/libc++_shared.so b/r23/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a/libc++_shared.so Binary files differindex f981fa6d1..4ea68ae71 100755 --- a/r23/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a/libc++_shared.so +++ b/r23/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a/libc++_shared.so diff --git a/r23/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a/libunwind.a b/r23/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a/libunwind.a Binary files differnew file mode 100644 index 000000000..c5baa54bf --- /dev/null +++ b/r23/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a/libunwind.a diff --git a/r23/sources/cxx-stl/llvm-libc++/libs/x86/libc++_shared.so b/r23/sources/cxx-stl/llvm-libc++/libs/x86/libc++_shared.so Binary files differindex 1c1a096a2..1dba17529 100755 --- a/r23/sources/cxx-stl/llvm-libc++/libs/x86/libc++_shared.so +++ b/r23/sources/cxx-stl/llvm-libc++/libs/x86/libc++_shared.so diff --git a/r23/sources/cxx-stl/llvm-libc++/libs/x86/libunwind.a b/r23/sources/cxx-stl/llvm-libc++/libs/x86/libunwind.a Binary files differnew file mode 100644 index 000000000..e7cbc692e --- /dev/null +++ b/r23/sources/cxx-stl/llvm-libc++/libs/x86/libunwind.a diff --git a/r23/sources/cxx-stl/llvm-libc++/libs/x86_64/libc++_shared.so b/r23/sources/cxx-stl/llvm-libc++/libs/x86_64/libc++_shared.so Binary files differindex 2b974115e..02d8bfae5 100755 --- a/r23/sources/cxx-stl/llvm-libc++/libs/x86_64/libc++_shared.so +++ b/r23/sources/cxx-stl/llvm-libc++/libs/x86_64/libc++_shared.so diff --git a/r23/sources/cxx-stl/llvm-libc++/libs/x86_64/libunwind.a b/r23/sources/cxx-stl/llvm-libc++/libs/x86_64/libunwind.a Binary files differnew file mode 100644 index 000000000..fc8617b81 --- /dev/null +++ b/r23/sources/cxx-stl/llvm-libc++/libs/x86_64/libunwind.a diff --git a/r23/sources/cxx-stl/llvm-libc++abi/Android.mk b/r23/sources/cxx-stl/llvm-libc++abi/Android.mk index 9b94bd94f..905cba7cb 100644 --- a/r23/sources/cxx-stl/llvm-libc++abi/Android.mk +++ b/r23/sources/cxx-stl/llvm-libc++abi/Android.mk @@ -45,13 +45,14 @@ libcxxabi_cflags := -D__STDC_FORMAT_MACROS libcxxabi_cppflags := -std=c++11 -Wno-unknown-attributes -DHAS_THREAD_LOCAL libcxxabi_cppflags += -DLIBCXXABI_USE_LLVM_UNWINDER=1 +ifeq ($(TARGET_ARCH_ABI),arm64-v8a) + libcxxabi_cppflags += -mbranch-protection=standard +endif + ifneq ($(LIBCXX_FORCE_REBUILD),true) # Using prebuilt include $(CLEAR_VARS) LOCAL_MODULE := libc++abi -LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD SPDX-license-identifier-MIT SPDX-license-identifier-NCSA -LOCAL_LICENSE_CONDITIONS := notice -LOCAL_NOTICE_FILE := $(LOCAL_PATH)/LICENSE.TXT $(LOCAL_PATH)/NOTICE LOCAL_SRC_FILES := ../llvm-libc++/libs/$(TARGET_ARCH_ABI)/$(LOCAL_MODULE)$(TARGET_LIB_EXTENSION) LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include @@ -67,9 +68,6 @@ else # Building include $(CLEAR_VARS) LOCAL_MODULE := libc++abi -LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD SPDX-license-identifier-MIT SPDX-license-identifier-NCSA -LOCAL_LICENSE_CONDITIONS := notice -LOCAL_NOTICE_FILE := $(LOCAL_PATH)/LICENSE.TXT $(LOCAL_PATH)/NOTICE LOCAL_SRC_FILES := $(libcxxabi_src_files) LOCAL_C_INCLUDES := $(libcxxabi_includes) LOCAL_CPPFLAGS := $(libcxxabi_cppflags) @@ -99,9 +97,6 @@ endif # Prebuilt/building # is linked statically even if a shared library dependency exports an unwinder. include $(CLEAR_VARS) LOCAL_MODULE := libunwind -LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD SPDX-license-identifier-MIT SPDX-license-identifier-NCSA -LOCAL_LICENSE_CONDITIONS := notice -LOCAL_NOTICE_FILE := $(LOCAL_PATH)/LICENSE.TXT $(LOCAL_PATH)/NOTICE LOCAL_SRC_FILES := $(NDK_TOOLCHAIN_LIB_DIR)/$(TARGET_TOOLCHAIN_ARCH_LIB_DIR)/libunwind.a include $(PREBUILT_STATIC_LIBRARY) @@ -69,6 +69,11 @@ def remove_old_release(install_dir): shutil.rmtree(install_dir) +LIBUNWIND_GLOB = ( + 'toolchains/llvm/prebuilt/*/lib64/clang/*/lib/linux/*/libunwind.a' +) + + def unzip_single_directory(artifact, destination): # Use cwd so that we can use rename without having to worry about crossing # file systems. @@ -83,6 +88,7 @@ def unzip_single_directory(artifact, destination): '*/sources/android/support/*', '*/sources/cxx-stl/*', '*/source.properties', + os.path.join('*', LIBUNWIND_GLOB), ] check_call(cmd) @@ -94,6 +100,23 @@ def unzip_single_directory(artifact, destination): os.path.join(destination, child)) +def relocate_libunwind(install_dir): + unwinds = glob.glob(os.path.join(install_dir, LIBUNWIND_GLOB)) + dest_base = os.path.join(install_dir, 'sources/cxx-stl/llvm-libc++/libs') + for libunwind in unwinds: + arch = os.path.basename(os.path.dirname(libunwind)) + abi = { + 'arm': 'armeabi-v7a', + 'aarch64': 'arm64-v8a', + 'i386': 'x86', + 'x86_64': 'x86_64', + }[arch] + dest_dir = os.path.join(dest_base, abi) + dest = os.path.join(dest_dir, 'libunwind.a') + logger().info('Relocating %s to %s', libunwind, dest) + os.rename(libunwind, dest) + + def install_new_release(branch, build, install_dir): os.makedirs(install_dir) @@ -108,6 +131,7 @@ def install_new_release(branch, build, install_dir): logger().info('Extracting release') unzip_single_directory(artifact, install_dir) + relocate_libunwind(install_dir) finally: for artifact in artifacts: os.unlink(artifact) |