From owner-dev-commits-ports-main@freebsd.org Fri Sep 24 14:13:18 2021 Return-Path: Delivered-To: dev-commits-ports-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9688F66E7F4; Fri, 24 Sep 2021 14:13:18 +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 4HGDXG1Wg5z4v73; Fri, 24 Sep 2021 14:13:18 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 13C6E18306; Fri, 24 Sep 2021 14:13:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18OEDHpl041523; Fri, 24 Sep 2021 14:13:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18OEDHmu041522; Fri, 24 Sep 2021 14:13:17 GMT (envelope-from git) Date: Fri, 24 Sep 2021 14:13:17 GMT Message-Id: <202109241413.18OEDHmu041522@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Mikael Urankar Subject: git: 1b34b3e10c02 - main - www/ffsend: Fix build on aarch64. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mikael X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1b34b3e10c028b9132ddf99b6a60a29988427c4f Auto-Submitted: auto-generated X-BeenThere: dev-commits-ports-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the main branch of the FreeBSD ports repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Sep 2021 14:13:18 -0000 The branch main has been updated by mikael: URL: https://cgit.FreeBSD.org/ports/commit/?id=1b34b3e10c028b9132ddf99b6a60a29988427c4f commit 1b34b3e10c028b9132ddf99b6a60a29988427c4f Author: Mikael Urankar AuthorDate: 2021-09-24 12:24:40 +0000 Commit: Mikael Urankar CommitDate: 2021-09-24 14:13:04 +0000 www/ffsend: Fix build on aarch64. Approved by: portmgr (build fix blanket) --- www/ffsend/files/patch-cargo-crates_ring-0.16.20 | 125 +++++++++++++++++++++++ 1 file changed, 125 insertions(+) diff --git a/www/ffsend/files/patch-cargo-crates_ring-0.16.20 b/www/ffsend/files/patch-cargo-crates_ring-0.16.20 new file mode 100644 index 000000000000..0ef106dec289 --- /dev/null +++ b/www/ffsend/files/patch-cargo-crates_ring-0.16.20 @@ -0,0 +1,125 @@ +https://github.com/briansmith/ring/pull/1007 + +--- cargo-crates/ring-0.16.20/Cargo.toml.orig 2020-12-02 03:20:32.000000000 +0100 ++++ cargo-crates/ring-0.16.20/Cargo.toml 2020-12-09 09:54:26.615745000 +0100 +@@ -64,10 +64,10 @@ wasm32_c = [] + version = "0.3.37" + features = ["Crypto", "Window"] + default-features = false +-[target."cfg(any(target_arch = \"x86\",target_arch = \"x86_64\", all(any(target_arch = \"aarch64\", target_arch = \"arm\"), any(target_os = \"android\", target_os = \"fuchsia\", target_os = \"linux\"))))".dependencies.spin] ++[target."cfg(any(target_arch = \"x86\",target_arch = \"x86_64\", all(any(target_arch = \"aarch64\", target_arch = \"arm\"), any(target_os = \"android\", target_os = \"freebsd\", target_os = \"fuchsia\", target_os = \"linux\"))))".dependencies.spin] + version = "0.5.2" + default-features = false +-[target."cfg(any(target_os = \"android\", target_os = \"linux\"))".dependencies.libc] ++[target."cfg(any(target_os = \"android\", target_os = \"freebsd\", target_os = \"linux\"))".dependencies.libc] + version = "0.2.69" + default-features = false + +--- cargo-crates/ring-0.16.20/src/cpu.rs.orig 2020-11-30 21:30:03.000000000 +0100 ++++ cargo-crates/ring-0.16.20/src/cpu.rs 2020-12-09 09:53:52.469225000 +0100 +@@ -31,7 +31,7 @@ pub(crate) fn features() -> Features { + target_arch = "x86_64", + all( + any(target_arch = "aarch64", target_arch = "arm"), +- any(target_os = "android", target_os = "fuchsia", target_os = "linux") ++ any(target_os = "android", target_os = "fuchsia", target_os = "freebsd", target_os = "linux") + ) + ))] + { +@@ -49,7 +49,7 @@ pub(crate) fn features() -> Features { + + #[cfg(all( + any(target_arch = "aarch64", target_arch = "arm"), +- any(target_os = "android", target_os = "fuchsia", target_os = "linux") ++ any(target_os = "android", target_os = "fuchsia", target_os = "freebsd", target_os = "linux") + ))] + { + arm::setup(); +@@ -62,28 +62,58 @@ pub(crate) fn features() -> Features { + + pub(crate) mod arm { + #[cfg(all( +- any(target_os = "android", target_os = "linux"), ++ any(target_os = "android", target_os = "freebsd", target_os = "linux"), + any(target_arch = "aarch64", target_arch = "arm") + ))] + pub fn setup() { + use libc::c_ulong; ++ #[cfg(target_os = "freebsd")] ++ use libc::{c_int, c_void}; ++ #[cfg(target_os = "freebsd")] ++ extern crate std; + + // XXX: The `libc` crate doesn't provide `libc::getauxval` consistently + // across all Android/Linux targets, e.g. musl. ++ #[cfg(any(target_os = "android", target_os = "linux"))] + extern "C" { + fn getauxval(type_: c_ulong) -> c_ulong; + } + ++ #[cfg(target_os = "freebsd")] ++ extern "C" { ++ fn elf_aux_info(aux: c_int, buf: *mut c_void, buflen: c_int) -> c_int; ++ } ++ ++ #[cfg(not(target_os = "freebsd"))] + const AT_HWCAP: c_ulong = 16; + ++ #[cfg(target_os = "freebsd")] ++ const AT_HWCAP: c_int = 25; ++ + #[cfg(target_arch = "aarch64")] + const HWCAP_NEON: c_ulong = 1 << 1; + + #[cfg(target_arch = "arm")] + const HWCAP_NEON: c_ulong = 1 << 12; + ++ #[cfg(not(target_os = "freebsd"))] + let caps = unsafe { getauxval(AT_HWCAP) }; + ++ #[cfg(target_os = "freebsd")] ++ let caps: c_ulong = 0; ++ ++ #[cfg(target_os = "freebsd")] ++ { ++ let buffer : *mut c_void = { let t: *const c_ulong = ∩︀ t} as *mut c_void; ++ unsafe { ++ let _ret = elf_aux_info( ++ AT_HWCAP, ++ buffer, ++ std::mem::size_of_val(&caps) as i32 ++ ); ++ } ++ } ++ + // We assume NEON is available on AARCH64 because it is a required + // feature. + #[cfg(target_arch = "aarch64")] +@@ -100,11 +130,26 @@ pub(crate) mod arm { + #[cfg(target_arch = "arm")] + const OFFSET: c_ulong = 0; + +- #[cfg(target_arch = "arm")] ++ #[cfg(target_os = "freebsd")] ++ let buffer : *mut c_void = { let t: *const c_ulong = ∩︀ t} as *mut c_void; ++ ++ #[cfg(not(target_os = "freebsd"))] + let caps = { + const AT_HWCAP2: c_ulong = 26; + unsafe { getauxval(AT_HWCAP2) } + }; ++ ++ #[cfg(target_os = "freebsd")] ++ { ++ const AT_HWCAP2: c_int = 26; ++ unsafe { ++ let _ret = elf_aux_info( ++ AT_HWCAP2, ++ buffer, ++ std::mem::size_of_val(&caps) as i32 ++ ); ++ }; ++ } + + const HWCAP_AES: c_ulong = 1 << 0 + OFFSET; + const HWCAP_PMULL: c_ulong = 1 << 1 + OFFSET;