Skip to content

toolchains_llvm: add riscv64 host support via MODULE.bazel patches#2364

Open
monkey-jsun wants to merge 2 commits intogoogle:mainfrom
monkey-jsun:pr/toolchains-llvm-riscv64
Open

toolchains_llvm: add riscv64 host support via MODULE.bazel patches#2364
monkey-jsun wants to merge 2 commits intogoogle:mainfrom
monkey-jsun:pr/toolchains-llvm-riscv64

Conversation

@monkey-jsun
Copy link
Copy Markdown

toolchains_llvm 1.6.0 does not support riscv64 as a host architecture.
Patch three files to add linux-riscv64:
- toolchain/internal/common.bzl: add (linux, riscv64) to SUPPORTED_TARGETS
- toolchain/internal/configure.bzl: add riscv64-unknown-linux-gnu target
system name mapping
- toolchain/cc_toolchain_config.bzl: add linux-riscv64 toolchain config
entry mirroring linux-aarch64

Also configure llvm.MODULE.bazel to use the system-installed clang-19
as the toolchain root for riscv64, since no prebuilt LLVM distribution exists
for riscv64 Linux host.

Patch rules_rust 0.68.1 to support riscv64 as a host architecture:
- Add riscv64gc to supported linux architectures in triple.bzl
- Add riscv64gc-unknown-linux-gnu to SUPPORTED_PLATFORM_TRIPLES
  in crate_universe for generated BUILD files
- Register riscv64gc Rust toolchain with Rust 1.86.0
toolchains_llvm 1.6.0 does not support riscv64 as a host architecture.
Patch three files to add linux-riscv64:
- toolchain/internal/common.bzl: add (linux, riscv64) to SUPPORTED_TARGETS
- toolchain/internal/configure.bzl: add riscv64-unknown-linux-gnu target
  system name mapping
- toolchain/cc_toolchain_config.bzl: add linux-riscv64 toolchain config
  entry mirroring linux-aarch64

Also configure llvm.MODULE.bazel to use the system-installed clang-19
at /usr/lib/llvm-19 as the toolchain root for riscv64, since no
prebuilt LLVM distribution exists for riscv64 Linux host.
@jemoreira jemoreira requested a review from Databean April 9, 2026 22:45
@monkey-jsun
Copy link
Copy Markdown
Author

Note: this PR depends on #2363 (rules_rust riscv64 support).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant