Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Cross.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ pre-build = ["apt-get install -y cmake clang-5.0"]
[target.aarch64-unknown-linux-gnu]
pre-build = ["apt-get install -y cmake clang-5.0"]

[target.riscv64gc-unknown-linux-gnu]
pre-build = ["apt-get install -y cmake clang"]
# Use the most recent Cross image for RISCV because the stable 0.2.5 image doesn't work
image = "ghcr.io/cross-rs/riscv64gc-unknown-linux-gnu:main"

# Allow setting page size limits for jemalloc at build time:
# For certain architectures (like aarch64), we must compile
# jemalloc with support for large page sizes, otherwise the host's
Expand Down
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ X86_64_TAG = "x86_64-unknown-linux-gnu"
BUILD_PATH_X86_64 = "target/$(X86_64_TAG)/release"
AARCH64_TAG = "aarch64-unknown-linux-gnu"
BUILD_PATH_AARCH64 = "target/$(AARCH64_TAG)/release"
RISCV64_TAG = "riscv64gc-unknown-linux-gnu"
BUILD_PATH_RISCV64 = "target/$(RISCV64_TAG)/release"

PINNED_NIGHTLY ?= nightly

Expand Down Expand Up @@ -67,6 +69,8 @@ build-aarch64:
# pages, which are commonly used by aarch64 systems.
# See: https://github.com/sigp/lighthouse/issues/5244
JEMALLOC_SYS_WITH_LG_PAGE=16 cross build --bin lighthouse --target aarch64-unknown-linux-gnu --features "portable,$(CROSS_FEATURES)" --profile "$(CROSS_PROFILE)" --locked
build-riscv64:
cross build --bin lighthouse --target riscv64gc-unknown-linux-gnu --features "portable,$(CROSS_FEATURES)" --profile "$(CROSS_PROFILE)" --locked

build-lcli-x86_64:
cross build --bin lcli --target x86_64-unknown-linux-gnu --features "portable" --profile "$(CROSS_PROFILE)" --locked
Expand All @@ -75,6 +79,8 @@ build-lcli-aarch64:
# pages, which are commonly used by aarch64 systems.
# See: https://github.com/sigp/lighthouse/issues/5244
JEMALLOC_SYS_WITH_LG_PAGE=16 cross build --bin lcli --target aarch64-unknown-linux-gnu --features "portable" --profile "$(CROSS_PROFILE)" --locked
build-lcli-riscv64:
cross build --bin lcli --target riscv64gc-unknown-linux-gnu --features "portable" --profile "$(CROSS_PROFILE)" --locked

# Create a `.tar.gz` containing a binary for a specific target.
define tarball_release_binary
Expand All @@ -95,6 +101,9 @@ build-release-tarballs:
$(call tarball_release_binary,$(BUILD_PATH_X86_64),$(X86_64_TAG),"")
$(MAKE) build-aarch64
$(call tarball_release_binary,$(BUILD_PATH_AARCH64),$(AARCH64_TAG),"")
$(MAKE) build-riscv64
$(call tarball_release_binary,$(BUILD_PATH_RISCV64),$(RISCV64_TAG),"")


# Runs the full workspace tests in **release**, without downloading any additional
# test vectors.
Expand Down
3 changes: 2 additions & 1 deletion book/src/installation_cross_compiling.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ project.
The `Makefile` in the project contains two targets for cross-compiling:

- `build-x86_64`: builds an optimized version for x86_64 processors (suitable for most users).
- `build-aarch64`: builds an optimized version for 64-bit ARM processors (suitable for Raspberry Pi 4).
- `build-aarch64`: builds an optimized version for 64-bit ARM processors (suitable for Raspberry Pi 4/5).
- `build-riscv64`: builds an optimized version for 64-bit RISC-V processors.

### Example

Expand Down
Loading