aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreehugger Robot <treehugger-gerrit@google.com>2022-10-13 23:21:20 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2022-10-13 23:21:20 +0000
commit25f5375bc8a32028e7fe5a9df06ee223c2c80323 (patch)
tree5bfd12a031ad4f876fdad64c17e8cf1ed9407fa1
parent78764892ef3edbe802c6c7e8eaadd93b79b4d278 (diff)
parent82a673dff0460710b478ba47053c9e858a12f44a (diff)
downloadndk-25f5375bc8a32028e7fe5a9df06ee223c2c80323.tar.gz
Merge "Remove support for KitKat."
-rw-r--r--docs/changelogs/Changelog-r26.md7
-rw-r--r--meta/platforms.json2
-rw-r--r--ndk/abis.py8
-rwxr-xr-xndk/checkbuild.py44
-rw-r--r--tests/build/cmake_api_pull_up/__init__.py0
-rw-r--r--tests/build/cmake_api_pull_up/project/CMakeLists.txt4
-rw-r--r--tests/build/cmake_api_pull_up/project/foo.cpp3
-rw-r--r--tests/build/cmake_api_pull_up/test.py68
-rw-r--r--tests/build/cmake_api_pull_up/test_config.py10
-rw-r--r--tests/device/emutls-dealloc/test_config.py10
10 files changed, 23 insertions, 133 deletions
diff --git a/docs/changelogs/Changelog-r26.md b/docs/changelogs/Changelog-r26.md
index 3ccb3a825..0c91c793c 100644
--- a/docs/changelogs/Changelog-r26.md
+++ b/docs/changelogs/Changelog-r26.md
@@ -11,6 +11,13 @@ directly, see the [build system maintainers guide].
[Android Studio site]: http://tools.android.com/filing-bugs
[build system maintainers guide]: https://android.googlesource.com/platform/ndk/+/master/docs/BuildSystemMaintainers.md
+## Announcements
+
+* KitKat (APIs 19 and 20) is no longer supported. The minimum OS supported by
+ the NDK is Lollipop (API level 21). See [Issue 1751] for details.
+
+[Issue 1751]: https://github.com/android/nßdk/issues/1751
+
## Changes
## Known Issues
diff --git a/meta/platforms.json b/meta/platforms.json
index 438069668..824bb8020 100644
--- a/meta/platforms.json
+++ b/meta/platforms.json
@@ -1,5 +1,5 @@
{
- "min": 19,
+ "min": 21,
"max": 33,
"aliases": {
"20": 19,
diff --git a/ndk/abis.py b/ndk/abis.py
index c577da809..a710d9e4a 100644
--- a/ndk/abis.py
+++ b/ndk/abis.py
@@ -121,13 +121,13 @@ def clang_target(arch: Arch, api: Optional[int] = None) -> str:
def min_api_for_abi(abi: Abi) -> int:
"""Returns the minimum supported build API for the given ABI.
- >>> min_api_for_abi('arm64-v8a')
+ >>> min_api_for_abi(Abi('arm64-v8a'))
21
- >>> min_api_for_abi('armeabi-v7a')
- 19
+ >>> min_api_for_abi(Abi('armeabi-v7a'))
+ 21
- >>> min_api_for_abi('foobar')
+ >>> min_api_for_abi(Abi('foobar'))
Traceback (most recent call last):
...
ValueError: Invalid ABI: foobar
diff --git a/ndk/checkbuild.py b/ndk/checkbuild.py
index 9088c8c08..13736f4d3 100755
--- a/ndk/checkbuild.py
+++ b/ndk/checkbuild.py
@@ -813,7 +813,6 @@ class Libcxx(ndk.builds.Module):
notice_group = ndk.builds.NoticeGroup.TOOLCHAIN
deps = {
"base-toolchain",
- "libandroid_support",
"ndk-build",
"ndk-build-shortcut",
}
@@ -1501,7 +1500,6 @@ class BaseToolchain(ndk.builds.Module):
notice_group = ndk.builds.NoticeGroup.TOOLCHAIN
deps = {
"clang",
- "libandroid_support",
"make",
"platforms",
"sysroot",
@@ -1513,7 +1511,6 @@ class BaseToolchain(ndk.builds.Module):
def notices(self) -> Iterator[Path]:
yield from Clang().notices
yield from Yasm().notices
- yield from LibAndroidSupport().notices
yield from Platforms().notices
yield from Sysroot().notices
yield from SystemStl().notices
@@ -1524,7 +1521,6 @@ class BaseToolchain(ndk.builds.Module):
def install(self) -> None:
install_dir = self.get_install_path()
yasm_dir = self.get_dep("yasm").get_install_path()
- libandroid_support_dir = self.get_dep("libandroid_support").get_install_path()
platforms_dir = self.get_dep("platforms").get_install_path()
sysroot_dir = self.get_dep("sysroot").get_install_path()
system_stl_dir = self.get_dep("system-stl").get_install_path()
@@ -1577,19 +1573,6 @@ class BaseToolchain(ndk.builds.Module):
system_stl_inc_dst = system_stl_hdr_dir / "4.9.x"
shutil.copytree(system_stl_inc_src, system_stl_inc_dst)
- # $SYSROOT/usr/local/include comes before $SYSROOT/usr/include, so we
- # can use that for libandroid_support's headers. Puting them here
- # *does* mean that libandroid_support's headers get used even when
- # we're not using libandroid_support, but they should be a no-op for
- # android-21+ and in the case of pre-21 without libandroid_support
- # (libstdc++), we're only degrading the UX; the user will get a linker
- # error instead of a compiler error.
- support_hdr_dir = install_dir / "sysroot/usr/local"
- support_hdr_dir.mkdir(parents=True)
- support_inc_src = libandroid_support_dir / "include"
- support_inc_dst = support_hdr_dir / "include"
- shutil.copytree(support_inc_src, support_inc_dst)
-
@register
class Vulkan(ndk.builds.Module):
@@ -1679,8 +1662,6 @@ class Toolchain(ndk.builds.Module):
"libc++_static.a",
"libc++abi.a",
]
- if abi in ndk.abis.LP32_ABIS:
- static_libs.append("libandroid_support.a")
for lib in static_libs:
shutil.copy2(
@@ -1689,6 +1670,7 @@ class Toolchain(ndk.builds.Module):
platforms = self.get_dep("platforms")
assert isinstance(platforms, Platforms)
+ # Also install a libc++.so and libc++.a linker script per API level.
for api in platforms.get_apis():
if api in Platforms.skip_apis:
continue
@@ -1697,25 +1679,8 @@ class Toolchain(ndk.builds.Module):
triple = ndk.abis.arch_to_triple(arch)
dst_dir = install_dir / "sysroot/usr/lib" / triple / str(api)
- # Also install a libc++.so and libc++.a linker script per API
- # level. We need this to be done on a per-API level basis
- # because libandroid_support is only used on pre-21 API levels.
static_script = ["-lc++_static", "-lc++abi"]
shared_script = ["-lc++_shared"]
- if api < 21:
- # The ordering here is funky because of interdependencies
- # between libandroid_support and libc++abi.
- # libandroid_support needs new/delete from libc++abi but
- # libc++abi needs posix_memalign from libandroid_support.
- static_script.extend(
- [
- "-landroid_support",
- "-lc++abi",
- # TODO: Remove once API 16 is no longer supported.
- "-landroid_support",
- ]
- )
- shared_script.insert(0, "-landroid_support")
libcxx_so_path = dst_dir / "libc++.so"
with open(libcxx_so_path, "w") as script:
@@ -1921,13 +1886,6 @@ class SystemStl(ndk.builds.PackageModule):
@register
-class LibAndroidSupport(ndk.builds.PackageModule):
- name = "libandroid_support"
- install_path = Path("sources/android/support")
- src = NDK_DIR / "sources/android/support"
-
-
-@register
class Libcxxabi(ndk.builds.PackageModule):
name = "libc++abi"
install_path = Path("sources/cxx-stl/llvm-libc++abi")
diff --git a/tests/build/cmake_api_pull_up/__init__.py b/tests/build/cmake_api_pull_up/__init__.py
deleted file mode 100644
index e69de29bb..000000000
--- a/tests/build/cmake_api_pull_up/__init__.py
+++ /dev/null
diff --git a/tests/build/cmake_api_pull_up/project/CMakeLists.txt b/tests/build/cmake_api_pull_up/project/CMakeLists.txt
deleted file mode 100644
index ddcd35369..000000000
--- a/tests/build/cmake_api_pull_up/project/CMakeLists.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-cmake_minimum_required(VERSION 3.6)
-project(ApiLevelPullUpTest CXX)
-
-add_library(foo SHARED foo.cpp)
diff --git a/tests/build/cmake_api_pull_up/project/foo.cpp b/tests/build/cmake_api_pull_up/project/foo.cpp
deleted file mode 100644
index b876b5c83..000000000
--- a/tests/build/cmake_api_pull_up/project/foo.cpp
+++ /dev/null
@@ -1,3 +0,0 @@
-#if __ANDROID_API__ != 21
-#error API level was not pulled up to 21
-#endif
diff --git a/tests/build/cmake_api_pull_up/test.py b/tests/build/cmake_api_pull_up/test.py
deleted file mode 100644
index c1906e478..000000000
--- a/tests/build/cmake_api_pull_up/test.py
+++ /dev/null
@@ -1,68 +0,0 @@
-#
-# Copyright (C) 2021 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-"""Check that pre-LP64 API levels are correctly pulled-up for CMake."""
-from pathlib import Path
-import re
-import subprocess
-
-from ndk.cmake import find_cmake, find_ninja
-from ndk.test.spec import BuildConfiguration, CMakeToolchainFile
-
-
-def run_test(ndk_path: str, config: BuildConfiguration) -> tuple[bool, str]:
- """Check that pre-LP64 API levels are correctly pulled-up for CMake."""
- cmake = find_cmake()
- ninja = find_ninja()
- toolchain_path = Path(ndk_path) / 'build/cmake/android.toolchain.cmake'
- project_path = 'project'
- if config.toolchain_file is CMakeToolchainFile.Legacy:
- toolchain_mode = 'ON'
- else:
- toolchain_mode = 'OFF'
-
- test_inputs = (
- '-DANDROID_PLATFORM=19',
- '-DANDROID_PLATFORM=android-19',
- '-DANDROID_NATIVE_API_LEVEL=19',
- '-DANDROID_NATIVE_API_LEVEL=android-19',
- )
-
- for arg in test_inputs:
- cmake_cmd = [
- str(cmake),
- f'-DCMAKE_TOOLCHAIN_FILE={toolchain_path}',
- f'-DANDROID_ABI={config.abi}',
- arg,
- f'-DCMAKE_MAKE_PROGRAM={ninja}',
- f'-DANDROID_USE_LEGACY_TOOLCHAIN_FILE={toolchain_mode}',
- '-GNinja',
- ]
- result = subprocess.run(cmake_cmd,
- check=False,
- cwd=project_path,
- capture_output=True,
- text=True)
- if result.returncode != 0:
- return False, result.stdout
- if config.toolchain_file is CMakeToolchainFile.Default:
- expected = re.compile(
- r'android-19 is not supported.*'
- r'Using minimum supported LP64 version 21.')
- if not expected.search(result.stdout):
- return False, (f'expected pattern "{expected.pattern}" is '
- f'missing from cmake output:\n{result.stdout}')
-
- return True, ''
diff --git a/tests/build/cmake_api_pull_up/test_config.py b/tests/build/cmake_api_pull_up/test_config.py
deleted file mode 100644
index 3c08c53db..000000000
--- a/tests/build/cmake_api_pull_up/test_config.py
+++ /dev/null
@@ -1,10 +0,0 @@
-from typing import Optional
-
-from ndk.abis import LP32_ABIS
-from ndk.test.buildtest.case import Test
-
-
-def build_unsupported(test: Test) -> Optional[str]:
- if test.config.abi in LP32_ABIS:
- return test.config.abi
- return None
diff --git a/tests/device/emutls-dealloc/test_config.py b/tests/device/emutls-dealloc/test_config.py
new file mode 100644
index 000000000..cd33f8ef9
--- /dev/null
+++ b/tests/device/emutls-dealloc/test_config.py
@@ -0,0 +1,10 @@
+from typing import Optional
+from ndk.abis import Abi
+from ndk.test.devices import Device
+from ndk.test.devicetest.case import TestCase
+
+
+def run_broken(test: TestCase, device: Device) -> tuple[Optional[str], Optional[str]]:
+ if device.version == 21 and test.config.abi == Abi("armeabi-v7a"):
+ return f"{device.version}", "https://github.com/android/ndk/issues/1753"
+ return None, None