versioner: don't require mips headers.

If we remove the mips uapi headers, versioner fails because it assumes
they're available. We'll need a new versioner prebuilt beforre we can
remove the libc/versioner-dependencies/mips* symlinks.

Test: treehugger
Change-Id: Ife6df0cb57938f806a31ec334d648df9694c3d17
This commit is contained in:
Elliott Hughes 2020-01-30 14:35:01 -08:00
parent ce11673cad
commit 5f1165c66f
6 changed files with 4 additions and 26 deletions

View File

@ -27,7 +27,7 @@
#define __INTRODUCED_IN_64(api_level) __attribute__((annotate("introduced_in_64=" #api_level)))
#define __INTRODUCED_IN_ARM(api_level) __attribute__((annotate("introduced_in_arm=" #api_level)))
#define __INTRODUCED_IN_X86(api_level) __attribute__((annotate("introduced_in_x86=" #api_level)))
#define __INTRODUCED_IN_MIPS(api_level) __attribute__((annotate("introduced_in_mips=" #api_level)))
#define __INTRODUCED_IN_MIPS(api_level)
#define __VERSIONER_NO_GUARD __attribute__((annotate("versioner_no_guard")))
#define __VERSIONER_FORTIFY_INLINE __attribute__((annotate("versioner_fortify_inline")))

View File

@ -28,12 +28,6 @@ std::string to_string(const Arch& arch) {
case Arch::arm64:
return "arm64";
case Arch::mips:
return "mips";
case Arch::mips64:
return "mips64";
case Arch::x86:
return "x86";
@ -47,8 +41,6 @@ std::string to_string(const Arch& arch) {
static const std::unordered_map<std::string, Arch> arch_name_map{
{"arm", Arch::arm},
{"arm64", Arch::arm64},
{"mips", Arch::mips},
{"mips64", Arch::mips64},
{"x86", Arch::x86},
{"x86_64", Arch::x86_64},
};

View File

@ -28,8 +28,6 @@
enum class Arch : size_t {
arm = 0,
arm64,
mips,
mips64,
x86,
x86_64,
};
@ -123,8 +121,6 @@ class ArchMapIterator {
static const std::set<Arch> supported_archs = {
Arch::arm,
Arch::arm64,
Arch::mips,
Arch::mips64,
Arch::x86,
Arch::x86_64,
};
@ -132,8 +128,6 @@ static const std::set<Arch> supported_archs = {
static ArchMap<std::string> arch_targets = {
{ Arch::arm, "arm-linux-androideabi" },
{ Arch::arm64, "aarch64-linux-android" },
{ Arch::mips, "mipsel-linux-android" },
{ Arch::mips64, "mips64el-linux-android" },
{ Arch::x86, "i686-linux-android" },
{ Arch::x86_64, "x86_64-linux-android" },
};
@ -145,8 +139,6 @@ static const std::set<int> default_levels = {
static const ArchMap<int> arch_min_api = {
{ Arch::arm, 9 },
{ Arch::arm64, 21 },
{ Arch::mips, 9 },
{ Arch::mips64, 21 },
{ Arch::x86, 9 },
{ Arch::x86_64, 21 },
};

View File

@ -164,15 +164,12 @@ class Visitor : public RecursiveASTVisitor<Visitor> {
{ "deprecated_in", { &global_availability.deprecated } },
{ "obsoleted_in", { &global_availability.obsoleted } },
{ "introduced_in_arm", { &arch_availability[Arch::arm].introduced } },
{ "introduced_in_mips", { &arch_availability[Arch::mips].introduced } },
{ "introduced_in_x86", { &arch_availability[Arch::x86].introduced } },
{ "introduced_in_32",
{ &arch_availability[Arch::arm].introduced,
&arch_availability[Arch::mips].introduced,
&arch_availability[Arch::x86].introduced } },
{ "introduced_in_64",
{ &arch_availability[Arch::arm64].introduced,
&arch_availability[Arch::mips64].introduced,
&arch_availability[Arch::x86_64].introduced } },
};

View File

@ -140,15 +140,12 @@ static std::string generateGuardCondition(const DeclarationAvailability& avail)
std::vector<std::string> expressions;
static const std::vector<std::pair<std::string, std::set<Arch>>> arch_sets = {
{ "", supported_archs },
{ "!defined(__LP64__)", { Arch::arm, Arch::mips, Arch::x86 } },
{ "defined(__LP64__)", { Arch::arm64, Arch::mips64, Arch::x86_64 } },
{ "defined(__mips__)", { Arch::mips, Arch::mips64 } },
{ "!defined(__LP64__)", { Arch::arm, Arch::x86 } },
{ "defined(__LP64__)", { Arch::arm64, Arch::x86_64 } },
};
std::map<Arch, std::string> individual_archs = {
{ Arch::arm, "defined(__arm__)" },
{ Arch::arm64, "defined(__aarch64__)" },
{ Arch::mips, "defined(__mips__) && !defined(__LP64__)" },
{ Arch::mips64, "defined(__mips__) && defined(__LP64__)" },
{ Arch::x86, "defined(__i386__)" },
{ Arch::x86_64, "defined(__x86_64__)" },
};

View File

@ -38,7 +38,7 @@ static const std::unordered_map<std::string, std::set<Arch>> header_blacklist =
{ "sys/_system_properties.h", supported_archs },
// time64.h #errors when included on LP64 archs.
{ "time64.h", { Arch::arm64, Arch::mips64, Arch::x86_64 } },
{ "time64.h", { Arch::arm64, Arch::x86_64 } },
};
static const std::unordered_set<std::string> missing_symbol_whitelist = {