From nobody Wed Oct 4 20:02:57 2023 X-Original-To: dev-commits-ports-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4S15G96GwSz4w4k6; Wed, 4 Oct 2023 20:02:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4S15G95nmhz4GKg; Wed, 4 Oct 2023 20:02:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1696449777; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zmY7uPjxPKSQNYeMql5qo1ESv2RpHqxp1kz0s/Ko8Hc=; b=e4UC9AsZySeI3bx4jmf/3Z9q+hlc1sVmUC8GtwskUoFXFLUvGs79E++L8aTtwHrWzl9BPt 4uFL8paUWMclgCe0ewtd/ibr4nVEQbqhZFw9S002mPtJI0T1X+/5Odp0ELv/TEohJ+vsrf CKVem7tiiToQEaQqFhcVn4rXT+k0LTfiqjBR3OI6DG1wrER6E5ftlZF7IrxKp3sfHCfPF+ zQz3IOvf6P84mG+xHLdB3qicuvDVHDyf30WFmQuLUQi045/UUu/7/cBCMbJRgkwfxaZrYC QXjnXe/pjupC0phVX21ZNppRa61C3hHbQOoAM04boLKXUVQ886gQ775VG906Ug== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1696449777; a=rsa-sha256; cv=none; b=tvPBEvOMGgd09r4VrWDgQq04FY2T26cNimLGb1LoEfGv31IIksFd73ptdUOIeBylAf7GSf UfTy8yb9aodjyUPeyfkFGDco+RUTwBshfSzLezPUFYYNn70jvoElsUThlh/dRprSinGzJT T//DhloA+zK8sVAyf1chZGF18F3teHbfhcDBDJCuG0cj2pKJXxcXMMP8JPMRHiRQmUgw6x mJL2JK1mrvWOvbnotLvYVp5Frz7KUKc8Iq/yTAcbu0hCN3oc6nBQ5JBfuONOHANEigSEzi oKn7zPoREIYvNo27q7KCcUW9JJFybXm9xmBbhc2YkzKS7ZXQCD+a/pa058ktYw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1696449777; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zmY7uPjxPKSQNYeMql5qo1ESv2RpHqxp1kz0s/Ko8Hc=; b=prSE/zJ2JBWOqgtfQN0rPR5VAT/9Bc8h9OYfshfLEBy/WqCwlpB1GwvnhByzDar4n1MSKX p2Qywj/T1ut82R3it0n+nQB6J5vvdWp7+NjFzu3ie0P98vOZlTtMVpnwhmtLpOAMOcSA/E HeudHTg/ymi72JVZuta65HOfYB/XdRh8BUqHut9KAmwClRYHrecJiaUT3oMO3HMYi0cmRr 8qBpvz9IAHettiSkmdz78LdEwf4xxHYgy7bEPNYFryP0Cd1UIeUPwCGHVd0aQVDRb3Ra0+ ZQJMXx2tKpQg9A7JMIQ9FLF9g8xe+cXl+SZ1soo5S3TFAdmH7E5zVNhLqODoqQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4S15G94Z9NzrRp; Wed, 4 Oct 2023 20:02:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 394K2vLE056234; Wed, 4 Oct 2023 20:02:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 394K2vh5056231; Wed, 4 Oct 2023 20:02:57 GMT (envelope-from git) Date: Wed, 4 Oct 2023 20:02:57 GMT Message-Id: <202310042002.394K2vh5056231@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Robert Clausecker Subject: git: 5631aa7d0699 - main - devel/wasmer: fix build on aarch64 List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: fuz X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5631aa7d069993d7be49c516eaec772630437436 Auto-Submitted: auto-generated The branch main has been updated by fuz: URL: https://cgit.FreeBSD.org/ports/commit/?id=5631aa7d069993d7be49c516eaec772630437436 commit 5631aa7d069993d7be49c516eaec772630437436 Author: Kresimir Jozic AuthorDate: 2023-10-02 20:28:14 +0000 Commit: Robert Clausecker CommitDate: 2023-10-04 19:59:57 +0000 devel/wasmer: fix build on aarch64 Handle differences between ucontext_t and mcontext_t pertaining to aarch64 FreeBSD. PR: 274202 --- devel/wasmer/Makefile | 7 ++--- .../files/patch-lib_vm_src_trap_traphandlers.rs | 35 ++++++++++++++++++++++ 2 files changed, 38 insertions(+), 4 deletions(-) diff --git a/devel/wasmer/Makefile b/devel/wasmer/Makefile index 59f7e49e47fa..893c1841bd6e 100644 --- a/devel/wasmer/Makefile +++ b/devel/wasmer/Makefile @@ -1,6 +1,7 @@ PORTNAME= wasmer DISTVERSIONPREFIX= v DISTVERSION= 4.2.1 +PORTREVISION= 1 CATEGORIES= devel MAINTAINER= kjozic@gmail.com @@ -10,10 +11,8 @@ WWW= https://wasmer.io/ LICENSE= MIT LICENSE_FILE= ${WRKSRC}/LICENSE -ONLY_FOR_ARCHS= aarch64 amd64 riscv64 -ONLY_FOR_ARCHS_REASON= only aarch64, amd64 and riscv64 are supported so far -BROKEN_aarch64= needs fix for mcontext_t in lib/vm/src/trap/traphandlers.rs -BROKEN_riscv64= build issues +ONLY_FOR_ARCHS= aarch64 amd64 +ONLY_FOR_ARCHS_REASON= only aarch64 and amd64 are supported so far BUILD_DEPENDS= bash>0:shells/bash diff --git a/devel/wasmer/files/patch-lib_vm_src_trap_traphandlers.rs b/devel/wasmer/files/patch-lib_vm_src_trap_traphandlers.rs new file mode 100644 index 000000000000..89fe09a58b68 --- /dev/null +++ b/devel/wasmer/files/patch-lib_vm_src_trap_traphandlers.rs @@ -0,0 +1,35 @@ +--- lib/vm/src/trap/traphandlers.rs.orig 2023-04-07 07:18:13 UTC ++++ lib/vm/src/trap/traphandlers.rs +@@ -52,7 +52,21 @@ struct ucontext_t { + uc_mcontext: libc::mcontext_t, + } + +-#[cfg(all(unix, not(all(target_arch = "aarch64", target_os = "macos"))))] ++// Current definition of `ucontext_t` in the `libc` crate is not present ++// on aarch64-unknown-freebsd so it's defined here. ++#[repr(C)] ++#[cfg(all(target_arch = "aarch64", target_os = "freebsd"))] ++#[allow(non_camel_case_types)] ++struct ucontext_t { ++ uc_sigmask: libc::sigset_t, ++ uc_mcontext: libc::mcontext_t, ++ uc_link: *mut ucontext_t, ++ uc_stack: libc::stack_t, ++ uc_flags: libc::c_int, ++ spare: [libc::c_int; 4], ++} ++ ++#[cfg(all(unix, not(all(target_arch = "aarch64", target_os = "macos")), not(all(target_arch="aarch64", target_os="freebsd"))))] + use libc::ucontext_t; + + /// Default stack size is 1MB. +@@ -434,7 +448,8 @@ cfg_if::cfg_if! { + (*context.uc_mcontext).__ss.__fp = x29; + (*context.uc_mcontext).__ss.__lr = lr; + } else if #[cfg(all(target_os = "freebsd", target_arch = "aarch64"))] { +- context.uc_mcontext.mc_gpregs.gp_pc = pc as libc::register_t; ++ let TrapHandlerRegs { pc, sp, x0, x1, x29, lr } = regs; ++ context.uc_mcontext.mc_gpregs.gp_elr = pc as libc::register_t; + context.uc_mcontext.mc_gpregs.gp_sp = sp as libc::register_t; + context.uc_mcontext.mc_gpregs.gp_x[0] = x0 as libc::register_t; + context.uc_mcontext.mc_gpregs.gp_x[1] = x1 as libc::register_t;