xksa
xksa

Reputation: 127

Cross-compile V8 with RISC-V toolchain

Does anyone know how to cross-compile V8 for RISC-V? I would like to run V8 on the RISC-V qemu.

I've already built V8 for x64 and installed RISC-V toolchains.

There are some documents for cross-compiling for ARM. However, those for RISC-V don't seem to be enough or exist. Any kind of help will be appreciated!

Upvotes: 0

Views: 246

Answers (1)

jmrk
jmrk

Reputation: 40491

All cross-compilation works the same, using the target_arch GN arg. Specifically, use gn args out/riscv (or wherever you want to place your build output) to specify (at least):

target_cpu = "riscv64"
v8_target_cpu = "riscv64"

You may need use_clang = false to make it pick up your system-installed toolchain; I haven't tried it. Of course you can set additional build args to taste, e.g. is_debug = false for Release-mode performance.

Upvotes: 1

Related Questions