blob: ced9b795cc27cb3ea0674389fdc2e43d3528766d [file] [log] [blame]
Josh Gaobf8a2852016-05-27 11:59:09 -07001/*
2 * Copyright 2016 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#pragma once
18
19#include <map>
20#include <set>
21#include <string>
22#include <unordered_map>
Josh Gaod8c77252016-06-03 13:54:28 -070023#include <unordered_set>
Josh Gaobf8a2852016-05-27 11:59:09 -070024
25extern bool verbose;
26
27static const std::set<std::string> supported_archs = {
28 "arm", "arm64", "mips", "mips64", "x86", "x86_64",
29};
30
31static std::unordered_map<std::string, std::string> arch_targets = {
32 { "arm", "arm-linux-androideabi" },
33 { "arm64", "aarch64-linux-android" },
34 { "mips", "mipsel-linux-android" },
35 { "mips64", "mips64el-linux-android" },
36 { "x86", "i686-linux-android" },
37 { "x86_64", "x86_64-linux-android" },
38};
39
40static const std::set<int> supported_levels = { 9, 12, 13, 14, 15, 16, 17, 18, 19, 21, 23, 24 };
41
42// Non-const for the convenience of being able to index with operator[].
43static std::map<std::string, int> arch_min_api = {
44 { "arm", 9 },
45 { "arm64", 21 },
46 { "mips", 9 },
47 { "mips64", 21 },
48 { "x86", 9 },
49 { "x86_64", 21 },
50};
51
52static const std::unordered_map<std::string, std::set<std::string>> header_blacklist = {
53 // Internal header.
54 { "sys/_system_properties.h", supported_archs },
55
56 // time64.h #errors when included on LP64 archs.
57 { "time64.h", { "arm64", "mips64", "x86_64" } },
58};
Josh Gaod8c77252016-06-03 13:54:28 -070059
60static const std::unordered_set<std::string> missing_symbol_whitelist = {
61 // atexit comes from crtbegin.
62 "atexit",
63};