Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[doc] How to cross compile v8 for riscv32 architecture on x86_64 linux #694

Open
VitalyAnkh opened this issue Jun 28, 2022 · 0 comments
Open

Comments

@VitalyAnkh
Copy link
Collaborator

VitalyAnkh commented Jun 28, 2022

Prerequisite: you are on a up-to-date x86_64 linux environment.

  1. download riscv32 gnu gcc toolchain: https://github.com/riscv-collab/riscv-gnu-toolchain/releases/download/2022.06.10/riscv32-glibc-ubuntu-20.04-nightly-2022.06.10-nightly.tar.gz, then extract them to /opt/riscv/. Your /opt/riscv should look like this (ignore the riscv64-unknow-linux-gnu entry, it's present because I also installed the gnu gcc riscv64 toolchain):
    image
  2. cd to your v8 directory, then cd build. The build directory contains toolchain configurations for building v8. Download this patch from @luyahan: https://gist.github.com/VitalyAnkh/6e064ab3dcdf1be1032111bc8fa61acb. Then git apply <path-to-the-patch>.
  3. Edit v8/build/config/riscv.gni, assign values to riscv_gcc_toolchain_path and riscv_sysroot, like this
    image
  4. cd to your v8 directory, run gn gen out/riscv32.native.debug --args='is_component_build=false is_debug=true target_cpu="riscv32" v8_target_cpu="riscv32" use_goma=false goma_dir="None" treat_warnings_as_errors=false is_clang=false', then ninja -C out/riscv32.native.debug -j12.

Enjoy hacking!

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

No branches or pull requests

1 participant