diff --git a/build/src/command/local.rs b/build/src/command/local.rs index e2fd3522..e46c7960 100644 --- a/build/src/command/local.rs +++ b/build/src/command/local.rs @@ -27,9 +27,7 @@ pub(crate) fn create_local_command( // toolchain. command .current_dir(canonicalized_program_dir) - .env("RUSTUP_TOOLCHAIN", "nightly-2023-04-06") .env("CARGO_ENCODED_RUSTFLAGS", get_rust_compiler_flags()) - .env_remove("RUSTC") .env( "CARGO_TARGET_DIR", program_metadata.target_directory.join(HELPER_TARGET_SUBDIR), diff --git a/build/src/command/utils.rs b/build/src/command/utils.rs index 900fb6c5..db92fecd 100644 --- a/build/src/command/utils.rs +++ b/build/src/command/utils.rs @@ -45,13 +45,17 @@ pub(crate) fn get_program_build_args(args: &BuildArgs) -> Vec { pub(crate) fn get_rust_compiler_flags() -> String { let rust_flags = [ "-C".to_string(), - "target-cpu=mips32".to_string(), - "--cfg".to_string(), - "target_os=\"zkvm\"".to_string(), + "target-cpu=mips2".to_string(), "-C".to_string(), "target-feature=+crt-static".to_string(), "-C".to_string(), + "link-arg=-nostdlib".to_string(), + "-C".to_string(), "link-arg=-g".to_string(), + //"-C".to_string(), + //"link-arg=-nostartfiles".to_string(), + "-C".to_string(), + "link-arg=--entry=main".to_string(), ]; rust_flags.join("\x1f") } diff --git a/build/src/lib.rs b/build/src/lib.rs index dda41ce2..55a4a061 100644 --- a/build/src/lib.rs +++ b/build/src/lib.rs @@ -6,8 +6,8 @@ pub use build::execute_build_program; use clap::Parser; -pub const BUILD_TARGET: &str = "mips-unknown-linux-musl"; -//pub const DEFAULT_TAG: &str = "v1.0.0"; +pub const BUILD_TARGET: &str = "mips-zkm-zkvm-elf"; +// const DEFAULT_TAG: &str = "v1.0.0"; pub const DEFAULT_OUTPUT_DIR: &str = "elf"; pub const HELPER_TARGET_SUBDIR: &str = "elf-compilation"; diff --git a/prover/examples/revme/host/src/main.rs b/prover/examples/revme/host/src/main.rs index cc3af0e9..6e29d717 100644 --- a/prover/examples/revme/host/src/main.rs +++ b/prover/examples/revme/host/src/main.rs @@ -215,7 +215,7 @@ fn prove_multi_seg_common( result } -const ELF_PATH: &str = "../guest/elf/mips-unknown-linux-musl"; +const ELF_PATH: &str = "../guest/elf/mips-zkm-zkvm-elf"; fn prove_revm() { // 1. split ELF into segs diff --git a/prover/examples/sha2-precompile/host/src/main.rs b/prover/examples/sha2-precompile/host/src/main.rs index 1b0c2a93..dd9adc59 100644 --- a/prover/examples/sha2-precompile/host/src/main.rs +++ b/prover/examples/sha2-precompile/host/src/main.rs @@ -20,7 +20,7 @@ const D: usize = 2; type C = PoseidonGoldilocksConfig; type F = >::F; -const ELF_PATH: &str = "../guest/elf/mips-unknown-linux-musl"; +const ELF_PATH: &str = "../guest/elf/mips-zkm-zkvm-elf"; fn u32_array_to_u8_vec(u32_array: &[u32; 8]) -> Vec { let mut u8_vec = Vec::with_capacity(u32_array.len() * 4); diff --git a/prover/examples/sha2-rust/host/src/main.rs b/prover/examples/sha2-rust/host/src/main.rs index 81f71caf..bae10e1f 100644 --- a/prover/examples/sha2-rust/host/src/main.rs +++ b/prover/examples/sha2-rust/host/src/main.rs @@ -214,7 +214,7 @@ fn prove_multi_seg_common( result } -const ELF_PATH: &str = "../guest/elf/mips-unknown-linux-musl"; +const ELF_PATH: &str = "../guest/elf/mips-zkm-zkvm-elf"; fn prove_sha2_rust() { // 1. split ELF into segs