1# Copyright (C) 2023 The Android Open Source Project
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7#       http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15"""List of supported architectures by Kleaf."""
16
17ArchInfo = provider(
18    "An architecture for a clang toolchain.",
19    fields = {
20        "name": "a substring of the name of the toolchain. Toolchains are registered in lexicographic order.",
21        "target_os": "OS of the target platform",
22        "target_cpu": "CPU of the target platform",
23        "target_libc": """libc of the target platform
24
25            None means unspecified. For Android, it is always bionic. For Linux, the default value
26            is set in `//build/kernel/kleaf/platforms/libc`.
27        """,
28    },
29)
30
31SUPPORTED_ARCHITECTURES = [
32    ArchInfo(
33        name = "1_linux_musl_x86_64",
34        target_os = "linux",
35        target_cpu = "x86_64",
36        target_libc = "musl",
37    ),
38    ArchInfo(
39        name = "2_linux_x86_64",
40        target_os = "linux",
41        target_cpu = "x86_64",
42        target_libc = None,
43    ),
44    ArchInfo(
45        name = "android_arm64",
46        target_os = "android",
47        target_cpu = "arm64",
48        target_libc = None,
49    ),
50    ArchInfo(
51        name = "android_arm",
52        target_os = "android",
53        target_cpu = "arm",
54        target_libc = None,
55    ),
56    ArchInfo(
57        name = "android_x86_64",
58        target_os = "android",
59        target_cpu = "x86_64",
60        target_libc = None,
61    ),
62    ArchInfo(
63        name = "android_i386",
64        target_os = "android",
65        target_cpu = "i386",
66        target_libc = None,
67    ),
68    ArchInfo(
69        name = "android_riscv64",
70        target_os = "android",
71        target_cpu = "riscv64",
72        target_libc = None,
73    ),
74]
75