From 4523043d75b0d2ef726a548e40cc1813e391a3a1 Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Mon, 5 Feb 2018 16:14:53 -0800 Subject: [PATCH] Test fixes for modern static libraries. Unfortunately static executables with libc++ will require API > 26 to avoid libandroid_support. Fortunately this doesn't actually cause any issues except in the case of having a static executable in the same project as other non-static executable modules. Test: ./run_tests.py Bug: http://b/24507500 Bug: https://github.com/android-ndk/ndk/issues/593 Change-Id: I925dac426a41326c76bddec691ba8ce227ba5370 (cherry picked from commit d0dd54a20855dcb9cfdcda2c129edf1e4d2f42bb) --- .../jni/Application.mk | 1 + .../test_config.py | 18 ++++++++++++------ tests/device/wait/test_config.py | 4 ---- 3 files changed, 13 insertions(+), 10 deletions(-) create mode 100644 tests/device/static-executable-exceptions/jni/Application.mk delete mode 100644 tests/device/wait/test_config.py diff --git a/tests/device/static-executable-exceptions/jni/Application.mk b/tests/device/static-executable-exceptions/jni/Application.mk new file mode 100644 index 00000000..2133d20c --- /dev/null +++ b/tests/device/static-executable-exceptions/jni/Application.mk @@ -0,0 +1 @@ +APP_PLATFORM := android-21 diff --git a/tests/device/static-executable-exceptions/test_config.py b/tests/device/static-executable-exceptions/test_config.py index dfa83b5d..fa53afe5 100644 --- a/tests/device/static-executable-exceptions/test_config.py +++ b/tests/device/static-executable-exceptions/test_config.py @@ -1,7 +1,13 @@ -def run_broken(abi, _device_api, toolchain, _subtest): - if abi == 'armeabi-v7a': - # __gnu_Unwind_Find_exidx has always been broken in libc.a. We need an - # update to the static libraries to fix this. - return abi, 'https://github.com/android-ndk/ndk/issues/593' +def extra_cmake_flags(): + # Clang does the right thing if you provide `-pie -static`, but GCC throws + # an error. + return ['-DANDROID_PIE=OFF'] - return None, None + +def build_unsupported(_abi, api, _toolchain): + # Static executables with libc++ require targeting a new enough API level + # to not need libandroid_support. + if api < 21: + return 'android-{}'.format(api) + + return None diff --git a/tests/device/wait/test_config.py b/tests/device/wait/test_config.py deleted file mode 100644 index 7fd92af8..00000000 --- a/tests/device/wait/test_config.py +++ /dev/null @@ -1,4 +0,0 @@ -def run_broken(abi, device_api, toolchain, subtest): - if subtest == 'test_wait-static' and abi == 'x86': - return abi, 'http://b/24507500' - return None, None