From 4882d8eeb0dd63ffb8365bf27385760c4edff311 Mon Sep 17 00:00:00 2001 From: Toru Nayuki Date: Wed, 16 Feb 2022 07:00:44 +0000 Subject: [PATCH 01/17] Basic changes for RISC-V support --- Makefile | 15 +++++++++++++-- lib/vm/src/trap/traphandlers.rs | 2 +- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 557ea873a19..24b1ae7c2cc 100644 --- a/Makefile +++ b/Makefile @@ -43,6 +43,7 @@ IS_LINUX := 0 IS_WINDOWS := 0 IS_AMD64 := 0 IS_AARCH64 := 0 +IS_RISCV64 := 0 # Test Windows apart because it doesn't support `uname -s`. ifeq ($(OS), Windows_NT) @@ -71,6 +72,8 @@ else IS_AMD64 := 1 else ifneq (, $(filter $(uname), aarch64 arm64)) IS_AARCH64 := 1 + else ifneq (, $(filter $(uname), riscv64)) + IS_RISCV64 := 1 else # We use spaces instead of tabs to indent `$(error)` # otherwise it's considered as a command outside a @@ -107,8 +110,16 @@ compilers := # If the user didn't disable the Cranelift compiler… ifneq ($(ENABLE_CRANELIFT), 0) - # … then it can always be enabled. - compilers += cranelift + # … then maybe the user forced to enable the Cranelift compiler. + ifeq ($(ENABLE_CRANELIFT), 1) + compilers += cranelift + # … otherwise, we try to check whether Cranelift works on this host. + else ifneq ($(IS_RISCV64), 1) + compilers += cranelift + endif +endif + +ifneq (, $(findstring cranelift,$(compilers))) ENABLE_CRANELIFT := 1 endif diff --git a/lib/vm/src/trap/traphandlers.rs b/lib/vm/src/trap/traphandlers.rs index fc8af76fcfc..ce892a596b5 100644 --- a/lib/vm/src/trap/traphandlers.rs +++ b/lib/vm/src/trap/traphandlers.rs @@ -1053,4 +1053,4 @@ pub fn lazy_per_thread_init() -> Result<(), Trap> { } } } -} +} \ No newline at end of file From 6d280a47ddba25dc141c03e72527cfcb1ff49bac Mon Sep 17 00:00:00 2001 From: Toru Nayuki Date: Wed, 16 Feb 2022 07:09:12 +0000 Subject: [PATCH 02/17] RISC-V in compiler LLVM --- Cargo.lock | 9 ++--- lib/compiler-llvm/Cargo.toml | 5 +-- lib/compiler-llvm/src/config.rs | 58 +++++++++++++++++++++++++++++---- lib/object/src/module.rs | 19 +++++++---- 4 files changed, 70 insertions(+), 21 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 58f63d68a0f..9e434b48790 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1263,9 +1263,8 @@ dependencies = [ [[package]] name = "inkwell" -version = "0.1.0-beta.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2223d0eba0ae6d40a3e4680c6a3209143471e1f38b41746ea309aa36dde9f90b" +version = "0.1.0" +source = "git+https://github.com/TheDan64/inkwell.git?rev=a24642d#a24642d23255d07fe8ef3938d01a981899ee5d2c" dependencies = [ "either", "inkwell_internals", @@ -1273,14 +1272,12 @@ dependencies = [ "llvm-sys", "once_cell", "parking_lot", - "regex", ] [[package]] name = "inkwell_internals" version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c7090af3d300424caa81976b8c97bca41cd70e861272c072e188ae082fb49f9" +source = "git+https://github.com/TheDan64/inkwell.git?rev=a24642d#a24642d23255d07fe8ef3938d01a981899ee5d2c" dependencies = [ "proc-macro2", "quote", diff --git a/lib/compiler-llvm/Cargo.toml b/lib/compiler-llvm/Cargo.toml index bde7c30a03b..423fca6bd71 100644 --- a/lib/compiler-llvm/Cargo.toml +++ b/lib/compiler-llvm/Cargo.toml @@ -27,9 +27,10 @@ rayon = "1.5" [dependencies.inkwell] package = "inkwell" -version = "0.1.0-beta.4" +git = "https://github.com/TheDan64/inkwell.git" +rev = "a24642d" default-features = false -features = ["llvm12-0", "target-x86", "target-aarch64"] +features = ["llvm12-0", "target-x86", "target-aarch64", "target-riscv"] [build-dependencies] cc = "1.0" diff --git a/lib/compiler-llvm/src/config.rs b/lib/compiler-llvm/src/config.rs index bb81a85938a..d0d5c231eee 100644 --- a/lib/compiler-llvm/src/config.rs +++ b/lib/compiler-llvm/src/config.rs @@ -97,6 +97,13 @@ impl LLVM { } fn target_triple(&self, target: &Target) -> TargetTriple { + let architecture = if target.triple().architecture + == Architecture::Riscv64(target_lexicon::Riscv64Architecture::Riscv64gc) + { + target_lexicon::Architecture::Riscv64(target_lexicon::Riscv64Architecture::Riscv64) + } else { + target.triple().architecture + }; // Hack: we're using is_pic to determine whether this is a native // build or not. let operating_system = if target.triple().operating_system @@ -123,7 +130,7 @@ impl LLVM { target_lexicon::BinaryFormat::Elf }; let triple = Triple { - architecture: target.triple().architecture, + architecture: architecture, vendor: target.triple().vendor.clone(), operating_system, environment: target.triple().environment, @@ -156,6 +163,14 @@ impl LLVM { info: true, machine_code: true, }), + Architecture::Riscv64(_) => InkwellTarget::initialize_riscv(&InitializationConfig { + asm_parser: true, + asm_printer: true, + base: true, + disassembler: true, + info: true, + machine_code: true, + }), // Architecture::Arm(_) => InkwellTarget::initialize_arm(&InitializationConfig { // asm_parser: true, // asm_printer: true, @@ -177,16 +192,47 @@ impl LLVM { let target_triple = self.target_triple(target); let llvm_target = InkwellTarget::from_triple(&target_triple).unwrap(); - llvm_target + let llvm_target_machine = llvm_target .create_target_machine( &target_triple, - "generic", - &llvm_cpu_features, + match triple.architecture { + Architecture::Riscv64(_) => "generic-rv64", + _ => "generic", + }, + match triple.architecture { + Architecture::Riscv64(_) => "+m,+a,+c,+d,+f", + _ => &llvm_cpu_features, + }, self.opt_level, self.reloc_mode(), - self.code_model(), + match triple.architecture { + Architecture::Riscv64(_) => CodeModel::Medium, + _ => self.code_model(), + }, ) - .unwrap() + .unwrap(); + + if let Architecture::Riscv64(_) = triple.architecture { + // TODO: totally non-portable way to change ABI + unsafe { + pub struct MyTargetMachine { + pub target_machine: *const u8, + } + + let my_target_machine: MyTargetMachine = std::mem::transmute(llvm_target_machine); + + *((my_target_machine.target_machine as *mut u8).offset(0x410) as *mut u64) = 5; + std::ptr::copy_nonoverlapping( + "lp64d\0".as_ptr(), + (my_target_machine.target_machine as *mut u8).offset(0x418), + 6, + ); + + std::mem::transmute(my_target_machine) + } + } else { + llvm_target_machine + } } } diff --git a/lib/object/src/module.rs b/lib/object/src/module.rs index 40cb005af2c..a1e32d19bdb 100644 --- a/lib/object/src/module.rs +++ b/lib/object/src/module.rs @@ -3,8 +3,8 @@ use object::write::{ Object, Relocation, StandardSection, StandardSegment, Symbol as ObjSymbol, SymbolSection, }; use object::{ - elf, macho, RelocationEncoding, RelocationKind, SectionKind, SymbolFlags, SymbolKind, - SymbolScope, + elf, macho, FileFlags, RelocationEncoding, RelocationKind, SectionKind, SymbolFlags, + SymbolKind, SymbolScope, }; use wasmer_types::entity::PrimaryMap; use wasmer_types::LocalFunctionIndex; @@ -46,6 +46,7 @@ pub fn get_object_for_target(triple: &Triple) -> Result { let obj_architecture = match triple.architecture { Architecture::X86_64 => object::Architecture::X86_64, Architecture::Aarch64(_) => object::Architecture::Aarch64, + Architecture::Riscv64(_) => object::Architecture::Riscv64, architecture => { return Err(ObjectError::UnsupportedArchitecture(format!( "{}", @@ -61,11 +62,15 @@ pub fn get_object_for_target(triple: &Triple) -> Result { Endianness::Big => object::Endianness::Big, }; - Ok(Object::new( - obj_binary_format, - obj_architecture, - obj_endianness, - )) + let mut object = Object::new(obj_binary_format, obj_architecture, obj_endianness); + + if let Architecture::Riscv64(_) = triple.architecture { + object.flags = FileFlags::Elf { + e_flags: elf::EF_RISCV_FLOAT_ABI_DOUBLE, + }; + } + + Ok(object) } /// Write data into an existing object. From 2656c70135fcab9b81bfbf52091a0f8628461ecf Mon Sep 17 00:00:00 2001 From: Toru Nayuki Date: Wed, 16 Feb 2022 07:14:36 +0000 Subject: [PATCH 03/17] RISC-V support in dylib engine --- Makefile | 2 ++ lib/compiler-llvm/src/object_file.rs | 5 +++++ lib/types/src/compilation/relocation.rs | 8 ++++---- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 24b1ae7c2cc..3416f41a121 100644 --- a/Makefile +++ b/Makefile @@ -231,6 +231,8 @@ ifeq ($(ENABLE_LLVM), 1) compilers_engines += llvm-universal else ifeq ($(IS_AARCH64), 1) compilers_engines += llvm-universal + else ifeq ($(IS_RISCV64), 1) + compilers_engines += llvm-universal endif endif endif diff --git a/lib/compiler-llvm/src/object_file.rs b/lib/compiler-llvm/src/object_file.rs index 2807c36338e..1ad0b0a886d 100644 --- a/lib/compiler-llvm/src/object_file.rs +++ b/lib/compiler-llvm/src/object_file.rs @@ -192,6 +192,11 @@ where object::RelocationKind::Elf(object::elf::R_AARCH64_MOVW_UABS_G3), 0, ) => RelocationKind::Arm64Movw3, + ( + object::Architecture::Riscv64, + object::RelocationKind::Elf(object::elf::R_RISCV_CALL_PLT), + 0, + ) => RelocationKind::RiscvCall, _ => { return Err(CompileError::Codegen(format!( "unknown relocation {:?}", diff --git a/lib/types/src/compilation/relocation.rs b/lib/types/src/compilation/relocation.rs index 4bdb0184d3e..84c63c2d8c8 100644 --- a/lib/types/src/compilation/relocation.rs +++ b/lib/types/src/compilation/relocation.rs @@ -50,8 +50,8 @@ pub enum RelocationKind { Arm64Movw2, /// Arm64 movk/z part 3 Arm64Movw3, - // /// RISC-V call target - // RiscvCall, + /// RISC-V call target + RiscvCall, /// Elf x86_64 32 bit signed PC relative offset to two GOT entries for GD symbol. ElfX86_64TlsGd, // /// Mach-O x86_64 32 bit signed PC relative offset to a `__thread_vars` entry. @@ -70,7 +70,7 @@ impl fmt::Display for RelocationKind { Self::X86CallPCRel4 => write!(f, "CallPCRel4"), Self::X86CallPLTRel4 => write!(f, "CallPLTRel4"), Self::X86GOTPCRel4 => write!(f, "GOTPCRel4"), - Self::Arm32Call | Self::Arm64Call => write!(f, "Call"), + Self::Arm32Call | Self::Arm64Call | Self::RiscvCall => write!(f, "Call"), Self::Arm64Movw0 => write!(f, "Arm64MovwG0"), Self::Arm64Movw1 => write!(f, "Arm64MovwG1"), Self::Arm64Movw2 => write!(f, "Arm64MovwG2"), @@ -153,7 +153,7 @@ impl Relocation { .wrapping_add(reloc_addend as u32); (reloc_address, reloc_delta_u32 as u64) } - RelocationKind::Arm64Call => { + RelocationKind::Arm64Call | RelocationKind::RiscvCall => { let reloc_address = start + self.offset as usize; let reloc_addend = self.addend as isize; let reloc_delta_u32 = target_func_address From 0ccc9ce46c85948fc60c6b2172cc31a9b6dcdc71 Mon Sep 17 00:00:00 2001 From: Toru Nayuki Date: Tue, 15 Feb 2022 10:22:24 +0000 Subject: [PATCH 04/17] RISC-V support in universal engine --- lib/compiler-llvm/src/object_file.rs | 25 ++++++++++++++- .../src/artifact_builders/trampoline.rs | 21 ++++++++++++ lib/compiler/src/engine/link.rs | 32 +++++++++++++++++++ lib/types/src/compilation/relocation.rs | 13 ++++++-- lib/vm/src/trap/traphandlers.rs | 2 +- 5 files changed, 89 insertions(+), 4 deletions(-) diff --git a/lib/compiler-llvm/src/object_file.rs b/lib/compiler-llvm/src/object_file.rs index 1ad0b0a886d..eb182f34d6c 100644 --- a/lib/compiler-llvm/src/object_file.rs +++ b/lib/compiler-llvm/src/object_file.rs @@ -197,6 +197,16 @@ where object::RelocationKind::Elf(object::elf::R_RISCV_CALL_PLT), 0, ) => RelocationKind::RiscvCall, + ( + object::Architecture::Riscv64, + object::RelocationKind::Elf(object::elf::R_RISCV_PCREL_HI20), + 0, + ) => RelocationKind::RiscvPCRelHi20, + ( + object::Architecture::Riscv64, + object::RelocationKind::Elf(object::elf::R_RISCV_PCREL_LO12_I), + 0, + ) => RelocationKind::RiscvPCRelLo12I, _ => { return Err(CompileError::Codegen(format!( "unknown relocation {:?}", @@ -204,7 +214,7 @@ where ))); } }; - let addend = reloc.addend(); + let mut addend = reloc.addend(); let target = match reloc.target() { object::read::RelocationTarget::Symbol(index) => { let symbol = elf.symbol_by_index(index).map_err(map_object_err)?; @@ -235,6 +245,19 @@ where symbol_name_to_relocation_target(symbol_name)? { reloc_target + } else if let object::SymbolSection::Section(section_index) = symbol.section() { + // TODO: Encode symbol address into addend, I think this is a bit hacky. + addend = addend.wrapping_add(symbol.address() as i64); + + if section_index == root_section_index { + root_section_reloc_target + } else { + if visited.insert(section_index) { + worklist.push(section_index); + } + + elf_section_to_target(section_index) + } } else { return Err(CompileError::Codegen(format!( "relocation targets unknown symbol {:?}", diff --git a/lib/compiler/src/artifact_builders/trampoline.rs b/lib/compiler/src/artifact_builders/trampoline.rs index 5a7de39c118..b3b49733df7 100644 --- a/lib/compiler/src/artifact_builders/trampoline.rs +++ b/lib/compiler/src/artifact_builders/trampoline.rs @@ -25,6 +25,17 @@ const X86_64_TRAMPOLINE: [u8; 16] = [ 0xff, 0x25, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ]; +// can it be shorter than this? +// 4 padding bytes are used to preserve alignment. +// AUIPC t1,0 17 03 00 00 +// LD t1, 16(t1) 03 33 03 01 +// JR t1 67 00 03 00 [00 00 00 00] +// JMPADDR 00 00 00 00 00 00 00 00 +const RISCV64_TRAMPOLINE: [u8; 24] = [ + 0x17, 0x03, 0x00, 0x00, 0x03, 0x33, 0x03, 0x01, 0x67, 0x00, 0x03, 0x00, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, +]; + fn make_trampoline( target: &Target, libcall: LibCall, @@ -50,6 +61,15 @@ fn make_trampoline( addend: 0, }); } + Architecture::Riscv64(_) => { + code.extend(&RISCV64_TRAMPOLINE); + relocations.push(Relocation { + kind: RelocationKind::Abs8, + reloc_target: RelocationTarget::LibCall(libcall), + offset: code.len() as u32 - 8, + addend: 0, + }); + } arch => panic!("Unsupported architecture: {}", arch), }; } @@ -59,6 +79,7 @@ pub fn libcall_trampoline_len(target: &Target) -> usize { match target.triple().architecture { Architecture::Aarch64(_) => AARCH64_TRAMPOLINE.len(), Architecture::X86_64 => X86_64_TRAMPOLINE.len(), + Architecture::Riscv64(_) => RISCV64_TRAMPOLINE.len(), arch => panic!("Unsupported architecture: {}", arch), } } diff --git a/lib/compiler/src/engine/link.rs b/lib/compiler/src/engine/link.rs index 153d581b446..2ddf1173759 100644 --- a/lib/compiler/src/engine/link.rs +++ b/lib/compiler/src/engine/link.rs @@ -2,6 +2,7 @@ use crate::get_libcall_trampoline; use crate::FunctionExtent; +use std::collections::HashMap; use std::ptr::{read_unaligned, write_unaligned}; use wasmer_types::entity::PrimaryMap; use wasmer_types::{LocalFunctionIndex, ModuleInfo}; @@ -16,6 +17,7 @@ fn apply_relocation( allocated_sections: &PrimaryMap, libcall_trampolines: SectionIndex, libcall_trampoline_len: usize, + riscv_pcrel_hi20s: &mut HashMap, ) { let target_func_address: usize = match r.reloc_target { RelocationTarget::LocalFunc(index) => *allocated_functions[index].ptr as usize, @@ -93,6 +95,32 @@ fn apply_relocation( | read_unaligned(reloc_address as *mut u32); write_unaligned(reloc_address as *mut u32, reloc_delta); }, + RelocationKind::RiscvPCRelHi20 => unsafe { + let (reloc_address, reloc_delta) = r.for_address(body, target_func_address as u64); + + // save for later reference with RiscvPCRelLo12I + riscv_pcrel_hi20s.insert(reloc_address, reloc_delta as u32); + + let reloc_delta = ((reloc_delta.wrapping_add(0x800) & 0xfffff000) as u32) + | read_unaligned(reloc_address as *mut u32); + write_unaligned(reloc_address as *mut u32, reloc_delta); + }, + RelocationKind::RiscvPCRelLo12I => unsafe { + let (reloc_address, reloc_abs) = r.for_address(body, target_func_address as u64); + let reloc_delta = ((riscv_pcrel_hi20s.get(&(reloc_abs as usize)).expect( + "R_RISCV_PCREL_LO12_I relocation target must be a symbol with R_RISCV_PCREL_HI20", + ) & 0xfff) + << 20) + | read_unaligned(reloc_address as *mut u32); + write_unaligned(reloc_address as *mut u32, reloc_delta); + }, + RelocationKind::RiscvCall => unsafe { + let (reloc_address, reloc_delta) = r.for_address(body, target_func_address as u64); + let reloc_delta = ((reloc_delta & 0xfff) << 52) + | (reloc_delta.wrapping_add(0x800) & 0xfffff000) + | read_unaligned(reloc_address as *mut u64); + write_unaligned(reloc_address as *mut u64, reloc_delta); + }, kind => panic!( "Relocation kind unsupported in the current architecture {}", kind @@ -111,6 +139,8 @@ pub fn link_module( libcall_trampolines: SectionIndex, trampoline_len: usize, ) { + let mut riscv_pcrel_hi20s: HashMap = HashMap::new(); + for (i, section_relocs) in section_relocations.iter() { let body = *allocated_sections[i] as usize; for r in section_relocs { @@ -121,6 +151,7 @@ pub fn link_module( allocated_sections, libcall_trampolines, trampoline_len, + &mut riscv_pcrel_hi20s, ); } } @@ -134,6 +165,7 @@ pub fn link_module( allocated_sections, libcall_trampolines, trampoline_len, + &mut riscv_pcrel_hi20s, ); } } diff --git a/lib/types/src/compilation/relocation.rs b/lib/types/src/compilation/relocation.rs index 84c63c2d8c8..b1a18e42da0 100644 --- a/lib/types/src/compilation/relocation.rs +++ b/lib/types/src/compilation/relocation.rs @@ -50,6 +50,10 @@ pub enum RelocationKind { Arm64Movw2, /// Arm64 movk/z part 3 Arm64Movw3, + /// RISC-V PC-relative high 20bit + RiscvPCRelHi20, + /// RISC-V PC-relative low 12bit, I-type + RiscvPCRelLo12I, /// RISC-V call target RiscvCall, /// Elf x86_64 32 bit signed PC relative offset to two GOT entries for GD symbol. @@ -76,6 +80,8 @@ impl fmt::Display for RelocationKind { Self::Arm64Movw2 => write!(f, "Arm64MovwG2"), Self::Arm64Movw3 => write!(f, "Arm64MovwG3"), Self::ElfX86_64TlsGd => write!(f, "ElfX86_64TlsGd"), + Self::RiscvPCRelHi20 => write!(f, "RiscvPCRelHi20"), + Self::RiscvPCRelLo12I => write!(f, "RiscvPCRelLo12I"), // Self::MachOX86_64Tlv => write!(f, "MachOX86_64Tlv"), } } @@ -119,7 +125,8 @@ impl Relocation { | RelocationKind::Arm64Movw0 | RelocationKind::Arm64Movw1 | RelocationKind::Arm64Movw2 - | RelocationKind::Arm64Movw3 => { + | RelocationKind::Arm64Movw3 + | RelocationKind::RiscvPCRelLo12I => { let reloc_address = start + self.offset as usize; let reloc_addend = self.addend as isize; let reloc_abs = target_func_address @@ -153,7 +160,9 @@ impl Relocation { .wrapping_add(reloc_addend as u32); (reloc_address, reloc_delta_u32 as u64) } - RelocationKind::Arm64Call | RelocationKind::RiscvCall => { + RelocationKind::Arm64Call + | RelocationKind::RiscvCall + | RelocationKind::RiscvPCRelHi20 => { let reloc_address = start + self.offset as usize; let reloc_addend = self.addend as isize; let reloc_delta_u32 = target_func_address diff --git a/lib/vm/src/trap/traphandlers.rs b/lib/vm/src/trap/traphandlers.rs index ce892a596b5..fc8af76fcfc 100644 --- a/lib/vm/src/trap/traphandlers.rs +++ b/lib/vm/src/trap/traphandlers.rs @@ -1053,4 +1053,4 @@ pub fn lazy_per_thread_init() -> Result<(), Trap> { } } } -} \ No newline at end of file +} From 22944a16125f1f7e761dc9c9849dfd6339467573 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Thu, 20 Oct 2022 15:34:22 +0200 Subject: [PATCH 05/17] Various small fixes --- deny.toml | 4 ++-- lib/compiler-llvm/src/config.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/deny.toml b/deny.toml index 5f87fed14c2..0358e6a9259 100644 --- a/deny.toml +++ b/deny.toml @@ -205,9 +205,9 @@ allow-registry = ["https://github.com/rust-lang/crates.io-index"] # List of URLs for allowed Git repositories allow-git = [] -#[sources.allow-org] +[sources.allow-org] # 1 or more github.com organizations to allow git sources for -#github = [""] +github = ["TheDan64"] # 1 or more gitlab.com organizations to allow git sources for #gitlab = [""] # 1 or more bitbucket.org organizations to allow git sources for diff --git a/lib/compiler-llvm/src/config.rs b/lib/compiler-llvm/src/config.rs index d0d5c231eee..ee12cc0133b 100644 --- a/lib/compiler-llvm/src/config.rs +++ b/lib/compiler-llvm/src/config.rs @@ -130,7 +130,7 @@ impl LLVM { target_lexicon::BinaryFormat::Elf }; let triple = Triple { - architecture: architecture, + architecture, vendor: target.triple().vendor.clone(), operating_system, environment: target.triple().environment, From f026a79b5ecf9b641c3a2edead3f7e03a8e5fe49 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Fri, 17 Mar 2023 12:56:07 +0000 Subject: [PATCH 06/17] [RISCV] LLVM-riscv working, with some ignored tests to be worked on later --- Cargo.lock | 257 +++++++++--------- Makefile | 13 +- lib/cli/Cargo.toml | 10 +- lib/registry/Cargo.toml | 7 +- lib/wasi/Cargo.toml | 8 +- rust-toolchain | 2 +- tests/ignores.txt | 20 ++ tests/lib/compiler-test-derive/src/ignores.rs | 2 +- 8 files changed, 180 insertions(+), 139 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b36842a027e..89ddbfa6f12 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -69,9 +69,9 @@ checksum = "224afbd727c3d6e4b90103ece64b8d1b67fbb1973b1046c2281eed3f3803f800" [[package]] name = "arbitrary" -version = "1.2.3" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e90af4de65aa7b293ef2d09daff88501eb254f58edde2e1ac02c82d873eadad" +checksum = "e2d098ff73c1ca148721f37baad5ea6a465a13f9573aba8641fbbbae8164a54e" dependencies = [ "derive_arbitrary", ] @@ -224,9 +224,9 @@ dependencies = [ [[package]] name = "block-buffer" -version = "0.10.3" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" dependencies = [ "generic-array", ] @@ -308,9 +308,9 @@ checksum = "38fcc2979eff34a4b84e1cf9a1e3da42a7d44b3b690a40cdcb23e3d556cfb2e5" [[package]] name = "camino" -version = "1.1.3" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6031a462f977dd38968b6f23378356512feeace69cef817e1a4475108093cec3" +checksum = "c530edf18f37068ac2d977409ed5cd50d53d73bc653c7647b48eb78976ac9ae2" dependencies = [ "serde", ] @@ -332,7 +332,7 @@ checksum = "08a1ec454bc3eead8719cb56e15dbbfecdbc14e4b3a3ae4936cc6e31f5fc0d07" dependencies = [ "camino", "cargo-platform", - "semver 1.0.16", + "semver 1.0.17", "serde", "serde_json", "thiserror", @@ -386,9 +386,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.23" +version = "0.4.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16b0a3d9ed01224b22057780a37bb8c5dbfe1be8ba48678e7bf57ec4b385411f" +checksum = "4e3c5919066adf22df73762e50cffcde3a758f2a848b113b586d1f86728b673b" dependencies = [ "iana-time-zone", "js-sys", @@ -400,9 +400,9 @@ dependencies = [ [[package]] name = "cipher" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1873270f8f7942c191139cb8a40fd228da6c3fd2fc376d7e92d47aa14aeb59e" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" dependencies = [ "crypto-common", "inout", @@ -576,9 +576,9 @@ checksum = "fbdcdcb6d86f71c5e97409ad45898af11cbc995b4ee8112d59095a28d376c935" [[package]] name = "constant_time_eq" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3ad85c1f65dc7b37604eb0e89748faf0b9653065f2a8ef69f96a687ec1e9279" +checksum = "13418e745008f7349ec7e449155f419a61b92b58a99cc3616942b926825ec76b" [[package]] name = "cooked-waker" @@ -824,9 +824,9 @@ dependencies = [ [[package]] name = "csv" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af91f40b7355f82b0a891f50e70399475945bb0b0da4f1700ce60761c9d3e359" +checksum = "0b015497079b9a9d69c02ad25de6c0a6edef051ea6360a327d0bd05802ef64ad" dependencies = [ "csv-core", "itoa", @@ -905,9 +905,9 @@ dependencies = [ [[package]] name = "darling" -version = "0.14.3" +version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0808e1bd8671fb44a113a14e13497557533369847788fa2ae912b6ebfce9fa8" +checksum = "7b750cb3417fd1b327431a470f388520309479ab0bf5e323505daf0290cd3850" dependencies = [ "darling_core", "darling_macro", @@ -915,9 +915,9 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.14.3" +version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "001d80444f28e193f30c2f293455da62dcf9a6b29918a4253152ae2b1de592cb" +checksum = "109c1ca6e6b7f82cc233a97004ea8ed7ca123a9af07a8230878fcfda9b158bf0" dependencies = [ "fnv", "ident_case", @@ -928,9 +928,9 @@ dependencies = [ [[package]] name = "darling_macro" -version = "0.14.3" +version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b36230598a2d5de7ec1c6f51f72d8a99a9208daff41de2084d06e3fd3ea56685" +checksum = "a4aab4dbc9f7611d8b55048a3a16d2d010c2c8334e46304b40ac1cc14bf3b48e" dependencies = [ "darling_core", "quote", @@ -950,9 +950,9 @@ dependencies = [ [[package]] name = "derive_arbitrary" -version = "1.2.3" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8beee4701e2e229e8098bbdecdca12449bc3e322f137d269182fa1291e20bd00" +checksum = "f3cdeb9ec472d588e539a818b2dee436825730da08ad0017c4b1a17676bdc8b7" dependencies = [ "proc-macro2", "quote", @@ -1302,9 +1302,9 @@ checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c" [[package]] name = "futures" -version = "0.3.26" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13e2792b0ff0340399d58445b88fd9770e3489eff258a4cbc1523418f12abf84" +checksum = "531ac96c6ff5fd7c62263c5e3c67a603af4fcaee2e1a0ae5565ba3a11e69e549" dependencies = [ "futures-channel", "futures-core", @@ -1317,9 +1317,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.26" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e5317663a9089767a1ec00a487df42e0ca174b61b4483213ac24448e4664df5" +checksum = "164713a5a0dcc3e7b4b1ed7d3b433cabc18025386f9339346e8daf15963cf7ac" dependencies = [ "futures-core", "futures-sink", @@ -1327,15 +1327,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.26" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec90ff4d0fe1f57d600049061dc6bb68ed03c7d2fbd697274c41805dcb3f8608" +checksum = "86d7a0c1aa76363dac491de0ee99faf6941128376f1cf96f07db7603b7de69dd" [[package]] name = "futures-executor" -version = "0.3.26" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8de0a35a6ab97ec8869e32a2473f4b1324459e14c29275d14b10cb1fd19b50e" +checksum = "1997dd9df74cdac935c76252744c1ed5794fac083242ea4fe77ef3ed60ba0f83" dependencies = [ "futures-core", "futures-task", @@ -1344,15 +1344,15 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.26" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfb8371b6fb2aeb2d280374607aeabfc99d95c72edfe51692e42d3d7f0d08531" +checksum = "89d422fa3cbe3b40dca574ab087abb5bc98258ea57eea3fd6f1fa7162c778b91" [[package]] name = "futures-macro" -version = "0.3.26" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95a73af87da33b5acf53acfebdc339fe592ecf5357ac7c0a7734ab9d8c876a70" +checksum = "3eb14ed937631bd8b8b8977f2c198443447a8355b6e3ca599f38c975e5a963b6" dependencies = [ "proc-macro2", "quote", @@ -1361,21 +1361,21 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.26" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f310820bb3e8cfd46c80db4d7fb8353e15dfff853a127158425f31e0be6c8364" +checksum = "ec93083a4aecafb2a80a885c9de1f0ccae9dbd32c2bb54b0c3a65690e0b8d2f2" [[package]] name = "futures-task" -version = "0.3.26" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf79a1bf610b10f42aea489289c5a2c478a786509693b80cd39c44ccd936366" +checksum = "fd65540d33b37b16542a0438c12e6aeead10d4ac5d05bd3f805b8f35ab592879" [[package]] name = "futures-util" -version = "0.3.26" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c1d6de3acfef38d2be4b1f543f553131788603495be83da675e180c8d6b7bd1" +checksum = "3ef6b17e481503ec85211fed8f39d1970f128935ca1f814cd32ac4a6842e84ab" dependencies = [ "futures-channel", "futures-core", @@ -1708,6 +1708,7 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e6cd45a270dff33553602fd84beb02c89460ee32db638715f10d9060389fd6a" dependencies = [ + "native-tls", "rustls 0.19.1", "unicase", "webpki 0.21.4", @@ -1728,9 +1729,9 @@ checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" [[package]] name = "hyper" -version = "0.14.24" +version = "0.14.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e011372fa0b68db8350aa7a248930ecc7839bf46d8485577d69f117a75f164c" +checksum = "cc5e554ff619822309ffd57d8734d77cd5ce6238bc956f037ea06c58238c9899" dependencies = [ "bytes", "futures-channel", @@ -1956,10 +1957,11 @@ dependencies = [ [[package]] name = "io-lifetimes" -version = "1.0.5" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1abeb7a0dd0f8181267ff8adc397075586500b81b28a73e8a0208b00fc170fb3" +checksum = "76e86b86ae312accbf05ade23ce76b625e0e47a255712b7414037385a1c05380" dependencies = [ + "hermit-abi 0.3.1", "libc", "windows-sys 0.45.0", ] @@ -2063,9 +2065,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.139" +version = "0.2.140" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" +checksum = "99227334921fae1a979cf0bfdfcc6b3e5ce376ef57e16fb6fb3ea2ed6095f80c" [[package]] name = "libfuzzer-sys" @@ -2139,7 +2141,7 @@ dependencies = [ "lazy_static", "libc", "regex", - "semver 1.0.16", + "semver 1.0.17", ] [[package]] @@ -2309,9 +2311,9 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "minisign" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce49953dd06a44e1034590bb619bfe8900c29500053c0c0f83e9260a34466aa5" +checksum = "b23ef13ff1d745b1e52397daaa247e333c607f3cff96d4df2b798dc252db974b" dependencies = [ "getrandom", "rpassword", @@ -2578,9 +2580,9 @@ dependencies = [ [[package]] name = "orbclient" -version = "0.3.42" +version = "0.3.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba683f1641c11041c59d5d93689187abcab3c1349dc6d9d70c550c9f9360802f" +checksum = "974465c5e83cf9df05c1e4137b271d29035c902e39e5ad4c1939837e22160af8" dependencies = [ "cfg-if 1.0.0", "libc", @@ -2681,11 +2683,12 @@ checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" [[package]] name = "pbkdf2" -version = "0.11.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" +checksum = "f0ca0b5a68607598bf3bad68f32227a8164f6254833f84eafaac409cd6746c31" dependencies = [ "digest", + "hmac", ] [[package]] @@ -2798,15 +2801,15 @@ dependencies = [ [[package]] name = "predicates-core" -version = "1.0.5" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72f883590242d3c6fc5bf50299011695fa6590c2c70eac95ee1bdb9a733ad1a2" +checksum = "b794032607612e7abeb4db69adb4e33590fa6cf1149e95fd7cb00e634b92f174" [[package]] name = "predicates-tree" -version = "1.0.7" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54ff541861505aabf6ea722d2131ee980b8276e10a1297b94e896dd8b621850d" +checksum = "368ba315fb8c5052ab692e68a0eefec6ec57b23a36959c14496f0b0df2c0cecf" dependencies = [ "predicates-core", "termtree", @@ -2880,9 +2883,9 @@ checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" [[package]] name = "proc-macro2" -version = "1.0.51" +version = "1.0.52" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d727cae5b39d21da60fa540906919ad737832fe0b1c165da3a34d6548c849d6" +checksum = "1d0e1ae9e836cc3beddd63db0df682593d7e2d3d891ae8c9083d2113e1744224" dependencies = [ "unicode-ident", ] @@ -2944,9 +2947,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.23" +version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" +checksum = "4424af4bf778aae2051a77b60283332f386554255d722233d09fbfc7e30da2fc" dependencies = [ "proc-macro2", ] @@ -3264,7 +3267,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver 1.0.16", + "semver 1.0.17", ] [[package]] @@ -3386,11 +3389,10 @@ checksum = "1792db035ce95be60c3f8853017b3999209281c24e2ba5bc8e59bf97a0c590c1" [[package]] name = "scrypt" -version = "0.10.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f9e24d2b632954ded8ab2ef9fea0a0c769ea56ea98bddbafbad22caeeadf45d" +checksum = "0516a385866c09368f0b5bcd1caff3366aace790fcd46e2bb032697bb172fd1f" dependencies = [ - "hmac", "pbkdf2", "salsa20", "sha2", @@ -3490,9 +3492,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.16" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58bc9567378fc7690d6b2addae4e60ac2eeea07becb2c64b9f218b53865cba2a" +checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed" dependencies = [ "serde", ] @@ -3514,9 +3516,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.152" +version = "1.0.156" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb7d1f0d3021d347a83e556fc4683dea2ea09d87bccdf88ff5c12545d89d5efb" +checksum = "314b5b092c0ade17c00142951e50ced110ec27cea304b1037c6969246c2469a4" dependencies = [ "serde_derive", ] @@ -3553,9 +3555,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.152" +version = "1.0.156" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af487d118eecd09402d70a5d72551860e788df87b464af30e5ea6a38c75c541e" +checksum = "d7e29c4601e36bcec74a223228dce795f4cd3616341a4af93520ca1a837c087d" dependencies = [ "proc-macro2", "quote", @@ -3953,9 +3955,9 @@ dependencies = [ [[package]] name = "termtree" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95059e91184749cb66be6dc994f67f182b6d897cb3df74a5bf66b5e709295fd8" +checksum = "3369f5ac52d5eb6ab48c6b4ffdc8efbcad6b89c765749064ba298f2c68a16a76" [[package]] name = "test-generator" @@ -4220,9 +4222,9 @@ checksum = "3ab8ed2edee10b50132aed5f331333428b011c99402b5a534154ed15746f9622" [[package]] name = "toml_edit" -version = "0.19.4" +version = "0.19.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a1eb0622d28f4b9c90adc4ea4b2b46b47663fde9ac5fafcb14a1369d5508825" +checksum = "dc18466501acd8ac6a3f615dd29a3438f8ca6bb3b19537138b3106e575621274" dependencies = [ "indexmap", "toml_datetime", @@ -4409,9 +4411,9 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.10" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54675592c1dbefd78cbd98db9bacd89886e1ca50692a0692baefffdeb92dd58" +checksum = "524b68aca1d05e03fdf03fcdce2c6c94b6daf6d16861ddaa7e4f2b6638a9052c" [[package]] name = "unicode-ident" @@ -4679,12 +4681,11 @@ checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" [[package]] name = "walkdir" -version = "2.3.2" +version = "2.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56" +checksum = "36df944cda56c7d8d8b7496af378e6b16de9284591917d307c9b4d313c44e698" dependencies = [ "same-file", - "winapi", "winapi-util", ] @@ -4885,9 +4886,9 @@ dependencies = [ [[package]] name = "wasm-encoder" -version = "0.24.1" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68f7d56227d910901ce12dfd19acc40c12687994dfb3f57c90690f80be946ec5" +checksum = "4eff853c4f09eec94d76af527eddad4e9de13b11d6286a1ef7134bc30135a2b7" dependencies = [ "leb128", ] @@ -5060,7 +5061,7 @@ dependencies = [ "reqwest", "rpassword", "rusqlite", - "semver 1.0.16", + "semver 1.0.17", "serde", "serde_json", "sha2", @@ -5180,7 +5181,7 @@ dependencies = [ "rayon", "regex", "rustc_version 0.4.0", - "semver 1.0.16", + "semver 1.0.17", "smallvec", "target-lexicon 0.12.6", "wasmer-compiler", @@ -5325,7 +5326,7 @@ dependencies = [ "rand", "regex", "reqwest", - "semver 1.0.16", + "semver 1.0.17", "serde", "serde_json", "tar", @@ -5362,7 +5363,7 @@ checksum = "4232db0aff83ed6208d541ddcf1bf72730673528be8c4fe13c6369060f6e05a7" dependencies = [ "anyhow", "indexmap", - "semver 1.0.16", + "semver 1.0.17", "serde", "serde_cbor", "serde_json", @@ -5595,9 +5596,9 @@ dependencies = [ [[package]] name = "wasmparser" -version = "0.101.1" +version = "0.102.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf2f22ef84ac5666544afa52f326f13e16f3d019d2e61e704fd8091c9358b130" +checksum = "48134de3d7598219ab9eaf6b91b15d8e50d31da76b8519fe4ecfcec2cf35104b" dependencies = [ "indexmap", "url", @@ -5605,12 +5606,12 @@ dependencies = [ [[package]] name = "wasmprinter" -version = "0.2.52" +version = "0.2.54" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "003f2e37b9b7caac949d388e185ecd9139f51441249a23880b0cf38e10cdf647" +checksum = "2dc17ae63836d010a2bf001c26a5fedbb9a05e5f71117fb63e0ab878bfbe1ca3" dependencies = [ "anyhow", - "wasmparser 0.101.1", + "wasmparser 0.102.0", ] [[package]] @@ -5633,23 +5634,23 @@ dependencies = [ [[package]] name = "wast" -version = "54.0.1" +version = "55.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d48d9d731d835f4f8dacbb8de7d47be068812cb9877f5c60d408858778d8d2a" +checksum = "4984d3e1406571f4930ba5cf79bd70f75f41d0e87e17506e0bd19b0e5d085f05" dependencies = [ "leb128", "memchr", "unicode-width", - "wasm-encoder 0.24.1", + "wasm-encoder 0.25.0", ] [[package]] name = "wat" -version = "1.0.60" +version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1db2e3ed05ea31243761439194bec3af6efbbaf87c4c8667fb879e4f23791a0" +checksum = "af2b53f4da14db05d32e70e9c617abdf6620c575bd5dd972b7400037b4df2091" dependencies = [ - "wast 54.0.1", + "wast 55.0.0", ] [[package]] @@ -5833,9 +5834,9 @@ checksum = "9193164d4de03a926d909d3bc7c30543cecb35400c02114792c2cae20d5e2dbb" [[package]] name = "whoami" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45dbc71f0cdca27dc261a9bd37ddec174e4a0af2b900b890f378460f745426e3" +checksum = "2c70234412ca409cc04e864e89523cb0fc37f5e1344ebed5a3ebf4192b6b9f68" dependencies = [ "wasm-bindgen", "web-sys", @@ -5892,12 +5893,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" dependencies = [ "windows_aarch64_gnullvm", - "windows_aarch64_msvc 0.42.1", - "windows_i686_gnu 0.42.1", - "windows_i686_msvc 0.42.1", - "windows_x86_64_gnu 0.42.1", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", "windows_x86_64_gnullvm", - "windows_x86_64_msvc 0.42.1", + "windows_x86_64_msvc 0.42.2", ] [[package]] @@ -5911,24 +5912,24 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e2522491fbfcd58cc84d47aeb2958948c4b8982e9a2d8a2a35bbaed431390e7" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" dependencies = [ "windows_aarch64_gnullvm", - "windows_aarch64_msvc 0.42.1", - "windows_i686_gnu 0.42.1", - "windows_i686_msvc 0.42.1", - "windows_x86_64_gnu 0.42.1", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", "windows_x86_64_gnullvm", - "windows_x86_64_msvc 0.42.1", + "windows_x86_64_msvc 0.42.2", ] [[package]] name = "windows_aarch64_gnullvm" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c9864e83243fdec7fc9c5444389dcbbfd258f745e7853198f365e3c4968a608" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" [[package]] name = "windows_aarch64_msvc" @@ -5938,9 +5939,9 @@ checksum = "cd761fd3eb9ab8cc1ed81e56e567f02dd82c4c837e48ac3b2181b9ffc5060807" [[package]] name = "windows_aarch64_msvc" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c8b1b673ffc16c47a9ff48570a9d85e25d265735c503681332589af6253c6c7" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" [[package]] name = "windows_i686_gnu" @@ -5950,9 +5951,9 @@ checksum = "cab0cf703a96bab2dc0c02c0fa748491294bf9b7feb27e1f4f96340f208ada0e" [[package]] name = "windows_i686_gnu" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3887528ad530ba7bdbb1faa8275ec7a1155a45ffa57c37993960277145d640" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" [[package]] name = "windows_i686_msvc" @@ -5962,9 +5963,9 @@ checksum = "8cfdbe89cc9ad7ce618ba34abc34bbb6c36d99e96cae2245b7943cd75ee773d0" [[package]] name = "windows_i686_msvc" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf4d1122317eddd6ff351aa852118a2418ad4214e6613a50e0191f7004372605" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" [[package]] name = "windows_x86_64_gnu" @@ -5974,15 +5975,15 @@ checksum = "b4dd9b0c0e9ece7bb22e84d70d01b71c6d6248b81a3c60d11869451b4cb24784" [[package]] name = "windows_x86_64_gnu" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1040f221285e17ebccbc2591ffdc2d44ee1f9186324dd3e84e99ac68d699c45" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" [[package]] name = "windows_x86_64_gnullvm" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "628bfdf232daa22b0d64fdb62b09fcc36bb01f05a3939e20ab73aaf9470d0463" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" [[package]] name = "windows_x86_64_msvc" @@ -5992,15 +5993,15 @@ checksum = "ff1e4aa646495048ec7f3ffddc411e1d829c026a2ec62b39da15c1055e406eaa" [[package]] name = "windows_x86_64_msvc" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "447660ad36a13288b1db4d4248e857b510e8c3a225c822ba4fb748c0aafecffd" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" [[package]] name = "winnow" -version = "0.3.4" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c95fb4ff192527911dd18eb138ac30908e7165b8944e528b6af93aa4c842d345" +checksum = "23d020b441f92996c80d94ae9166e8501e59c7bb56121189dc9eab3bd8216966" dependencies = [ "memchr", ] diff --git a/Makefile b/Makefile index e59f366cdb8..29498dd03c4 100644 --- a/Makefile +++ b/Makefile @@ -14,21 +14,24 @@ SHELL=/usr/bin/env bash # |------------|----------|--------------|-------| # | Cranelift | Linux | amd64 | glibc | # | LLVM | Darwin | aarch64 | musl | -# | Singlepass | Windows | | | +# | Singlepass | Windows | riscv | | # |------------|----------|--------------|-------| # # Here is what works and what doesn't: # -# * Cranelift works everywhere, +# * Cranelift works everywhere except Linux/`riscv`, # # * LLVM works on Linux+Darwin/`amd64`, -# but it doesn't work on */`aarch64` or Windows/*. +# and linux+`aarch64`, linux+`riscv` +# but it doesn't work on Darwin/`aarch64` or Windows/`aarch64`. # -# * Singlepass works on Linux+Darwin/`amd64`, but -# it doesn't work on */`aarch64` or Windows/*. +# * Singlepass works on Linux+Darwin+Windows/`amd64`, +# and Linux+Darwin/`aarch64` +# it doesn't work on */`riscv`. # # * Windows isn't tested on `aarch64`, that's why we consider it's not # working, but it might possibly be. +# * The Only target for `riscv` familly of processor is the RV64, with the `GC` extensions ##### diff --git a/lib/cli/Cargo.toml b/lib/cli/Cargo.toml index bee665e1ba0..19309438323 100644 --- a/lib/cli/Cargo.toml +++ b/lib/cli/Cargo.toml @@ -54,8 +54,6 @@ distance = "0.4" bytesize = "1.0" cfg-if = "1.0" tempfile = "3.4.0" -http_req = { version="^0.8", default-features = false, features = ["rust-tls"] } -reqwest = { version = "^0.11", default-features = false, features = ["rustls-tls", "json", "multipart"] } serde = { version = "1.0.147", features = ["derive"] } dirs = { version = "4.0" } serde_json = { version = "1.0" } @@ -91,6 +89,14 @@ wasm-coredump-builder = { version = "0.1.11" } tracing = { version = "0.1", optional = true } tracing-subscriber = { version = "0.3", features = [ "env-filter", "fmt" ], optional = true } +[target.'cfg(not(target_arch = "riscv64"))'.dependencies] +http_req = { version="^0.8", default-features = false, features = ["rust-tls"] } +reqwest = { version = "^0.11", default-features = false, features = ["rustls-tls", "json", "multipart"] } + +[target.'cfg(target_arch = "riscv64")'.dependencies] +http_req = { version="^0.8", default-features = false, features = ["native-tls"] } +reqwest = { version = "^0.11", default-features = false, features = ["native-tls", "json", "multipart"] } + [build-dependencies] chrono = { version = "^0.4", default-features = false, features = [ "std", "clock" ] } diff --git a/lib/registry/Cargo.toml b/lib/registry/Cargo.toml index 217b6609686..a607d2bde75 100644 --- a/lib/registry/Cargo.toml +++ b/lib/registry/Cargo.toml @@ -13,7 +13,6 @@ dirs = "4.0.0" graphql_client = "0.11.0" serde = { version = "1.0.145", features = ["derive"] } anyhow = "1.0.65" -reqwest = { version = "0.11.12", default-features = false, features = ["rustls-tls", "blocking", "multipart", "json", "stream"] } futures-util = "0.3.25" whoami = "1.2.3" serde_json = "1.0.85" @@ -37,3 +36,9 @@ console = "0.15.2" indicatif = "0.17.2" lazy_static = "1.4.0" tempfile = "3.4.0" + +[target.'cfg(not(target_arch = "riscv64"))'.dependencies] +reqwest = { version = "0.11.12", default-features = false, features = ["rustls-tls", "blocking", "multipart", "json", "stream"] } + +[target.'cfg(target_arch = "riscv64")'.dependencies] +reqwest = { version = "0.11.12", default-features = false, features = ["native-tls", "blocking", "multipart", "json", "stream"] } diff --git a/lib/wasi/Cargo.toml b/lib/wasi/Cargo.toml index 4c7719b6ab7..40acc493c43 100644 --- a/lib/wasi/Cargo.toml +++ b/lib/wasi/Cargo.toml @@ -61,12 +61,18 @@ hyper = { version = "0.14", features = ["server", "stream"], optional = true } wcgi = { version = "0.1.1", optional = true } wcgi-host = { version = "0.1.0", optional = true } -[dependencies.reqwest] +[target.'cfg(not(target_arch = "riscv64"))'.dependencies.reqwest] version = "0.11" default-features = false features = ["rustls-tls", "json"] optional = true +[target.'cfg(target_arch = "riscv64")'.dependencies.reqwest] +version = "0.11" +default-features = false +features = ["native-tls", "json"] +optional = true + [target.'cfg(unix)'.dependencies] libc = { version = "^0.2", default-features = false } termios = { version = "0.3" } diff --git a/rust-toolchain b/rust-toolchain index 8725364a8ec..5b6cd6b3cd7 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -1.64 +1.65 diff --git a/tests/ignores.txt b/tests/ignores.txt index 4a86746e18a..f0a83bd1985 100644 --- a/tests/ignores.txt +++ b/tests/ignores.txt @@ -8,6 +8,7 @@ singlepass spec::simd # Singlepass doesn't support yet SIMD (no one asked for th singlepass+aarch64+macos traps::test_trap_trace cranelift+aarch64+macos traps::test_trap_trace llvm+aarch64 traps::test_trap_trace +llvm+riscv64 traps::test_trap_trace singlepass+aarch64+macos traps::test_trap_stack_overflow # Need to investigate singlepass+aarch64+macos traps::trap_display_pretty llvm traps::trap_display_pretty @@ -28,6 +29,25 @@ cranelift+aarch64+macos traps::start_trap_pretty # https://github.com/wasmerio/wasmer/issues/2808 cranelift+aarch64 spec::skip_stack_guard_page llvm+aarch64 spec::skip_stack_guard_page +llvm+riscv64 spec::skip_stack_guard_page + +# riscv support is still early, function call ABI needs some work +llvm+riscv64 static_function::llvm::universal +llvm+riscv64 static_function_with_env::llvm::universal +llvm+riscv64 static_function_with_results::llvm::universal +llvm+riscv64 spec::f32::llvm::universal +llvm+riscv64 spec::f64::llvm::universal +llvm+riscv64 spec::float_misc::llvm::universal +llvm+riscv64 spec::memory_copy::llvm::universal +llvm+riscv64 spec::memory_init::llvm::universal +llvm+riscv64 spec::memory_trap::llvm::universal +llvm+riscv64 spec::multi_value::binary::llvm::universal +llvm+riscv64 spec::multi_value::block::llvm::universal +llvm+riscv64 spec::simd::simd_align::llvm::universal +llvm+riscv64 spec::simd::simd_f32x4_rounding::llvm::universal +llvm+riscv64 spec::simd::simd_f64x2_rounding::llvm::universal +llvm+riscv64 wasmer::nan_canonicalization::llvm::universal +llvm+riscv64 wasmer::stack_overflow_sret::llvm::universal # Windows doesn't overcommit and fails to allocate 4GB of memory windows wasmer::max_size_of_memory diff --git a/tests/lib/compiler-test-derive/src/ignores.rs b/tests/lib/compiler-test-derive/src/ignores.rs index c9425355033..12364cf2191 100644 --- a/tests/lib/compiler-test-derive/src/ignores.rs +++ b/tests/lib/compiler-test-derive/src/ignores.rs @@ -111,7 +111,7 @@ impl Ignores { target_env = Some(alias.to_string()); } // Chipset architectures - "aarch64" | "x86" | "x64" => { + "aarch64" | "x86" | "x64" | "riscv64" => { arch = Some(alias.to_string()); } // Engines From ca2973ea6d4f59047813484999de48703d529aa8 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Fri, 17 Mar 2023 13:02:39 +0000 Subject: [PATCH 07/17] Update rustc to 4.65 (1.64 has some issue with riscv64 target) --- .github/workflows/benchmark.yaml | 2 +- .github/workflows/build.yml | 2 +- .github/workflows/cloudcompiler.yaml | 2 +- .github/workflows/documentation.yaml | 2 +- .github/workflows/test.yaml | 10 +++++----- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/benchmark.yaml b/.github/workflows/benchmark.yaml index c303bddb705..e0c221b6eb4 100644 --- a/.github/workflows/benchmark.yaml +++ b/.github/workflows/benchmark.yaml @@ -24,7 +24,7 @@ jobs: - name: Install Rust uses: dtolnay/rust-toolchain@stable with: - toolchain: 1.64 + toolchain: 1.65 - name: Configure cargo data directory # After this point, all cargo registry and crate data is stored in # $GITHUB_WORKSPACE/.cargo_home. This allows us to cache only the files diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c96fdc4e60c..493d748364c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -94,7 +94,7 @@ jobs: - name: Install Rust uses: dtolnay/rust-toolchain@stable with: - toolchain: 1.64 + toolchain: 1.65 target: ${{ matrix.target }} - name: Install Rust nightly (to build capi-headless) uses: dtolnay/rust-toolchain@stable diff --git a/.github/workflows/cloudcompiler.yaml b/.github/workflows/cloudcompiler.yaml index c7ef5b8ec78..ecd29660785 100644 --- a/.github/workflows/cloudcompiler.yaml +++ b/.github/workflows/cloudcompiler.yaml @@ -21,7 +21,7 @@ jobs: - name: Install Rust uses: dtolnay/rust-toolchain@stable with: - toolchain: 1.64 + toolchain: 1.65 target: ${{ matrix.target }} - name: Install wasm32-wasi target shell: bash diff --git a/.github/workflows/documentation.yaml b/.github/workflows/documentation.yaml index 4ffdfb468cf..9ac7eaae484 100644 --- a/.github/workflows/documentation.yaml +++ b/.github/workflows/documentation.yaml @@ -16,7 +16,7 @@ jobs: - name: Install Rust uses: dtolnay/rust-toolchain@stable with: - toolchain: 1.64 + toolchain: 1.65 - name: Install LLVM shell: bash run: | diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 37c85536d0d..f56071356b8 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -43,7 +43,7 @@ jobs: - name: Install Rust uses: dtolnay/rust-toolchain@stable with: - toolchain: 1.64 + toolchain: 1.65 components: rustfmt, clippy - name: Install libtinfo shell: bash @@ -95,7 +95,7 @@ jobs: - name: Install Rust uses: dtolnay/rust-toolchain@stable with: - toolchain: 1.64 + toolchain: 1.65 - name: Install NodeJS uses: actions/setup-node@v2 with: @@ -263,7 +263,7 @@ jobs: - name: Install Rust uses: dtolnay/rust-toolchain@stable with: - toolchain: 1.64 + toolchain: 1.65 target: ${{ matrix.metadata.target }} - name: Install Rust nightly (to build capi-headless) uses: dtolnay/rust-toolchain@stable @@ -487,7 +487,7 @@ jobs: - name: Install Rust uses: dtolnay/rust-toolchain@stable with: - toolchain: 1.64 + toolchain: 1.65 target: ${{ matrix.metadata.target }} - name: Install LLVM (macOS Apple Silicon) if: matrix.metadata.os == 'macos-11.0' && !matrix.metadata.llvm_url @@ -587,7 +587,7 @@ jobs: - name: Install Rust uses: dtolnay/rust-toolchain@stable with: - toolchain: 1.64 + toolchain: 1.65 target: ${{ matrix.metadata.target }} - name: Cache uses: whywaita/actions-cache-s3@v2 From 18152136db2cda55a093ed142947dc065c046349 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Fri, 17 Mar 2023 13:41:26 +0000 Subject: [PATCH 08/17] Fixed some (new) Linting issues --- lib/compiler/src/artifact_builders/trampoline.rs | 2 +- lib/compiler/src/engine/artifact.rs | 2 ++ lib/compiler/src/engine/tunables.rs | 3 +++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/compiler/src/artifact_builders/trampoline.rs b/lib/compiler/src/artifact_builders/trampoline.rs index 6ed4070e6c1..387b62608a2 100644 --- a/lib/compiler/src/artifact_builders/trampoline.rs +++ b/lib/compiler/src/artifact_builders/trampoline.rs @@ -62,7 +62,7 @@ fn make_trampoline( }); } Architecture::Riscv64(_) => { - code.extend(&RISCV64_TRAMPOLINE); + code.extend(RISCV64_TRAMPOLINE); relocations.push(Relocation { kind: RelocationKind::Abs8, reloc_target: RelocationTarget::LibCall(libcall), diff --git a/lib/compiler/src/engine/artifact.rs b/lib/compiler/src/engine/artifact.rs index 6505ed3dde2..b8284c242b7 100644 --- a/lib/compiler/src/engine/artifact.rs +++ b/lib/compiler/src/engine/artifact.rs @@ -429,6 +429,7 @@ impl Artifact { /// # Safety /// /// See [`VMInstance::new`]. + #[allow(clippy::result_large_err)] pub unsafe fn instantiate( &self, tunables: &dyn Tunables, @@ -509,6 +510,7 @@ impl Artifact { /// # Safety /// /// See [`VMInstance::finish_instantiation`]. + #[allow(clippy::result_large_err)] pub unsafe fn finish_instantiation( &self, trap_handler: Option<*const TrapHandlerFn<'static>>, diff --git a/lib/compiler/src/engine/tunables.rs b/lib/compiler/src/engine/tunables.rs index 596af921dc5..945908a18cb 100644 --- a/lib/compiler/src/engine/tunables.rs +++ b/lib/compiler/src/engine/tunables.rs @@ -60,6 +60,7 @@ pub trait Tunables { /// /// # Safety /// - `memory_definition_locations` must point to a valid locations in VM memory. + #[allow(clippy::result_large_err)] unsafe fn create_memories( &self, context: &mut StoreObjects, @@ -93,6 +94,7 @@ pub trait Tunables { /// # Safety /// /// To be done + #[allow(clippy::result_large_err)] unsafe fn create_tables( &self, context: &mut StoreObjects, @@ -123,6 +125,7 @@ pub trait Tunables { /// Allocate memory for just the globals of the current module, /// with initializers applied. + #[allow(clippy::result_large_err)] fn create_globals( &self, context: &mut StoreObjects, From 620ce13e4a6d52b2a145e6c78bec875516755008 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Fri, 17 Mar 2023 16:50:08 +0100 Subject: [PATCH 09/17] Updated Cargo.toml and remove split-debuginfo for Windows build --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 5c753eaf9c1..3e2f8031c16 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -129,7 +129,7 @@ test-universal = ["test-generator/test-universal"] # that raise signals because that interferes with tarpaulin. coverage = [] -[profile.dev] +[target.'cfg(not(target_os = "windows"))'.profile.dev] split-debuginfo = "unpacked" #[profile.release] From 85f9b9c0fad4845449be02ea7336aa52eb5797f5 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Fri, 17 Mar 2023 16:41:52 +0000 Subject: [PATCH 10/17] Removed profile.dev from Cargo.toml as it cannot be per platform (breaks Windows). split-debug info is now the default value --- Cargo.toml | 3 --- 1 file changed, 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 3e2f8031c16..e38c8e7f129 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -129,9 +129,6 @@ test-universal = ["test-generator/test-universal"] # that raise signals because that interferes with tarpaulin. coverage = [] -[target.'cfg(not(target_os = "windows"))'.profile.dev] -split-debuginfo = "unpacked" - #[profile.release] #debug = true From 9b97ff6b3fbffefd15818c559fd7012790cc822b Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Fri, 17 Mar 2023 16:42:24 +0000 Subject: [PATCH 11/17] Enable Cranelift compiler for RISCV --- Makefile | 2 +- lib/compiler-cranelift/Cargo.toml | 2 +- lib/compiler-cranelift/src/config.rs | 22 ++++++++++++++----- .../src/translator/translation_utils.rs | 1 + tests/ignores.txt | 9 ++++++++ 5 files changed, 29 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 29498dd03c4..9d1b11e5a1d 100644 --- a/Makefile +++ b/Makefile @@ -126,7 +126,7 @@ ifneq ($(ENABLE_CRANELIFT), 0) ifeq ($(ENABLE_CRANELIFT), 1) compilers += cranelift # … otherwise, we try to check whether Cranelift works on this host. - else ifneq ($(IS_RISCV64), 1) + else compilers += cranelift endif endif diff --git a/lib/compiler-cranelift/Cargo.toml b/lib/compiler-cranelift/Cargo.toml index 25967ea43f8..d9c72dee235 100644 --- a/lib/compiler-cranelift/Cargo.toml +++ b/lib/compiler-cranelift/Cargo.toml @@ -15,7 +15,7 @@ edition = "2018" wasmer-compiler = { path = "../compiler", version = "=3.2.0-alpha.1", features = ["translator", "compiler"], default-features = false } wasmer-types = { path = "../types", version = "=3.2.0-alpha.1", default-features = false, features = ["std"] } cranelift-entity = { version = "0.91.1", default-features = false } -cranelift-codegen = { version = "0.91.1", default-features = false, features = ["x86", "arm64"] } +cranelift-codegen = { version = "0.91.1", default-features = false, features = ["x86", "arm64", "riscv64"] } cranelift-frontend = { version = "0.91.1", default-features = false } tracing = "0.1" hashbrown = { version = "0.11", optional = true } diff --git a/lib/compiler-cranelift/src/config.rs b/lib/compiler-cranelift/src/config.rs index dff2ba11919..3768a96f2b3 100644 --- a/lib/compiler-cranelift/src/config.rs +++ b/lib/compiler-cranelift/src/config.rs @@ -117,11 +117,17 @@ impl Cranelift { builder.enable("has_lzcnt").expect("should be valid flag"); } - builder.finish(self.flags()) + let is_riscv = if let Architecture::Riscv64(_) = target.triple().architecture { + true + } else { + false + }; + + builder.finish(self.flags(is_riscv)) } /// Generates the flags for the compiler - pub fn flags(&self) -> settings::Flags { + pub fn flags(&self, is_riscv: bool) -> settings::Flags { let mut flags = settings::builder(); // Enable probestack @@ -169,9 +175,15 @@ impl Cranelift { ) .expect("should be valid flag"); - flags - .set("enable_simd", "true") - .expect("should be valid flag"); + if is_riscv { + flags + .set("enable_simd", "false") + .expect("should be valid flag"); + } else { + flags + .set("enable_simd", "true") + .expect("should be valid flag"); + } let enable_nan_canonicalization = if self.enable_nan_canonicalization { "true" diff --git a/lib/compiler-cranelift/src/translator/translation_utils.rs b/lib/compiler-cranelift/src/translator/translation_utils.rs index ecc6beb93c4..bd1a8a13339 100644 --- a/lib/compiler-cranelift/src/translator/translation_utils.rs +++ b/lib/compiler-cranelift/src/translator/translation_utils.rs @@ -84,6 +84,7 @@ pub fn irreloc_to_relocationkind(reloc: Reloc) -> RelocationKind { Reloc::X86CallPLTRel4 => RelocationKind::X86CallPLTRel4, Reloc::X86GOTPCRel4 => RelocationKind::X86GOTPCRel4, Reloc::Arm64Call => RelocationKind::Arm64Call, + Reloc::RiscvCall => RelocationKind::RiscvCall, _ => panic!("The relocation {} is not yet supported.", reloc), } } diff --git a/tests/ignores.txt b/tests/ignores.txt index f0a83bd1985..d4a4af91a11 100644 --- a/tests/ignores.txt +++ b/tests/ignores.txt @@ -29,6 +29,7 @@ cranelift+aarch64+macos traps::start_trap_pretty # https://github.com/wasmerio/wasmer/issues/2808 cranelift+aarch64 spec::skip_stack_guard_page llvm+aarch64 spec::skip_stack_guard_page +cranelift+riscv64 spec::skip_stack_guard_page llvm+riscv64 spec::skip_stack_guard_page # riscv support is still early, function call ABI needs some work @@ -48,6 +49,14 @@ llvm+riscv64 spec::simd::simd_f32x4_rounding::llvm::universal llvm+riscv64 spec::simd::simd_f64x2_rounding::llvm::universal llvm+riscv64 wasmer::nan_canonicalization::llvm::universal llvm+riscv64 wasmer::stack_overflow_sret::llvm::universal +# riscv support on Cranelift is also very young +cranelift+riscv64 spec::align::cranelift::universal +cranelift+riscv64 spec::memory_copy::cranelift::universal +cranelift+riscv64 spec::memory_trap::cranelift::universal +cranelift+riscv64 spec::r#if::cranelift::universal + +# no SIMD on riscv, Cranelift will not handle them +cranelift+riscv64 spec::simd # Windows doesn't overcommit and fails to allocate 4GB of memory windows wasmer::max_size_of_memory From e120926d7a7960a0bfcb7dd43c97fb2789658e4c Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Mon, 20 Mar 2023 11:14:10 +0100 Subject: [PATCH 12/17] Update crates and fixed all the new clippy errors --- Cargo.lock | 175 ++++++++++--------- lib/api/src/access.rs | 4 +- lib/api/src/imports.rs | 1 + lib/api/src/instance.rs | 2 + lib/api/src/sys/instance.rs | 2 + lib/api/src/sys/module.rs | 1 + lib/cache/src/hash.rs | 2 +- lib/cli/build.rs | 2 +- lib/cli/src/commands/create_exe.rs | 8 +- lib/cli/src/commands/init.rs | 4 +- lib/cli/src/commands/publish.rs | 4 +- lib/cli/src/commands/run.rs | 2 +- lib/compiler-cranelift/src/config.rs | 6 +- lib/compiler-llvm/src/abi/aarch64_systemv.rs | 13 +- lib/compiler-llvm/src/abi/x86_64_systemv.rs | 13 +- lib/compiler/src/engine/artifact.rs | 1 + lib/compiler/src/engine/resolver.rs | 1 + lib/registry/src/lib.rs | 2 +- lib/vfs/src/webc_fs.rs | 3 +- lib/wasi/src/lib.rs | 2 + lib/wasi/src/state/builder.rs | 5 + lib/wasi/src/state/env.rs | 2 + lib/wasi/src/syscalls/wasi/environ_get.rs | 2 +- lib/wasi/src/syscalls/wasi/path_rename.rs | 2 +- tests/lib/wast/src/wast.rs | 2 +- 25 files changed, 138 insertions(+), 123 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 89ddbfa6f12..6bb545bd555 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -63,9 +63,9 @@ checksum = "70033777eb8b5124a81a1889416543dddef2de240019b674c81285a2635a7e1e" [[package]] name = "anyhow" -version = "1.0.69" +version = "1.0.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "224afbd727c3d6e4b90103ece64b8d1b67fbb1973b1046c2281eed3f3803f800" +checksum = "7de8ce5e0f9f8d88245311066a578d72b7af3e7088f32783804676302df237e4" [[package]] name = "arbitrary" @@ -116,13 +116,13 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.66" +version = "0.1.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b84f9ebcc6c1f5b8cb160f6990096a5c127f423fcb6e1ccc46c370cbdfb75dfc" +checksum = "86ea188f25f0255d8f92797797c97ebf5631fa88178beb1a46fdf5622c9a00e4" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.2", ] [[package]] @@ -282,7 +282,7 @@ checksum = "e31225543cb46f81a7e224762764f4a6a0f097b1db0b175f69e8065efaa42de5" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -358,7 +358,7 @@ dependencies = [ "quote", "serde", "serde_json", - "syn", + "syn 1.0.109", "tempfile", "toml", ] @@ -446,7 +446,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -519,7 +519,7 @@ dependencies = [ "pretty_assertions", "proc-macro2", "quote", - "syn", + "syn 1.0.109", "trybuild", ] @@ -850,7 +850,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6d2301688392eb071b0bf1a37be05c469d3cc4dbbd95df672fe28ab021e6a096" dependencies = [ "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -861,9 +861,9 @@ checksum = "b365fabc795046672053e29c954733ec3b05e4be654ab130fe8f1f94d7051f35" [[package]] name = "cxx" -version = "1.0.92" +version = "1.0.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a140f260e6f3f79013b8bfc65e7ce630c9ab4388c6a89c71e07226f49487b72" +checksum = "a9c00419335c41018365ddf7e4d5f1c12ee3659ddcf3e01974650ba1de73d038" dependencies = [ "cc", "cxxbridge-flags", @@ -873,9 +873,9 @@ dependencies = [ [[package]] name = "cxx-build" -version = "1.0.92" +version = "1.0.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da6383f459341ea689374bf0a42979739dc421874f112ff26f829b8040b8e613" +checksum = "fb8307ad413a98fff033c8545ecf133e3257747b3bae935e7602aab8aa92d4ca" dependencies = [ "cc", "codespan-reporting", @@ -883,24 +883,24 @@ dependencies = [ "proc-macro2", "quote", "scratch", - "syn", + "syn 2.0.2", ] [[package]] name = "cxxbridge-flags" -version = "1.0.92" +version = "1.0.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90201c1a650e95ccff1c8c0bb5a343213bdd317c6e600a93075bca2eff54ec97" +checksum = "edc52e2eb08915cb12596d29d55f0b5384f00d697a646dbd269b6ecb0fbd9d31" [[package]] name = "cxxbridge-macro" -version = "1.0.92" +version = "1.0.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b75aed41bb2e6367cae39e6326ef817a851db13c13e4f3263714ca3cfb8de56" +checksum = "631569015d0d8d54e6c241733f944042623ab6df7bc3be7466874b05fcdb1c5f" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.2", ] [[package]] @@ -923,7 +923,7 @@ dependencies = [ "ident_case", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -934,7 +934,7 @@ checksum = "a4aab4dbc9f7611d8b55048a3a16d2d010c2c8334e46304b40ac1cc14bf3b48e" dependencies = [ "darling_core", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -945,7 +945,7 @@ checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -956,7 +956,7 @@ checksum = "f3cdeb9ec472d588e539a818b2dee436825730da08ad0017c4b1a17676bdc8b7" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -1080,7 +1080,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -1138,7 +1138,7 @@ checksum = "c134c37760b27a871ba422106eedbb8247da973a09e82558bf26d619c882b159" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -1159,7 +1159,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -1356,7 +1356,7 @@ checksum = "3eb14ed937631bd8b8b8977f2c198443447a8355b6e3ca599f38c975e5a963b6" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -1432,13 +1432,13 @@ dependencies = [ [[package]] name = "ghost" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69e0cd8a998937e25c6ba7cc276b96ec5cc3f4dc4ab5de9ede4fb152bdd5c5eb" +checksum = "e77ac7b51b8e6313251737fcef4b1c01a2ea102bde68415b62c0ee9268fec357" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.2", ] [[package]] @@ -1508,7 +1508,7 @@ dependencies = [ "quote", "serde", "serde_json", - "syn", + "syn 1.0.109", ] [[package]] @@ -1519,7 +1519,7 @@ checksum = "a755cc59cda2641ea3037b4f9f7ef40471c329f55c1fa2db6fa0bb7ae6c1f7ce" dependencies = [ "graphql_client_codegen", "proc-macro2", - "syn", + "syn 1.0.109", ] [[package]] @@ -1539,7 +1539,7 @@ checksum = "729f9bd3449d77e7831a18abfb7ba2f99ee813dfd15b8c2167c9a54ba20aa99d" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -1879,7 +1879,7 @@ checksum = "87d00c17e264ce02be5bc23d7bff959188ec7137beddd06b8b6b05a7c680ea85" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -1957,9 +1957,9 @@ dependencies = [ [[package]] name = "io-lifetimes" -version = "1.0.7" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76e86b86ae312accbf05ade23ce76b625e0e47a255712b7414037385a1c05380" +checksum = "0dd6da19f25979c7270e70fa95ab371ec3b701cd0eefc47667a09785b3c59155" dependencies = [ "hermit-abi 0.3.1", "libc", @@ -1974,9 +1974,9 @@ checksum = "30e22bd8629359895450b59ea7a776c850561b96a3b1d31321c1949d9e6c9146" [[package]] name = "is-terminal" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21b6b32576413a8e69b90e952e4a026476040d81017b80445deda5f2d3921857" +checksum = "8687c819457e979cc940d09cb16e42a1bf70aa6b60a549de6d3a62a0ee90c69e" dependencies = [ "hermit-abi 0.3.1", "io-lifetimes", @@ -2189,7 +2189,7 @@ dependencies = [ "proc-macro2", "proc-quote", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -2490,7 +2490,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -2535,9 +2535,9 @@ checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" [[package]] name = "openssl" -version = "0.10.46" +version = "0.10.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd2523381e46256e40930512c7fd25562b9eae4812cb52078f155e87217c9d1e" +checksum = "d8b277f87dacc05a6b709965d1cbafac4649d6ce9f3ce9ceb88508b5666dfec9" dependencies = [ "bitflags", "cfg-if 1.0.0", @@ -2556,7 +2556,7 @@ checksum = "b501e44f11665960c7e7fcf062c7d96a14ade4aa98116c004b2e37b5be7d736c" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -2567,9 +2567,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.81" +version = "0.9.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "176be2629957c157240f68f61f2d0053ad3a4ecfdd9ebf1e6521d18d9635cf67" +checksum = "a95792af3c4e0153c3914df2261bedd30a98476f94dc892b67dfe1d89d433a04" dependencies = [ "autocfg", "cc", @@ -2596,9 +2596,9 @@ dependencies = [ [[package]] name = "os_str_bytes" -version = "6.4.1" +version = "6.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b7820b9daea5457c9f21c69448905d723fbd21136ccf521748f23fd49e723ee" +checksum = "ceedf44fb00f2d1984b0bc98102627ce622e083e49a5bacdb3e514fa4238e267" [[package]] name = "output_vt100" @@ -2724,7 +2724,7 @@ checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -2860,7 +2860,7 @@ dependencies = [ "proc-macro-error-attr", "proc-macro2", "quote", - "syn", + "syn 1.0.109", "version_check", ] @@ -2900,7 +2900,7 @@ dependencies = [ "proc-macro2", "proc-quote-impl", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -2931,7 +2931,7 @@ checksum = "16b845dbfca988fa33db069c0e230574d15a3088f147a87b64c7589eb662c9ac" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -3199,7 +3199,7 @@ checksum = "ff26ed6c7c4dfc2aa9480b86a60e3c7233543a270a680e10758a507c5a4ce476" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -3284,9 +3284,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.36.9" +version = "0.36.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd5c6ff11fecd55b40746d1995a02f2eb375bf8c00d192d521ee09f42bef37bc" +checksum = "2fe885c3a125aa45213b68cc1472a49880cb5923dc23f522ad2791b882228778" dependencies = [ "bitflags", "errno", @@ -3516,9 +3516,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.156" +version = "1.0.157" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "314b5b092c0ade17c00142951e50ced110ec27cea304b1037c6969246c2469a4" +checksum = "707de5fcf5df2b5788fca98dd7eab490bc2fd9b7ef1404defc462833b83f25ca" dependencies = [ "serde_derive", ] @@ -3555,13 +3555,13 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.156" +version = "1.0.157" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7e29c4601e36bcec74a223228dce795f4cd3616341a4af93520ca1a837c087d" +checksum = "78997f4555c22a7971214540c4a661291970619afd56de19f77e0de86296e1e5" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.2", ] [[package]] @@ -3631,7 +3631,7 @@ checksum = "b2acd6defeddb41eb60bb468f8825d0cfd0c2a76bc03bfd235b6a1dc4f6a1ad5" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -3808,7 +3808,7 @@ dependencies = [ "quote", "serde", "serde_derive", - "syn", + "syn 1.0.109", ] [[package]] @@ -3824,7 +3824,7 @@ dependencies = [ "serde_derive", "serde_json", "sha1", - "syn", + "syn 1.0.109", ] [[package]] @@ -3858,7 +3858,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn", + "syn 1.0.109", ] [[package]] @@ -3878,6 +3878,17 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "syn" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59d3276aee1fa0c33612917969b5172b5be2db051232a6e4826f1a1a9191b045" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + [[package]] name = "tar" version = "0.4.38" @@ -3975,7 +3986,7 @@ checksum = "38f0c854faeb68a048f0f2dc410c5ddae3bf83854ef0e4977d58306a5edef50e" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -4008,22 +4019,22 @@ checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" [[package]] name = "thiserror" -version = "1.0.39" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5ab016db510546d856297882807df8da66a16fb8c4101cb8b30054b0d5b2d9c" +checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.39" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5420d42e90af0c38c3290abcca25b9b3bdf379fc9f55c528f53a269d9c9a267e" +checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.2", ] [[package]] @@ -4098,7 +4109,7 @@ dependencies = [ "proc-macro2", "quote", "standback", - "syn", + "syn 1.0.109", ] [[package]] @@ -4167,7 +4178,7 @@ checksum = "d266c00fde287f55d3f1c3e96c500c362a2b8c695076ec180f27918820bc6df8" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -4258,7 +4269,7 @@ checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -4391,7 +4402,7 @@ checksum = "e60147782cc30833c05fba3bab1d9b5771b2685a2557672ac96fa5d154099c0e" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -4411,9 +4422,9 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.11" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524b68aca1d05e03fdf03fcdce2c6c94b6daf6d16861ddaa7e4f2b6638a9052c" +checksum = "7d502c968c6a838ead8e69b2ee18ec708802f99db92a0d156705ec9ef801993b" [[package]] name = "unicode-ident" @@ -4620,7 +4631,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bdeeb5c1170246de8425a3e123e7ef260dc05ba2b522a1d369fe2315376efea4" dependencies = [ "proc-macro2", - "syn", + "syn 1.0.109", "wai-bindgen-gen-core", "wai-bindgen-gen-rust-wasm", ] @@ -4646,7 +4657,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4b3488ed88d4dd0e3bf85bad4e27dac6cb31aae5d122a5dda2424803c8dc863a" dependencies = [ "proc-macro2", - "syn", + "syn 1.0.109", "wai-bindgen-gen-core", "wai-bindgen-gen-wasmer", ] @@ -4747,7 +4758,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn", + "syn 1.0.109", "wasm-bindgen-shared", ] @@ -4771,7 +4782,7 @@ checksum = "c5020cfa87c7cecefef118055d44e3c1fc122c7ec25701d528ee458a0b45f38f" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -4804,7 +4815,7 @@ checksum = "2aff81306fcac3c7515ad4e177f521b5c9a15f2b08f4e32d823066102f35a5f6" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -5216,7 +5227,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn", + "syn 1.0.109", "wasmer-types", ] diff --git a/lib/api/src/access.rs b/lib/api/src/access.rs index e1d5cc16c95..7d10348f139 100644 --- a/lib/api/src/access.rs +++ b/lib/api/src/access.rs @@ -118,7 +118,7 @@ pub(super) enum RefCow<'a, T> { impl<'a, T> AsRef for RefCow<'a, T> { fn as_ref(&self) -> &T { match self { - Self::Borrowed(val) => *val, + Self::Borrowed(val) => val, Self::Owned(val, _) => val, } } @@ -130,7 +130,7 @@ impl<'a, T> AsMut for RefCow<'a, T> { // not leak the bytes into the memory // https://stackoverflow.com/questions/61114026/does-stdptrwrite-transfer-the-uninitialized-ness-of-the-bytes-it-writes match self { - Self::Borrowed(val) => *val, + Self::Borrowed(val) => val, Self::Owned(val, modified) => { *modified = true; val diff --git a/lib/api/src/imports.rs b/lib/api/src/imports.rs index f50b2c2e7f7..344bc24e28f 100644 --- a/lib/api/src/imports.rs +++ b/lib/api/src/imports.rs @@ -140,6 +140,7 @@ impl Imports { /// Resolve and return a vector of imports in the order they are defined in the `module`'s source code. /// /// This means the returned `Vec` might be a subset of the imports contained in `self`. + #[allow(clippy::result_large_err)] pub fn imports_for_module(&self, module: &Module) -> Result, LinkError> { let mut ret = vec![]; for import in module.imports() { diff --git a/lib/api/src/instance.rs b/lib/api/src/instance.rs index a43d896355d..576256a3d7e 100644 --- a/lib/api/src/instance.rs +++ b/lib/api/src/instance.rs @@ -58,6 +58,7 @@ impl Instance { /// Those are, as defined by the spec: /// * Link errors that happen when plugging the imports into the instance /// * Runtime errors that happen when running the module `start` function. + #[allow(clippy::result_large_err)] pub fn new( store: &mut impl AsStoreMut, module: &Module, @@ -81,6 +82,7 @@ impl Instance { /// Those are, as defined by the spec: /// * Link errors that happen when plugging the imports into the instance /// * Runtime errors that happen when running the module `start` function. + #[allow(clippy::result_large_err)] pub fn new_by_index( store: &mut impl AsStoreMut, module: &Module, diff --git a/lib/api/src/sys/instance.rs b/lib/api/src/sys/instance.rs index 3b8396d11b4..0b5060a2853 100644 --- a/lib/api/src/sys/instance.rs +++ b/lib/api/src/sys/instance.rs @@ -37,6 +37,7 @@ impl From for InstantiationError { } impl Instance { + #[allow(clippy::result_large_err)] pub(crate) fn new( store: &mut impl AsStoreMut, module: &Module, @@ -55,6 +56,7 @@ impl Instance { Ok((instance, exports)) } + #[allow(clippy::result_large_err)] pub(crate) fn new_by_index( store: &mut impl AsStoreMut, module: &Module, diff --git a/lib/api/src/sys/module.rs b/lib/api/src/sys/module.rs index 289cc6b4a73..c3b625be603 100644 --- a/lib/api/src/sys/module.rs +++ b/lib/api/src/sys/module.rs @@ -95,6 +95,7 @@ impl Module { Self { artifact } } + #[allow(clippy::result_large_err)] pub(crate) fn instantiate( &self, store: &mut impl AsStoreMut, diff --git a/lib/cache/src/hash.rs b/lib/cache/src/hash.rs index 29e7fa7ce65..2a4b6fb7b5a 100644 --- a/lib/cache/src/hash.rs +++ b/lib/cache/src/hash.rs @@ -31,7 +31,7 @@ impl ToString for Hash { /// Create the hexadecimal representation of the /// stored hash. fn to_string(&self) -> String { - hex::encode(&self.to_array()) + hex::encode(self.to_array()) } } diff --git a/lib/cli/build.rs b/lib/cli/build.rs index b5e0f8550b6..3691225adf1 100644 --- a/lib/cli/build.rs +++ b/lib/cli/build.rs @@ -4,7 +4,7 @@ use std::process::Command; pub fn main() { // Set WASMER_GIT_HASH let git_hash = Command::new("git") - .args(&["rev-parse", "HEAD"]) + .args(["rev-parse", "HEAD"]) .output() .ok() .and_then(|output| String::from_utf8(output.stdout).ok()) diff --git a/lib/cli/src/commands/create_exe.rs b/lib/cli/src/commands/create_exe.rs index 3ea8882054a..0a8c272af9a 100644 --- a/lib/cli/src/commands/create_exe.rs +++ b/lib/cli/src/commands/create_exe.rs @@ -826,7 +826,7 @@ fn write_volume_obj( object_name, )?; - let mut writer = BufWriter::new(File::create(&output_path)?); + let mut writer = BufWriter::new(File::create(output_path)?); volumes_object .write_stream(&mut writer) .map_err(|err| anyhow::anyhow!(err.to_string()))?; @@ -1136,7 +1136,7 @@ fn link_exe_from_dir( .as_ref() .ok_or_else(|| anyhow::anyhow!("could not find zig in $PATH {}", directory.display()))?; - let mut cmd = Command::new(&zig_binary_path); + let mut cmd = Command::new(zig_binary_path); cmd.arg("build-exe"); cmd.arg("--verbose-cc"); cmd.arg("--verbose-link"); @@ -1796,7 +1796,7 @@ pub(super) mod utils { let path_var = std::env::var("PATH").unwrap_or_default(); #[cfg(unix)] let system_path_var = std::process::Command::new("getconf") - .args(&["PATH"]) + .args(["PATH"]) .output() .map(|output| output.stdout) .unwrap_or_default(); @@ -2189,7 +2189,7 @@ mod http_fetch { pub(crate) fn list_dir(target: &Path) -> Vec { use walkdir::WalkDir; - WalkDir::new(&target) + WalkDir::new(target) .into_iter() .filter_map(|e| e.ok()) .map(|entry| entry.path().to_path_buf()) diff --git a/lib/cli/src/commands/init.rs b/lib/cli/src/commands/init.rs index 16ec43d89cb..47624f41489 100644 --- a/lib/cli/src/commands/init.rs +++ b/lib/cli/src/commands/init.rs @@ -161,7 +161,7 @@ impl Init { .collect::>() .join(NEWLINE); - std::fs::write(&path, &toml_string) + std::fs::write(path, &toml_string) .with_context(|| format!("Unable to write to \"{}\"", path.display()))?; Ok(()) @@ -494,7 +494,7 @@ fn construct_manifest( } fn parse_cargo_toml(manifest_path: &PathBuf) -> Result { let mut metadata = MetadataCommand::new(); - metadata.manifest_path(&manifest_path); + metadata.manifest_path(manifest_path); metadata.no_deps(); metadata.features(CargoOpt::AllFeatures); diff --git a/lib/cli/src/commands/publish.rs b/lib/cli/src/commands/publish.rs index 145092bc472..192db4e0cb4 100644 --- a/lib/cli/src/commands/publish.rs +++ b/lib/cli/src/commands/publish.rs @@ -247,7 +247,7 @@ fn append_path_to_tar_gz( .metadata() .map_err(|e| (normalized_path.clone(), e))?; builder - .append_path_with_name(&normalized_path, &target_path) + .append_path_with_name(&normalized_path, target_path) .map_err(|e| (normalized_path.clone(), e))?; Ok(normalized_path) } @@ -386,7 +386,7 @@ fn apply_migration(conn: &mut Connection, migration_number: i32) -> Result<(), M tx.execute_batch(migration_to_apply) .map_err(|e| MigrationError::TransactionFailed(migration_number, format!("{}", e)))?; - tx.pragma_update(None, "user_version", &(migration_number + 1)) + tx.pragma_update(None, "user_version", migration_number + 1) .map_err(|e| MigrationError::TransactionFailed(migration_number, format!("{}", e)))?; tx.commit() .map_err(|_| MigrationError::CommitFailed(migration_number)) diff --git a/lib/cli/src/commands/run.rs b/lib/cli/src/commands/run.rs index 610637558b1..7d97de7dd43 100644 --- a/lib/cli/src/commands/run.rs +++ b/lib/cli/src/commands/run.rs @@ -141,7 +141,7 @@ impl RunWithPathBuf { let default = indexmap::IndexMap::default(); let fs = manifest.fs.as_ref().unwrap_or(&default); for (alias, real_dir) in fs.iter() { - let real_dir = self_clone.path.join(&real_dir); + let real_dir = self_clone.path.join(real_dir); if !real_dir.exists() { #[cfg(feature = "debug")] if self_clone.debug { diff --git a/lib/compiler-cranelift/src/config.rs b/lib/compiler-cranelift/src/config.rs index 3768a96f2b3..f19f29dd55c 100644 --- a/lib/compiler-cranelift/src/config.rs +++ b/lib/compiler-cranelift/src/config.rs @@ -117,11 +117,7 @@ impl Cranelift { builder.enable("has_lzcnt").expect("should be valid flag"); } - let is_riscv = if let Architecture::Riscv64(_) = target.triple().architecture { - true - } else { - false - }; + let is_riscv = matches!(target.triple().architecture, Architecture::Riscv64(_)); builder.finish(self.flags(is_riscv)) } diff --git a/lib/compiler-llvm/src/abi/aarch64_systemv.rs b/lib/compiler-llvm/src/abi/aarch64_systemv.rs index 89e07a80cec..04fa4514d10 100644 --- a/lib/compiler-llvm/src/abi/aarch64_systemv.rs +++ b/lib/compiler-llvm/src/abi/aarch64_systemv.rs @@ -21,19 +21,14 @@ impl Abi for Aarch64SystemV { // Given a function definition, retrieve the parameter that is the vmctx pointer. fn get_vmctx_ptr_param<'ctx>(&self, func_value: &FunctionValue<'ctx>) -> PointerValue<'ctx> { func_value - .get_nth_param( - if func_value + .get_nth_param(u32::from( + func_value .get_enum_attribute( AttributeLoc::Param(0), Attribute::get_named_enum_kind_id("sret"), ) - .is_some() - { - 1 - } else { - 0 - }, - ) + .is_some(), + )) .unwrap() .into_pointer_value() } diff --git a/lib/compiler-llvm/src/abi/x86_64_systemv.rs b/lib/compiler-llvm/src/abi/x86_64_systemv.rs index bf02a1f4591..0d186715ee9 100644 --- a/lib/compiler-llvm/src/abi/x86_64_systemv.rs +++ b/lib/compiler-llvm/src/abi/x86_64_systemv.rs @@ -23,19 +23,14 @@ impl Abi for X86_64SystemV { // Given a function definition, retrieve the parameter that is the vmctx pointer. fn get_vmctx_ptr_param<'ctx>(&self, func_value: &FunctionValue<'ctx>) -> PointerValue<'ctx> { func_value - .get_nth_param( - if func_value + .get_nth_param(u32::from( + func_value .get_enum_attribute( AttributeLoc::Param(0), Attribute::get_named_enum_kind_id("sret"), ) - .is_some() - { - 1 - } else { - 0 - }, - ) + .is_some(), + )) .unwrap() .into_pointer_value() } diff --git a/lib/compiler/src/engine/artifact.rs b/lib/compiler/src/engine/artifact.rs index b8284c242b7..6c20b397686 100644 --- a/lib/compiler/src/engine/artifact.rs +++ b/lib/compiler/src/engine/artifact.rs @@ -420,6 +420,7 @@ impl Artifact { } /// Do preinstantiation logic that is executed before instantiating + #[allow(clippy::result_large_err)] pub fn preinstantiate(&self) -> Result<(), InstantiationError> { Ok(()) } diff --git a/lib/compiler/src/engine/resolver.rs b/lib/compiler/src/engine/resolver.rs index 9fac5fc0aec..e4699370bd0 100644 --- a/lib/compiler/src/engine/resolver.rs +++ b/lib/compiler/src/engine/resolver.rs @@ -60,6 +60,7 @@ fn get_runtime_size(context: &StoreObjects, extern_: &VMExtern) -> Option { /// a `Resolver`. /// /// If all imports are satisfied returns an `Imports` instance required for a module instantiation. +#[allow(clippy::result_large_err)] pub fn resolve_imports( module: &ModuleInfo, imports: &[VMExtern], diff --git a/lib/registry/src/lib.rs b/lib/registry/src/lib.rs index 4bd8764ae92..632e753dec2 100644 --- a/lib/registry/src/lib.rs +++ b/lib/registry/src/lib.rs @@ -475,7 +475,7 @@ pub fn try_unpack_targz>( ) }) } else { - ar.unpack(&target_path).map_err(|e| { + ar.unpack(target_path).map_err(|e| { anyhow::anyhow!( "failed to unpack (with parent) {}: {e}", target_targz_path.display() diff --git a/lib/vfs/src/webc_fs.rs b/lib/vfs/src/webc_fs.rs index 11db43c7eff..9f2f55006b1 100644 --- a/lib/vfs/src/webc_fs.rs +++ b/lib/vfs/src/webc_fs.rs @@ -85,7 +85,8 @@ where ) -> Result, FsError> { match get_volume_name_opt(path) { Some(volume) => { - let file = (*self.webc) + let file = self + .webc .volumes .get(&volume) .ok_or(FsError::EntryNotFound)? diff --git a/lib/wasi/src/lib.rs b/lib/wasi/src/lib.rs index f7d9409bbe0..6e898482277 100644 --- a/lib/wasi/src/lib.rs +++ b/lib/wasi/src/lib.rs @@ -258,6 +258,7 @@ impl WasiRuntimeError { } } +#[allow(clippy::result_large_err)] pub(crate) fn run_wasi_func( func: &wasmer::Function, store: &mut impl AsStoreMut, @@ -279,6 +280,7 @@ pub(crate) fn run_wasi_func( /// The function will not receive arguments or return values. /// /// An exit code that is not 0 will be returned as a `WasiError::Exit`. +#[allow(clippy::result_large_err)] pub(crate) fn run_wasi_func_start( func: &wasmer::Function, store: &mut impl AsStoreMut, diff --git a/lib/wasi/src/state/builder.rs b/lib/wasi/src/state/builder.rs index 54e099ba65d..652b80b7ee4 100644 --- a/lib/wasi/src/state/builder.rs +++ b/lib/wasi/src/state/builder.rs @@ -756,6 +756,7 @@ impl WasiEnvBuilder { Ok(init) } + #[allow(clippy::result_large_err)] pub fn build(self) -> Result { let init = self.build_init()?; WasiEnv::from_init(init) @@ -766,6 +767,7 @@ impl WasiEnvBuilder { /// NOTE: you still must call [`WasiFunctionEnv::initialize`] to make an /// instance usable. #[doc(hidden)] + #[allow(clippy::result_large_err)] pub fn finalize( self, store: &mut impl AsStoreMut, @@ -781,6 +783,7 @@ impl WasiEnvBuilder { /// /// Returns the error from `WasiFs::new` if there's an error // FIXME: use a proper custom error type + #[allow(clippy::result_large_err)] pub fn instantiate( self, module: Module, @@ -790,11 +793,13 @@ impl WasiEnvBuilder { WasiEnv::instantiate(init, module, store) } + #[allow(clippy::result_large_err)] pub fn run(self, module: Module) -> Result<(), WasiRuntimeError> { let mut store = wasmer::Store::default(); self.run_with_store(module, &mut store) } + #[allow(clippy::result_large_err)] pub fn run_with_store( self, module: Module, diff --git a/lib/wasi/src/state/env.rs b/lib/wasi/src/state/env.rs index f0911bea6fb..8bd592515cf 100644 --- a/lib/wasi/src/state/env.rs +++ b/lib/wasi/src/state/env.rs @@ -377,6 +377,7 @@ impl WasiEnv { self.thread.tid() } + #[allow(clippy::result_large_err)] pub(crate) fn from_init(init: WasiEnvInit) -> Result { let process = if let Some(p) = init.process { p @@ -417,6 +418,7 @@ impl WasiEnv { } // FIXME: use custom error type + #[allow(clippy::result_large_err)] pub(crate) fn instantiate( mut init: WasiEnvInit, module: Module, diff --git a/lib/wasi/src/syscalls/wasi/environ_get.rs b/lib/wasi/src/syscalls/wasi/environ_get.rs index 3db40af1828..35425551c5d 100644 --- a/lib/wasi/src/syscalls/wasi/environ_get.rs +++ b/lib/wasi/src/syscalls/wasi/environ_get.rs @@ -18,5 +18,5 @@ pub fn environ_get( let env = ctx.data(); let (memory, mut state) = env.get_memory_and_wasi_state(&ctx, 0); - write_buffer_array(&memory, &*state.envs, environ, environ_buf) + write_buffer_array(&memory, &state.envs, environ, environ_buf) } diff --git a/lib/wasi/src/syscalls/wasi/path_rename.rs b/lib/wasi/src/syscalls/wasi/path_rename.rs index 3eb34a7302d..316fec63ffa 100644 --- a/lib/wasi/src/syscalls/wasi/path_rename.rs +++ b/lib/wasi/src/syscalls/wasi/path_rename.rs @@ -121,7 +121,7 @@ pub fn path_rename( // implements the logic of "I'm not actually a file, I'll try to be as needed". let result = if let Some(h) = handle { drop(guard); - state.fs_rename(&source_path, &host_adjusted_target_path) + state.fs_rename(source_path, &host_adjusted_target_path) } else { let path_clone = path.clone(); drop(guard); diff --git a/tests/lib/wast/src/wast.rs b/tests/lib/wast/src/wast.rs index 50bc02b3883..80b02adc276 100644 --- a/tests/lib/wast/src/wast.rs +++ b/tests/lib/wast/src/wast.rs @@ -437,7 +437,7 @@ impl Wast { // Checks if the `assert_unlinkable` message matches the expected one fn matches_message_assert_unlinkable(expected: &str, actual: &str) -> bool { - actual.contains(&expected) + actual.contains(expected) } // Checks if the `assert_invalid` message matches the expected one From dca7bf2cd9be535014d5bc1fb9d6da21139392a4 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Tue, 21 Mar 2023 10:37:55 +0100 Subject: [PATCH 13/17] Taken review remarks into account --- Makefile | 2 +- lib/compiler-cranelift/src/config.rs | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 9d1b11e5a1d..e6f820d3519 100644 --- a/Makefile +++ b/Makefile @@ -19,7 +19,7 @@ SHELL=/usr/bin/env bash # # Here is what works and what doesn't: # -# * Cranelift works everywhere except Linux/`riscv`, +# * Cranelift works everywhere, # # * LLVM works on Linux+Darwin/`amd64`, # and linux+`aarch64`, linux+`riscv` diff --git a/lib/compiler-cranelift/src/config.rs b/lib/compiler-cranelift/src/config.rs index f19f29dd55c..d990d59c849 100644 --- a/lib/compiler-cranelift/src/config.rs +++ b/lib/compiler-cranelift/src/config.rs @@ -117,13 +117,12 @@ impl Cranelift { builder.enable("has_lzcnt").expect("should be valid flag"); } - let is_riscv = matches!(target.triple().architecture, Architecture::Riscv64(_)); - - builder.finish(self.flags(is_riscv)) + builder.finish(self.flags(target)) } /// Generates the flags for the compiler - pub fn flags(&self, is_riscv: bool) -> settings::Flags { + pub fn flags(&self, target: &Target) -> settings::Flags { + let is_riscv = matches!(target.triple().architecture, Architecture::Riscv64(_)); let mut flags = settings::builder(); // Enable probestack From 45e9c1efd8c3b7beee55c863e149421d25e9ff21 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Tue, 21 Mar 2023 12:19:46 +0000 Subject: [PATCH 14/17] Removed change from deny.toml, it's not needed anymore --- deny.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deny.toml b/deny.toml index 58712962676..e8382d45698 100644 --- a/deny.toml +++ b/deny.toml @@ -214,9 +214,9 @@ allow-registry = ["https://github.com/rust-lang/crates.io-index"] # List of URLs for allowed Git repositories allow-git = [] -[sources.allow-org] +#[sources.allow-org] # 1 or more github.com organizations to allow git sources for -github = ["TheDan64"] +#github = [""] # 1 or more gitlab.com organizations to allow git sources for #gitlab = [""] # 1 or more bitbucket.org organizations to allow git sources for From 3f5f6d98733c7a7e137196e9e0aab7a7d24ec74a Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Tue, 21 Mar 2023 14:08:00 +0000 Subject: [PATCH 15/17] Added some more comment about llvm abi hack --- lib/compiler-llvm/src/config.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/compiler-llvm/src/config.rs b/lib/compiler-llvm/src/config.rs index ee12cc0133b..928dd9fe53b 100644 --- a/lib/compiler-llvm/src/config.rs +++ b/lib/compiler-llvm/src/config.rs @@ -215,9 +215,19 @@ impl LLVM { if let Architecture::Riscv64(_) = triple.architecture { // TODO: totally non-portable way to change ABI unsafe { + // This structure mimic the internal structure from inkwell + // that is defined as + // #[derive(Debug)] + // pub struct TargetMachine { + // pub(crate) target_machine: LLVMTargetMachineRef, + // } pub struct MyTargetMachine { pub target_machine: *const u8, } + // It is use to live patch the create LLVMTargetMachine + // to hard change the ABI and force "-mabi=lp64d" ABI + // instead of the default that don't use float registers + // because there is no current way to do this change let my_target_machine: MyTargetMachine = std::mem::transmute(llvm_target_machine); From 606787fda34e3cf858e925a2340a153ed2978e6b Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Tue, 21 Mar 2023 14:21:44 +0000 Subject: [PATCH 16/17] Added doc about current state of RISCV support --- docs/RISCV.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100755 docs/RISCV.md diff --git a/docs/RISCV.md b/docs/RISCV.md new file mode 100755 index 00000000000..0cd470a5c95 --- /dev/null +++ b/docs/RISCV.md @@ -0,0 +1,12 @@ +# Current state of the RISCV support + +Only Cranelift and LLVM compiler are supported. +Singlepass can be done, but no ressources are allocated on this task for now. + +Both LLVM and Cranelift support are quite new, and so it is expected to have a few things not working well. + +LLVM code needs a hack to force the ABI to "lp64d", and some tested with funciton & float/double values are still not working correctly and have be disable for now. + +On Cranelift, SIMD is not supported as the CPU doesn't have official SIMD/Vector extension for now, and no Workaround is in place. + +Test have be conducted on actual hardware, with a Vision Fixe 2 board running Debian. Some previous tests have also be done on a Vison Five 1 running Fedora (with LLVM only). \ No newline at end of file From ba660e6f9d5305c46fc70ba817c39efcb3cd1b4d Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Wed, 22 Mar 2023 14:20:45 +0100 Subject: [PATCH 17/17] Fixed (newer) linter --- lib/cache/src/hash.rs | 2 +- lib/cli/src/commands/run.rs | 2 +- lib/cli/src/commands/run_unstable.rs | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/cache/src/hash.rs b/lib/cache/src/hash.rs index 8c202ef6185..5a088dc5a03 100644 --- a/lib/cache/src/hash.rs +++ b/lib/cache/src/hash.rs @@ -32,7 +32,7 @@ impl Display for Hash { fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { let mut buffer = [0_u8; 64]; - hex::encode_to_slice(&self.0, &mut buffer) + hex::encode_to_slice(self.0, &mut buffer) .expect("Can never fail with a hard-coded buffer length"); let s = std::str::from_utf8(&buffer).map_err(|_| fmt::Error)?; diff --git a/lib/cli/src/commands/run.rs b/lib/cli/src/commands/run.rs index 10c9fb9cfb7..7a795ef86ef 100644 --- a/lib/cli/src/commands/run.rs +++ b/lib/cli/src/commands/run.rs @@ -125,7 +125,7 @@ impl RunWithPathBuf { let default = indexmap::IndexMap::default(); let fs = manifest.fs.as_ref().unwrap_or(&default); for (alias, real_dir) in fs.iter() { - let real_dir = self_clone.path.join(&real_dir); + let real_dir = self_clone.path.join(real_dir); if !real_dir.exists() { #[cfg(feature = "debug")] if self_clone.debug { diff --git a/lib/cli/src/commands/run_unstable.rs b/lib/cli/src/commands/run_unstable.rs index 0bdda35bbc1..8ef2b98b813 100644 --- a/lib/cli/src/commands/run_unstable.rs +++ b/lib/cli/src/commands/run_unstable.rs @@ -464,7 +464,7 @@ impl TargetOnDisk { Ok(ExecutableTarget::Webc(container)) } TargetOnDisk::WebAssemblyBinary(path) => { - let wasm = std::fs::read(&path) + let wasm = std::fs::read(path) .with_context(|| format!("Unable to read \"{}\"", path.display()))?; let module = compile_wasm_cached(path, &wasm, cache, store)?; Ok(ExecutableTarget::WebAssembly(module)) @@ -566,7 +566,7 @@ fn generate_coredump(err: &Error, source: &Path, coredump_path: &Path) -> Result .map_err(Error::msg) .context("Coredump serializing failed")?; - std::fs::write(&coredump_path, &coredump).with_context(|| { + std::fs::write(coredump_path, &coredump).with_context(|| { format!( "Unable to save the coredump to \"{}\"", coredump_path.display()