From 8af9d45d5e09a04832cc9b2e1df993fd1ce49d02 Mon Sep 17 00:00:00 2001 From: Michael Zhu Date: Fri, 9 Aug 2024 11:18:23 -0400 Subject: [PATCH] feat: enable m extension (#5) (#8) * feat: add m extension * chore: rename target Co-authored-by: Noah Citron --- Makefile | 6 +++--- compiler/rustc_target/src/spec/mod.rs | 2 +- ...riscv32i_jolt_zkvm_elf.rs => riscv32im_jolt_zkvm_elf.rs} | 1 + config.toml | 2 +- src/tools/build-manifest/src/main.rs | 2 +- 5 files changed, 7 insertions(+), 6 deletions(-) rename compiler/rustc_target/src/spec/targets/{riscv32i_jolt_zkvm_elf.rs => riscv32im_jolt_zkvm_elf.rs} (97%) diff --git a/Makefile b/Makefile index 88f0b3a560d9..d262975f836d 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,9 @@ build-toolchain: - GITHUB_ACTIONS=false CARGO_TARGET_RISCV32I_JOLT_ZKVM_ELF_RUSTFLAGS="-Cpasses=lower-atomic" ./x build - GITHUB_ACTIONS=false CARGO_TARGET_RISCV32I_JOLT_ZKVM_ELF_RUSTFLAGS="-Cpasses=lower-atomic" ./x build --stage 2 + GITHUB_ACTIONS=false CARGO_TARGET_RISCV32IM_JOLT_ZKVM_ELF_RUSTFLAGS="-Cpasses=lower-atomic" ./x build + GITHUB_ACTIONS=false CARGO_TARGET_RISCV32IM_JOLT_ZKVM_ELF_RUSTFLAGS="-Cpasses=lower-atomic" ./x build --stage 2 install-toolchain: - rustup toolchain link riscv32i-jolt-zkvm-elf build/host/stage2 + rustup toolchain link riscv32im-jolt-zkvm-elf build/host/stage2 build-install-toolchain: make build-toolchain diff --git a/compiler/rustc_target/src/spec/mod.rs b/compiler/rustc_target/src/spec/mod.rs index fbf998d6f5b1..68727d8b7718 100644 --- a/compiler/rustc_target/src/spec/mod.rs +++ b/compiler/rustc_target/src/spec/mod.rs @@ -1751,7 +1751,7 @@ supported_targets! { ("riscv32i-unknown-none-elf", riscv32i_unknown_none_elf), ("riscv32im-risc0-zkvm-elf", riscv32im_risc0_zkvm_elf), - ("riscv32i-jolt-zkvm-elf", riscv32i_jolt_zkvm_elf), + ("riscv32im-jolt-zkvm-elf", riscv32im_jolt_zkvm_elf), ("riscv32im-unknown-none-elf", riscv32im_unknown_none_elf), ("riscv32ima-unknown-none-elf", riscv32ima_unknown_none_elf), ("riscv32imc-unknown-none-elf", riscv32imc_unknown_none_elf), diff --git a/compiler/rustc_target/src/spec/targets/riscv32i_jolt_zkvm_elf.rs b/compiler/rustc_target/src/spec/targets/riscv32im_jolt_zkvm_elf.rs similarity index 97% rename from compiler/rustc_target/src/spec/targets/riscv32i_jolt_zkvm_elf.rs rename to compiler/rustc_target/src/spec/targets/riscv32im_jolt_zkvm_elf.rs index 783b9a744a10..2b1c3b455665 100644 --- a/compiler/rustc_target/src/spec/targets/riscv32i_jolt_zkvm_elf.rs +++ b/compiler/rustc_target/src/spec/targets/riscv32im_jolt_zkvm_elf.rs @@ -21,6 +21,7 @@ pub fn target() -> Target { linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes), linker: Some("rust-lld".into()), cpu: "generic-rv32".into(), + features: "+m".into(), max_atomic_width: Some(64), atomic_cas: true, executables: true, diff --git a/config.toml b/config.toml index c5f472d0f2b9..4f36f169c8a1 100644 --- a/config.toml +++ b/config.toml @@ -1,7 +1,7 @@ change-id = 125181 [build] -target = ["riscv32i-jolt-zkvm-elf"] +target = ["riscv32im-jolt-zkvm-elf"] extended = true tools = ["cargo", "cargo-clippy", "clippy", "rustfmt"] configure-args = [] diff --git a/src/tools/build-manifest/src/main.rs b/src/tools/build-manifest/src/main.rs index c79c4a5dc3c5..ca08f4954f0b 100644 --- a/src/tools/build-manifest/src/main.rs +++ b/src/tools/build-manifest/src/main.rs @@ -131,7 +131,7 @@ static TARGETS: &[&str] = &[ "powerpc64le-unknown-linux-gnu", "riscv32i-unknown-none-elf", "riscv32im-risc0-zkvm-elf", - "riscv32i-jolt-zkvm-elf", + "riscv32im-jolt-zkvm-elf", "riscv32im-unknown-none-elf", "riscv32ima-unknown-none-elf", "riscv32imc-unknown-none-elf",