Skip to content

Commit 17208fa

Browse files
committed
chore: add toolchains for linux arm64
1 parent b6090f7 commit 17208fa

File tree

3 files changed

+35
-1
lines changed

3 files changed

+35
-1
lines changed

.bazelrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ common --repo_env=CC=clang
1313
# On Linux, use a hermetic toolchain and sysroot shared between local dev setups and CI.
1414
# Such a toolchain isn't easily available on macOS or Windows.
1515
common:linux --repo_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1
16+
# Register hermetic LLVM toolchains for both x86_64 and arm64
1617
common:linux --extra_toolchains=@llvm_toolchain//:cc-toolchain-x86_64-linux
18+
common:linux --extra_toolchains=@llvm_toolchain//:cc-toolchain-aarch64-linux
1719
# Silence protobuf compilation warnings.
1820
build --copt=-Wno-unused-function
1921
build --copt=-Wno-unknown-warning-option

MODULE.bazel

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,24 @@ filegroup(
253253
)
254254
""",
255255
sha256 = "84656a6df544ecef62169cfe3ab6e41bb4346a62d3ba2a045dc5a0a2ecea94a3",
256-
urls = ["https://commondatastorage.googleapis.com/chrome-linux-sysroot/toolchain/2202c161310ffde63729f29d27fe7bb24a0bc540/debian_stretch_amd64_sysroot.tar.xz"],
256+
urls = [
257+
"https://commondatastorage.googleapis.com/chrome-linux-sysroot/toolchain/2202c161310ffde63729f29d27fe7bb24a0bc540/debian_stretch_amd64_sysroot.tar.xz",
258+
],
259+
)
260+
261+
http_archive(
262+
name = "org_chromium_sysroot_linux_aarch64",
263+
build_file_content = """
264+
filegroup(
265+
name = "sysroot",
266+
srcs = glob(["*/**"]),
267+
visibility = ["//visibility:public"],
268+
)
269+
""",
270+
sha256 = "e39b700d8858d18868544c8c84922f6adfa8419f3f42471b92024ba38eff7aca",
271+
urls = [
272+
"https://commondatastorage.googleapis.com/chrome-linux-sysroot/toolchain/2202c161310ffde63729f29d27fe7bb24a0bc540/debian_stretch_arm64_sysroot.tar.xz",
273+
],
257274
)
258275

259276
http_file(
@@ -385,6 +402,7 @@ remote_jdk8_repos = use_extension("//third_party:jdk_8.bzl", "remote_jdk8_repos"
385402

386403
REMOTE_JDK8 = [
387404
"remote_jdk8_linux",
405+
"remote_jdk8_linux_aarch64",
388406
"remote_jdk8_macos",
389407
"remote_jdk8_macos_aarch64",
390408
"remote_jdk8_windows",
@@ -415,6 +433,7 @@ llvm.toolchain(
415433
# https://github.com/grailbio/bazel-toolchain/issues/234
416434
# https://github.com/grailbio/bazel-toolchain/pull/235
417435
"linux-x86_64": "@@_main~_repo_rules~org_chromium_sysroot_linux_x64//:sysroot",
436+
"linux-aarch64": "@@_main~_repo_rules~org_chromium_sysroot_linux_aarch64//:sysroot",
418437
},
419438
)
420439
use_repo(llvm, "llvm_toolchain")

third_party/jdk_8.bzl

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,19 @@ def _remote_jdk8_repos(_):
5656
],
5757
version = "8",
5858
)
59+
remote_java_repository(
60+
name = "remote_jdk8_linux_aarch64",
61+
target_compatible_with = [
62+
"@platforms//os:linux",
63+
"@platforms//cpu:aarch64",
64+
],
65+
integrity = "sha256-xESdKEmfkiE657X/xclwsJR5M+P72BpWErtAcYMcK0Y=",
66+
strip_prefix = "zulu8.74.0.17-ca-jdk8.0.392-linux_aarch64",
67+
urls = [
68+
"https://cdn.azul.com/zulu/bin/zulu8.74.0.17-ca-jdk8.0.392-linux_aarch64.tar.gz",
69+
],
70+
version = "8",
71+
)
5972
remote_java_repository(
6073
name = "remote_jdk8_windows",
6174
target_compatible_with = [

0 commit comments

Comments
 (0)