From 5f1165c66f81c4ba633d84bbf96bcc0b3108d199 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Thu, 30 Jan 2020 14:35:01 -0800 Subject: [PATCH] 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 --- libc/include/android/versioning.h | 2 +- tools/versioner/src/Arch.cpp | 8 -------- tools/versioner/src/Arch.h | 8 -------- tools/versioner/src/DeclarationDatabase.cpp | 3 --- tools/versioner/src/Preprocessor.cpp | 7 ++----- tools/versioner/src/versioner.h | 2 +- 6 files changed, 4 insertions(+), 26 deletions(-) diff --git a/libc/include/android/versioning.h b/libc/include/android/versioning.h index 1948890fa..c7e844a5f 100644 --- a/libc/include/android/versioning.h +++ b/libc/include/android/versioning.h @@ -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"))) diff --git a/tools/versioner/src/Arch.cpp b/tools/versioner/src/Arch.cpp index 4cd9e07b4..3a27a6e34 100644 --- a/tools/versioner/src/Arch.cpp +++ b/tools/versioner/src/Arch.cpp @@ -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 arch_name_map{ {"arm", Arch::arm}, {"arm64", Arch::arm64}, - {"mips", Arch::mips}, - {"mips64", Arch::mips64}, {"x86", Arch::x86}, {"x86_64", Arch::x86_64}, }; diff --git a/tools/versioner/src/Arch.h b/tools/versioner/src/Arch.h index e4bbcc44a..74d0f8f42 100644 --- a/tools/versioner/src/Arch.h +++ b/tools/versioner/src/Arch.h @@ -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 supported_archs = { Arch::arm, Arch::arm64, - Arch::mips, - Arch::mips64, Arch::x86, Arch::x86_64, }; @@ -132,8 +128,6 @@ static const std::set supported_archs = { static ArchMap 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 default_levels = { static const ArchMap arch_min_api = { { Arch::arm, 9 }, { Arch::arm64, 21 }, - { Arch::mips, 9 }, - { Arch::mips64, 21 }, { Arch::x86, 9 }, { Arch::x86_64, 21 }, }; diff --git a/tools/versioner/src/DeclarationDatabase.cpp b/tools/versioner/src/DeclarationDatabase.cpp index afae509ae..3c6f64348 100644 --- a/tools/versioner/src/DeclarationDatabase.cpp +++ b/tools/versioner/src/DeclarationDatabase.cpp @@ -164,15 +164,12 @@ class Visitor : public RecursiveASTVisitor { { "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 } }, }; diff --git a/tools/versioner/src/Preprocessor.cpp b/tools/versioner/src/Preprocessor.cpp index 9eac2abea..4ee3446f1 100644 --- a/tools/versioner/src/Preprocessor.cpp +++ b/tools/versioner/src/Preprocessor.cpp @@ -140,15 +140,12 @@ static std::string generateGuardCondition(const DeclarationAvailability& avail) std::vector expressions; static const std::vector>> 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 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__)" }, }; diff --git a/tools/versioner/src/versioner.h b/tools/versioner/src/versioner.h index a5f2c7d36..5e534989e 100644 --- a/tools/versioner/src/versioner.h +++ b/tools/versioner/src/versioner.h @@ -38,7 +38,7 @@ static const std::unordered_map> 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 missing_symbol_whitelist = {