diff --git a/mingw-w64-wasmer/.gitignore b/mingw-w64-wasmer/.gitignore index 13a97f0019179..f7b2d066f7366 100644 --- a/mingw-w64-wasmer/.gitignore +++ b/mingw-w64-wasmer/.gitignore @@ -1 +1,2 @@ /wasmer +/corosensei-fix-compilation.patch diff --git a/mingw-w64-wasmer/PKGBUILD b/mingw-w64-wasmer/PKGBUILD index 8e34e83f01383..95d6734fdbf4c 100644 --- a/mingw-w64-wasmer/PKGBUILD +++ b/mingw-w64-wasmer/PKGBUILD @@ -2,10 +2,11 @@ _realname=wasmer pkgbase=mingw-w64-${_realname} -pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}" +pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}" + "${MINGW_PACKAGE_PREFIX}-lib${_realname}") pkgver=4.4.0 -pkgrel=1 -pkgdesc="Universal Binaries Powered by WebAssembly (mingw-w64)" +pkgrel=2 +pkgdesc="The leading Wasm Runtime supporting WASIX, WASI and Emscripten (mingw-w64)" arch=('any') mingw_arch=('ucrt64' 'clang64') url="https://github.com/wasmerio/wasmer" @@ -18,15 +19,13 @@ makedepends=("${MINGW_PACKAGE_PREFIX}-rust" 'git') options=('!lto') source=("git+${url}.git#tag=v${pkgver}" - "corosensei.tar.gz::https://crates.io/api/v1/crates/corosensei/0.1.4/download" "tun-tap.tar.gz::https://crates.io/api/v1/crates/tun-tap/0.1.4/download" - "corosensei-fix-compilation.patch" + "corosensei-fix-compilation.patch::${url}/commit/688cf64faba9c2420829cfbe94c0835c097c507c.patch" "tun-tap-update-tokio.patch" "reproducible-builds.patch") sha256sums=('1ab4b4b98cd1442b8b23336f78f7e0f2e167985bd50c5f923dbc6eeee56a9d1d' - '80128832c58ea9cbd041d2a759ec449224487b2c1e400453d99d244eead87a8e' '9a477a4e9367c72ac875d23cd07ac99ffa932497d8428767fed0cfa27bbabe50' - '1636cded85171dc138c68e81336823e2db1e269e744c428426ab05157b41cf34' + '9b9264dffa90e10bfd098b0c8fab9183b7676809a9a8019dc779a64ece0d7bb6' '684f6a479385e3646b82d5d6588d9290a78708a59dec4aab7af76a0f23aaa249' '7f08b41e0077a23b16eb2e9410ac953b293d1eeeaf1b83915a596ac437f81125') @@ -38,17 +37,16 @@ prepare() { # update old dependencies in corosensei and tun-tap crates so outdated winapi@0.2.8, # kernel32-sys, ws2_32-sys and windows-sys@0.33.0 are dropped; fix compile error in corosensei mv -f ../tun-tap-0.1.4/Cargo.toml.orig ../tun-tap-0.1.4/Cargo.toml - mv -f ../corosensei-0.1.4/Cargo.toml.orig ../corosensei-0.1.4/Cargo.toml - patch -d ../corosensei-0.1.4 -Np1 -i "../corosensei-fix-compilation.patch" + # https://github.com/wasmerio/wasmer/commit/688cf64faba9c2420829cfbe94c0835c097c507c + patch -Np1 -i "../corosensei-fix-compilation.patch" patch -d ../tun-tap-0.1.4 -Np1 -i "../tun-tap-update-tokio.patch" cat >> Cargo.toml < - // point to "0". We use an intermediate constant here to work around a - // limitation of LLVM's Intel syntax parser which doesn't support 2 - // symbols in an expression. -- ".equ .Loffset_yield, 0f - 2b", -+ ".equ .Loffset_yield, 3f - 2b", - "add dword ptr [esp], offset .Loffset_yield", - - // Save our stack pointer to EDX, which is then returned out of -@@ -325,7 +325,7 @@ pub unsafe fn switch_yield(arg: EncodedValue, parent_link: *mut StackPointer) -> - // - EAX points to the top of our stack. - // - EDX points to the base of our stack. - // - ECX contains the argument passed from switch_and_link. -- "0:", -+ "3:", - - // Save the EBP of the parent context to the parent stack. - "push ebp", -@@ -402,7 +402,7 @@ pub unsafe fn switch_and_throw( - // about how this code works. - "call 2f", - "2:", -- ".equ .Loffset_throw, 0f - 2b", -+ ".equ .Loffset_throw, 3f - 2b", - "add dword ptr [esp], offset .Loffset_throw", - - // Save EBP of the parent context. -@@ -437,7 +437,7 @@ pub unsafe fn switch_and_throw( - - // Upon returning, our register state is just like a normal return into - // switch_and_link(). -- "0:", -+ "3:", - - // Restore registers just like the second half of switch_and_link. - "pop esi", ---- a/src/arch/x86_64.rs -+++ b/src/arch/x86_64.rs -@@ -345,7 +345,7 @@ pub unsafe fn switch_and_link( - // Push a return address onto our stack and then jump to the return - // address at the top of the coroutine stack. - // -- // From here on execution continues in stack_init_trampoline or the 0: -+ // From here on execution continues in stack_init_trampoline or the 2: - // label in switch_yield. - "call [rdx]", - -@@ -423,7 +423,7 @@ pub unsafe fn switch_yield(arg: EncodedValue, parent_link: *mut StackPointer) -> - - // Push a return address on the stack. This is the address that will be - // called by switch_and_link() the next time this context is resumed. -- "lea rax, [rip + 0f]", -+ "lea rax, [rip + 2f]", - "push rax", - - // Save our stack pointer to RSI, which is then returned out of -@@ -458,7 +458,7 @@ pub unsafe fn switch_yield(arg: EncodedValue, parent_link: *mut StackPointer) -> - // - RDX points to the top of our stack, including the return address. - // - RSI points to the base of our stack. - // - RDI contains the argument passed from switch_and_link. -- "0:", -+ "2:", - - // Save the RBP of the parent context to the parent stack. When combined - // with the return address this forms a valid frame record (RBP & RIP) -@@ -554,7 +554,7 @@ pub unsafe fn switch_and_throw( - "push rbx", - - // Push a return address to the stack. -- "lea rax, [rip + 0f]", -+ "lea rax, [rip + 2f]", - "push rax", - - // Save RBP of the parent context. -@@ -589,7 +589,7 @@ pub unsafe fn switch_and_throw( - - // Upon returning, our register state is just like a normal return into - // switch_and_link(). -- "0:", -+ "2:", - - // Restore registers just like the second half of switch_and_link. - "pop rbx", ---- a/src/arch/x86_64_windows.rs -+++ b/src/arch/x86_64_windows.rs -@@ -330,7 +330,7 @@ pub unsafe fn switch_and_link( - asm_may_unwind_root!( - // Set up a secondary copy of the return address. This is only used by - // the unwinder, not by actual returns. -- "lea rax, [rip + 0f]", -+ "lea rax, [rip + 2f]", - "push rax", - - // Save the TEB fields to the stack. -@@ -345,7 +345,7 @@ pub unsafe fn switch_and_link( - // Push a return address onto our stack and then jump to the return - // address at the top of the coroutine stack. - // -- // From here on execution continues in stack_init_trampoline or the 0: -+ // From here on execution continues in stack_init_trampoline or the 2: - // label in switch_yield. - "call [rdx]", - -@@ -354,7 +354,7 @@ pub unsafe fn switch_and_link( - // - RSI: The top of the coroutine stack, or 0 if coming from - // switch_and_reset. - // - RDI: The argument passed from the coroutine. -- "0:", -+ "2:", - - "pop rbx", - -@@ -405,7 +405,7 @@ pub unsafe fn switch_yield(arg: EncodedValue, parent_link: *mut StackPointer) -> - - // Push a return address on the stack. This is the address that will be - // called by switch_and_link() the next time this context is resumed. -- "lea rax, [rip + 0f]", -+ "lea rax, [rip + 2f]", - "push rax", - - // Save our stack pointer to RSI, which is then returned out of -@@ -429,7 +429,7 @@ pub unsafe fn switch_yield(arg: EncodedValue, parent_link: *mut StackPointer) -> - // - RDX points to the top of our stack, including the return address. - // - RSI points to the base of our stack. - // - RDI contains the argument passed from switch_and_link. -- "0:", -+ "2:", - - // Save RBP from the parent context last to create a valid frame record. - "push rbp", -@@ -513,7 +513,7 @@ pub unsafe fn switch_and_throw( - - asm_may_unwind_root!( - // Save state just like the first half of switch_and_link(). -- "lea rax, [rip + 0f]", -+ "lea rax, [rip + 2f]", - "push rax", - "push qword ptr gs:[0x1748]", // GuaranteedStackBytes - "push qword ptr gs:[0x1478]", // DeallocationStack -@@ -556,7 +556,7 @@ pub unsafe fn switch_and_throw( - - // Upon returning, our register state is just like a normal return into - // switch_and_link(). -- "0:", -+ "2", - - // This is copied from the second half of switch_and_link(). - "pop rbx", ---- a/src/arch/x86_windows.rs -+++ b/src/arch/x86_windows.rs -@@ -411,7 +411,7 @@ pub unsafe fn switch_and_link( - // Push a return address onto our stack and then jump to the return - // address at the top of the coroutine stack. - // -- // From here on execution continues in stack_init_trampoline or the 0: -+ // From here on execution continues in stack_init_trampoline or the 3: - // label in switch_yield. - "call [eax]", - -@@ -420,7 +420,6 @@ pub unsafe fn switch_and_link( - // - EDX: The top of the coroutine stack, or 0 if coming from - // switch_and_reset. - // - ECX: The argument passed from the coroutine. -- "0:", - - "pop esi", - -@@ -480,7 +479,7 @@ pub unsafe fn switch_yield(arg: EncodedValue, parent_link: *mut StackPointer) -> - // point to "0". We use an intermediate constant here to work around a - // limitation of LLVM's Intel syntax parser which doesn't support 2 - // symbols in an expression. -- ".equ .Loffset_yield, 0f - 2b", -+ ".equ .Loffset_yield, 3f - 2b", - "add dword ptr [esp], offset .Loffset_yield", - - // Save our stack pointer to EDX, which is then returned out of -@@ -514,7 +513,7 @@ pub unsafe fn switch_yield(arg: EncodedValue, parent_link: *mut StackPointer) -> - // - EAX points to the top of our stack. - // - EDX points to the base of our stack. - // - ECX contains the argument passed from switch_and_link. -- "0:", -+ "3:", - - // Save the EBP of the parent context to the parent stack. - "push ebp", -@@ -611,7 +610,7 @@ pub unsafe fn switch_and_throw( - // about how this code works. - "call 2f", - "2:", -- ".equ .Loffset_throw, 0f - 2b", -+ ".equ .Loffset_throw, 3f - 2b", - "add dword ptr [esp], offset .Loffset_throw", - - // Save EBP of the parent context. -@@ -645,7 +644,7 @@ pub unsafe fn switch_and_throw( - - // Upon returning, our register state is just like a normal return into - // switch_and_link(). -- "0:", -+ "3:", - - // This is copied from the second half of switch_and_link(). - "pop esi", diff --git a/mingw-w64-wasmtime/PKGBUILD b/mingw-w64-wasmtime/PKGBUILD index eab8be4a61094..d68f22399499a 100644 --- a/mingw-w64-wasmtime/PKGBUILD +++ b/mingw-w64-wasmtime/PKGBUILD @@ -6,7 +6,7 @@ pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}" "${MINGW_PACKAGE_PREFIX}-lib${_realname}" "${MINGW_PACKAGE_PREFIX}-${_realname}-docs") pkgver=25.0.1 -pkgrel=5 +pkgrel=6 pkgdesc="A fast and secure runtime for WebAssembly (mingw-w64)" arch=('any') mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64') @@ -111,6 +111,7 @@ package_wasmtime() { package_libwasmtime() { pkgdesc+=' (C-API)' + conflicts=("${MINGW_PACKAGE_PREFIX}-libwasmer") DESTDIR="${pkgdir}" cmake --install "build-${MSYSTEM}-static" DESTDIR="${pkgdir}" cmake --install "build-${MSYSTEM}-shared"