diff options
author | 2021-03-19 22:18:04 +0900 | |
---|---|---|
committer | 2021-03-23 01:18:31 +0900 | |
commit | fdaa5f71648b8e3c21a867db0a6751f5e1a2069b (patch) | |
tree | 59cc116ef27a3315654896d9b449046a05b2d6c4 /sdk/cc_sdk_test.go | |
parent | a008fb08cf5e50baef8ee612feba5104de536393 (diff) |
Versioned CRT objects are built with correct __ANDROID_API__
Background: `min_sdk_version` of a crt object is the oldest SDK version
that the crt object supports. When it's set to for example 16, Soong
creates a number of versioned variants of the crt object starting from
16 to the latest version. The variant for version X is provided to NDK
clients having `min_sdk_version` set to X.
Problem: all versioned variants of a crt object were built with `-target
<arch>-linux-android16`. Therefore they all have been with `#define __ANDROID_API__
16`. This is because the mutated variants still have the same
min_sdk_version property and the clang triple follows min_sdk_version,
not sdk_version. This is too conservative and against our intention to
provide the latest crt object that matches with the min_sdk_version of
the client.
In the other hand, the platform(non-sdk) variant of the crt object
doesn't have such a problem. min_sdk_version is completely ignored.
However, this is a bug and will be fixed by aosp/1640364. As a side
effect of the fixing, the platform variant will begin to built with a
very old __ANDROID_API__ which unnecessarily turns off the new platform
features like the TLS segment over-alignment.
This change fixes the problems:
* For the versioned variants of crt objects, we set both
`min_sdk_version` and `sdk_versio` to the version that the variant is
created for.
* For the platform variant of crt objects, `min_sdk_version` is force
reset to "current".
Bug: 183191008
Test: m
Change-Id: I8c9d0fcea816de8cd1532dac4a47eee4f726c037
Diffstat (limited to 'sdk/cc_sdk_test.go')
0 files changed, 0 insertions, 0 deletions