• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1load(":cc_toolchain_config.bzl", "cc_toolchain_config")
2
3package(default_visibility = ["//visibility:public"])
4
5filegroup(name = "empty")
6
7TOOLCHAINS = {
8    "osx-x86_64": "cc-compiler-osx-x86_64",
9    "osx-aarch_64": "cc-compiler-osx-aarch_64",
10    "linux-aarch_64": "cc-compiler-linux-aarch_64",
11    "linux-ppcle_64": "cc-compiler-linux-ppcle_64",
12    "linux-s390_64": "cc-compiler-linux-s390_64",
13    "linux-x86_32": "cc-compiler-linux-x86_32",
14    "linux-x86_64": "cc-compiler-linux-x86_64",
15    "win32": "cc-compiler-windows-x86_32",
16    "win64": "cc-compiler-windows-x86_64",
17}
18
19cc_toolchain_suite(
20    name = "clang_suite",
21    toolchains = TOOLCHAINS
22)
23
24[
25    cc_toolchain(
26        name = toolchain,
27        all_files = ":empty",
28        compiler_files = ":empty",
29        dwp_files = ":empty",
30        dynamic_runtime_lib = ":empty",
31        linker_files = ":empty",
32        objcopy_files = ":empty",
33        output_licenses = ["restricted"],
34        static_runtime_lib = ":empty",
35        strip_files = ":empty",
36        toolchain_config = ":" + cpu + "-config",
37        toolchain_identifier = toolchain,
38    )
39    for cpu, toolchain in TOOLCHAINS.items()
40]
41
42cc_toolchain_config(
43    name = "linux-aarch_64-config",
44    bit_flag = "-m64",
45    cpp_flag = "-lstdc++",
46    extra_compiler_flags = [
47        "-I/opt/manylinux/2014/aarch64/usr/include/c++/10/aarch64-redhat-linux",
48        "-I/opt/manylinux/2014/aarch64/usr/include/c++/10"
49    ],
50    sysroot = "/opt/manylinux/2014/aarch64",
51    linker_path = "/usr/bin/ld",
52    target_cpu = "aarch64",
53    target_full_name = "aarch64-linux-gnu",
54    toolchain_name = "linux_aarch_64",
55    # Don't really need this, setting it because it's required.
56    toolchain_dir = "/opt/manylinux/2014/aarch64/usr/include",
57)
58
59cc_toolchain_config(
60    name = "linux-ppcle_64-config",
61    bit_flag = "-m64",
62    cpp_flag = "-lstdc++",
63    extra_compiler_flags = [
64        "-I/usr/powerpc64le-linux-gnu/include/c++/8/powerpc64le-linux-gnu/",
65        "-I/usr/powerpc64le-linux-gnu/include/c++/8/"
66    ],
67    extra_include = "/usr/include",
68    linker_path = "/usr/bin/ld",
69    target_cpu = "ppc64",
70    target_full_name = "powerpc64le-linux-gnu",
71    toolchain_dir = "/usr/powerpc64le-linux-gnu/include",
72    toolchain_name = "linux_ppcle_64",
73)
74
75cc_toolchain_config(
76    name = "linux-s390_64-config",
77    bit_flag = "-m64",
78    cpp_flag = "-lstdc++",
79    extra_compiler_flags = [
80        "-I/usr/s390x-linux-gnu/include/c++/8/s390x-linux-gnu/",
81        "-I/usr/s390x-linux-gnu/include/c++/8/"
82    ],
83    extra_include = "/usr/include",
84    linker_path = "/usr/bin/ld",
85    target_cpu = "systemz",
86    target_full_name = "s390x-linux-gnu",
87    toolchain_dir = "/usr/s390x-linux-gnu/include",
88    toolchain_name = "linux_s390_64",
89)
90
91cc_toolchain_config(
92    name = "linux-x86_32-config",
93    bit_flag = "-m32",
94    cpp_flag = "-lstdc++",
95    extra_include = "/usr/include",
96    linker_path = "/usr/bin/ld",
97    target_cpu = "x86_32",
98    target_full_name = "i386-linux-gnu",
99    toolchain_dir = "/usr/include/i386-linux-gnu",
100    toolchain_name = "linux_x86_32",
101)
102
103cc_toolchain_config(
104    name = "linux-x86_64-config",
105    bit_flag = "-m64",
106    cpp_flag = "-lstdc++",
107    extra_include = "/usr/include",
108    linker_path = "/usr/bin/ld",
109    target_cpu = "x86_64",
110    target_full_name = "x86_64-linux-gnu",
111    toolchain_dir = "/usr/include/x86_64-linux-gnu",
112    toolchain_name = "linux_x86_64",
113)
114
115cc_toolchain_config(
116    name = "osx-aarch_64-config",
117    bit_flag = "-m64",
118    cpp_flag = "-lc++",
119    extra_compiler_flags = [
120        "-I/usr/tools/apple_sdks/xcode_13_0/macosx/usr/include/c++/v1",
121        "-I/usr/tools/apple_sdks/xcode_13_0/macosx/usr/include"
122    ],
123    extra_include = "/usr/include",
124    linker_path = "/usr/tools",
125    sysroot = "/usr/tools/apple_sdks/xcode_13_0/macosx",
126    target_cpu = "aarch64",
127    target_full_name = "aarch64-apple-macosx11.3",
128    toolchain_dir = "/usr/tools/apple_sdks/xcode_13_0/macosx",
129    toolchain_name = "osx_aarch_64",
130)
131
132cc_toolchain_config(
133    name = "osx-x86_64-config",
134    bit_flag = "-m64",
135    cpp_flag = "-lc++",
136    extra_compiler_flags = [
137        "-I/usr/tools/apple_sdks/xcode_13_0/macosx/usr/include/c++/v1",
138        "-I/usr/tools/apple_sdks/xcode_13_0/macosx/usr/include"
139    ],
140    extra_include = "/usr/include",
141    linker_path = "/usr/tools",
142    sysroot = "/usr/tools/apple_sdks/xcode_13_0/macosx",
143    target_cpu = "x86_64",
144    target_full_name = "x86_64-apple-macosx11.3",
145    toolchain_dir = "/usr/tools/apple_sdks/xcode_13_0/macosx",
146    toolchain_name = "osx_x86_64",
147)
148
149cc_toolchain_config(
150    name = "win32-config",
151    bit_flag = "-m32",
152    cpp_flag = "-lstdc++",
153    extra_compiler_flags = [
154        "-isystem/usr/lib/gcc/i686-w64-mingw32/8.3-posix/include/c++",
155        "-isystem/usr/lib/gcc/i686-w64-mingw32/8.3-posix/include/c++/i686-w64-mingw32",
156        "-fsjlj-exceptions",
157    ],
158    extra_include = "/usr/lib/gcc/i686-w64-mingw32/8.3-posix/include",
159    extra_linker_flags = [
160        "-L/usr/lib/gcc/i686-w64-mingw32/8.3-posix",
161        "-pthread",
162    ],
163    linker_path = "/usr/bin/ld",
164    target_cpu = "x86_32",
165    target_full_name = "i686-w64-mingw32",
166    toolchain_dir = "/usr/i686-w64-mingw32/include",
167    toolchain_name = "i686-w64-mingw32",
168)
169
170cc_toolchain_config(
171    name = "win64-config",
172    bit_flag = "-m64",
173    cpp_flag = "-lstdc++",
174    extra_compiler_flags = [
175        "-isystem/usr/lib/gcc/x86_64-w64-mingw32/8.3-posix/include/c++/",
176        "-isystem/usr/lib/gcc/x86_64-w64-mingw32/8.3-posix/include/c++/x86_64-w64-mingw32",
177    ],
178    extra_include = "/usr/lib/gcc/x86_64-w64-mingw32/8.3-posix/include",
179    extra_linker_flags = [
180        "-L/usr/lib/gcc/x86_64-w64-mingw32/8.3-posix",
181    ],
182    linker_path = "/usr/bin/ld",
183    target_cpu = "x86_64",
184    target_full_name = "x86_64-w64-mingw32",
185    toolchain_dir = "/usr/x86_64-w64-mingw32/include",
186    toolchain_name = "x86_64-w64-mingw32",
187)
188