@@ -102,13 +102,18 @@ cc_toolchain_config(
102102 abi_libc_version = "glibc_unknown" ,
103103 abi_version = "clang" ,
104104 builtin_sysroot = select ({
105- # _use_libcpp case needs to be implemented properly here!
105+ "@rules_swiftnav//cc: _use_libcpp" : None ,
106106 "//conditions:default" : "external/rules_swiftnav++swift_cc_toolchain_extension+aarch64-sysroot" ,
107107 }),
108108 compiler = "clang" ,
109109 cxx_builtin_include_directories = [
110110 "%sysroot%/usr/include" ,
111111 ],
112+ extra_copts = select ({
113+ "@rules_swiftnav//cc/constraints:graviton2" : ["-mcpu=neoverse-n1" ],
114+ "@rules_swiftnav//cc/constraints:graviton3" : ["-mcpu=neoverse-512tvb" ],
115+ "//conditions:default" : [],
116+ }),
112117 host_system_name = X86_64_LINUX ,
113118 target_cpu = "aarch64" ,
114119 target_libc = "glibc_unknown" ,
@@ -158,3 +163,39 @@ toolchain(
158163 toolchain = ":cc-clang-x86_64-aarch64-linux" ,
159164 toolchain_type = "@bazel_tools//tools/cpp:toolchain_type" ,
160165)
166+
167+ toolchain (
168+ name = "cc-toolchain-aarch64-bullseye-graviton2" ,
169+ exec_compatible_with = [
170+ "@platforms//cpu:x86_64" ,
171+ "@platforms//os:linux" ,
172+ ],
173+ target_compatible_with = [
174+ "@platforms//os:linux" ,
175+ "@platforms//cpu:aarch64" ,
176+ "@rules_swiftnav//cc/constraints:glibc_2_31" ,
177+ "@rules_swiftnav//cc/constraints:graviton2" ,
178+ "@rules_swiftnav//cc/constraints:llvm20_toolchain" ,
179+ ],
180+ target_settings = None ,
181+ toolchain = ":cc-clang-x86_64-aarch64-linux" ,
182+ toolchain_type = "@bazel_tools//tools/cpp:toolchain_type" ,
183+ )
184+
185+ toolchain (
186+ name = "cc-toolchain-aarch64-bullseye-graviton3" ,
187+ exec_compatible_with = [
188+ "@platforms//cpu:x86_64" ,
189+ "@platforms//os:linux" ,
190+ ],
191+ target_compatible_with = [
192+ "@platforms//os:linux" ,
193+ "@platforms//cpu:aarch64" ,
194+ "@rules_swiftnav//cc/constraints:glibc_2_31" ,
195+ "@rules_swiftnav//cc/constraints:graviton3" ,
196+ "@rules_swiftnav//cc/constraints:llvm20_toolchain" ,
197+ ],
198+ target_settings = None ,
199+ toolchain = ":cc-clang-x86_64-aarch64-linux" ,
200+ toolchain_type = "@bazel_tools//tools/cpp:toolchain_type" ,
201+ )
0 commit comments