-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix build/runtime API level for static exe tests.
Static executable tests need this to run correctly. They need to build against the newest API level (there's only one libc.a, which the headers and CRT objects need to match), but can run against any API level. We've been getting away with this for a while because it wasn't as strict, but libc.a now has a dependency on ELF TLS, so we need the newer CRT objects. We were further getting away with it because --gc-sections was stripping the ELF TLS dependency. Bug: android/ndk#1813 Test: this is the test, now it passes Change-Id: Icc984f9fa3dc83ecd8c3dca8789be55bcb487119
- Loading branch information
Showing
4 changed files
with
27 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
APP_PLATFORM := android-21 | ||
APP_PLATFORM := latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,13 @@ | ||
def build_unsupported(test): | ||
# Static executables with libc++ require targeting a new enough API level | ||
# to not need libandroid_support. | ||
if test.config.api < 21: | ||
return f"android-{test.config.api}" | ||
import ndk.abis | ||
from ndk.test.buildtest.case import Test | ||
|
||
return None | ||
|
||
def extra_cmake_flags() -> list[str]: | ||
# Required for static executables. | ||
return ["-DANDROID_PLATFORM=latest"] | ||
|
||
|
||
def override_runtime_minsdkversion(test: Test) -> int | None: | ||
# We build as latest because static executables require that, but static executables | ||
# are compatible with old OS versions. | ||
return ndk.abis.min_api_for_abi(test.config.abi) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
APP_PLATFORM := latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,13 @@ | ||
def extra_cmake_flags(): | ||
# Match the ndk-build test. Using libc++ here would require us to target a | ||
# newer API level since static executables and libandroid_support don't | ||
# mix. | ||
return ["-DANDROID_STL=system"] | ||
import ndk.abis | ||
from ndk.test.buildtest.case import Test | ||
|
||
|
||
def extra_cmake_flags() -> list[str]: | ||
# Required for static executables. | ||
return ["-DANDROID_PLATFORM=latest"] | ||
|
||
|
||
def override_runtime_minsdkversion(test: Test) -> int | None: | ||
# We build as latest because static executables require that, but static executables | ||
# are compatible with old OS versions. | ||
return ndk.abis.min_api_for_abi(test.config.abi) |