From owner-svn-ports-head@freebsd.org Fri Apr 26 04:28:49 2019 Return-Path: Delivered-To: svn-ports-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5237A1588AC2; Fri, 26 Apr 2019 04:28:49 +0000 (UTC) (envelope-from tobik@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) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DB4C4822C2; Fri, 26 Apr 2019 04:28:48 +0000 (UTC) (envelope-from tobik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B13E664A5; Fri, 26 Apr 2019 04:28:48 +0000 (UTC) (envelope-from tobik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3Q4SmTv002098; Fri, 26 Apr 2019 04:28:48 GMT (envelope-from tobik@FreeBSD.org) Received: (from tobik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3Q4Sloh002092; Fri, 26 Apr 2019 04:28:47 GMT (envelope-from tobik@FreeBSD.org) Message-Id: <201904260428.x3Q4Sloh002092@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tobik set sender to tobik@FreeBSD.org using -f From: Tobias Kortkamp Date: Fri, 26 Apr 2019 04:28:47 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r500077 - in head/lang/rust: . files X-SVN-Group: ports-head X-SVN-Commit-Author: tobik X-SVN-Commit-Paths: in head/lang/rust: . files X-SVN-Commit-Revision: 500077 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DB4C4822C2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Apr 2019 04:28:49 -0000 Author: tobik Date: Fri Apr 26 04:28:47 2019 New Revision: 500077 URL: https://svnweb.freebsd.org/changeset/ports/500077 Log: lang/rust: Update to 1.34.1 - Add stdsimd patches from D19940 to attempt to unbreak powerpc64, armv{6,7} [1] Changes: https://blog.rust-lang.org/2019/04/25/Rust-1.34.1.html PR: 237507 [1] Submitted by: mikael.urankar@gmail.com [1] Reviewed by: jbeich [1] Tested by: pkubaj (stdsimd patches with 1.34.0 on powerpc64) [1] With hat: rust Differential Revision: https://reviews.freebsd.org/D19940 [1] Added: head/lang/rust/files/patch-src_stdsimd_crates_std__detect_src_detect_os_freebsd_arm.rs (contents, props changed) head/lang/rust/files/patch-src_stdsimd_crates_std__detect_src_detect_os_freebsd_auxvec.rs (contents, props changed) head/lang/rust/files/patch-src_stdsimd_crates_std__detect_src_detect_os_freebsd_mod.rs (contents, props changed) head/lang/rust/files/patch-src_stdsimd_crates_std__detect_src_detect_os_freebsd_powerpc.rs (contents, props changed) Modified: head/lang/rust/Makefile head/lang/rust/distinfo Modified: head/lang/rust/Makefile ============================================================================== --- head/lang/rust/Makefile Fri Apr 26 03:25:42 2019 (r500076) +++ head/lang/rust/Makefile Fri Apr 26 04:28:47 2019 (r500077) @@ -2,7 +2,7 @@ # $FreeBSD$ PORTNAME= rust -PORTVERSION?= 1.34.0 +PORTVERSION?= 1.34.1 PORTREVISION?= 0 CATEGORIES= lang MASTER_SITES= http://static.rust-lang.org/dist/:src \ Modified: head/lang/rust/distinfo ============================================================================== --- head/lang/rust/distinfo Fri Apr 26 03:25:42 2019 (r500076) +++ head/lang/rust/distinfo Fri Apr 26 04:28:47 2019 (r500077) @@ -1,6 +1,6 @@ -TIMESTAMP = 1555004553 -SHA256 (rust/rustc-1.34.0-src.tar.xz) = a510b3b7ceca370a4b395065039b2a70297e3fb4103b7ff67b1eff771fd98504 -SIZE (rust/rustc-1.34.0-src.tar.xz) = 95055768 +TIMESTAMP = 1556213482 +SHA256 (rust/rustc-1.34.1-src.tar.xz) = e0efb1e6aba0d4900de57bd2db64e32e7c5b440a95a675d5303839c9a2c3328f +SIZE (rust/rustc-1.34.1-src.tar.xz) = 95048260 SHA256 (rust/2019-02-28/rustc-1.33.0-aarch64-unknown-freebsd.tar.gz) = 142c3419b0df1bacf97bf6ed6d2d3bcb37a6439b5bf11f258178edac6e3053b3 SIZE (rust/2019-02-28/rustc-1.33.0-aarch64-unknown-freebsd.tar.gz) = 64575877 SHA256 (rust/2019-02-28/rust-std-1.33.0-aarch64-unknown-freebsd.tar.gz) = bbb2ec53d4fcade7002665d4c9c64740ddc14a07d3726555c7a2ffe01b07fd9e Added: head/lang/rust/files/patch-src_stdsimd_crates_std__detect_src_detect_os_freebsd_arm.rs ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lang/rust/files/patch-src_stdsimd_crates_std__detect_src_detect_os_freebsd_arm.rs Fri Apr 26 04:28:47 2019 (r500077) @@ -0,0 +1,30 @@ +--- src/stdsimd/crates/std_detect/src/detect/os/freebsd/arm.rs.orig 2019-04-25 17:33:21 UTC ++++ src/stdsimd/crates/std_detect/src/detect/os/freebsd/arm.rs +@@ -0,0 +1,27 @@ ++//! Run-time feature detection for ARM on FreeBSD ++ ++use crate::detect::{Feature, cache}; ++use super::{auxvec}; ++ ++/// Performs run-time feature detection. ++#[inline] ++pub fn check_for(x: Feature) -> bool { ++ cache::test(x as u32, detect_features) ++} ++ ++/// Try to read the features from the auxiliary vector ++fn detect_features() -> cache::Initializer { ++ let mut value = cache::Initializer::default(); ++ let enable_feature = |value: &mut cache::Initializer, f, enable| { ++ if enable { ++ value.set(f as u32); ++ } ++ }; ++ ++ if let Ok(auxv) = auxvec::auxv() { ++ enable_feature(&mut value, Feature::neon, auxv.hwcap & 0x00001000 != 0); ++ enable_feature(&mut value, Feature::pmull, auxv.hwcap2 & 0x00000002 != 0); ++ return value; ++ } ++ value ++} Added: head/lang/rust/files/patch-src_stdsimd_crates_std__detect_src_detect_os_freebsd_auxvec.rs ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lang/rust/files/patch-src_stdsimd_crates_std__detect_src_detect_os_freebsd_auxvec.rs Fri Apr 26 04:28:47 2019 (r500077) @@ -0,0 +1,89 @@ +--- src/stdsimd/crates/std_detect/src/detect/os/freebsd/auxvec.rs.orig 2019-04-25 17:33:21 UTC ++++ src/stdsimd/crates/std_detect/src/detect/os/freebsd/auxvec.rs +@@ -0,0 +1,86 @@ ++//! Parses ELF auxiliary vectors. ++#![cfg_attr(any(target_arch = "arm", target_arch = "powerpc64"), allow(dead_code))] ++ ++/// Key to access the CPU Hardware capabilities bitfield. ++pub(crate) const AT_HWCAP: usize = 25; ++/// Key to access the CPU Hardware capabilities 2 bitfield. ++pub(crate) const AT_HWCAP2: usize = 26; ++ ++/// Cache HWCAP bitfields of the ELF Auxiliary Vector. ++/// ++/// If an entry cannot be read all the bits in the bitfield are set to zero. ++/// This should be interpreted as all the features being disabled. ++#[derive(Debug, Copy, Clone)] ++pub(crate) struct AuxVec { ++ pub hwcap: usize, ++ pub hwcap2: usize, ++} ++ ++/// ELF Auxiliary Vector ++/// ++/// The auxiliary vector is a memory region in a running ELF program's stack ++/// composed of (key: usize, value: usize) pairs. ++/// ++/// The keys used in the aux vector are platform dependent. For FreeBSD, they are ++/// defined in [sys/elf_common.h][elf_common_h]. The hardware capabilities of a given ++/// CPU can be queried with the `AT_HWCAP` and `AT_HWCAP2` keys. ++/// ++/// Note that run-time feature detection is not invoked for features that can ++/// be detected at compile-time. ++/// ++/// [elf_common.h]: https://svnweb.freebsd.org/base/release/12.0.0/sys/sys/elf_common.h?revision=341707 ++pub(crate) fn auxv() -> Result { ++ if let Ok(hwcap) = archauxv(AT_HWCAP) { ++ if let Ok(hwcap2) = archauxv(AT_HWCAP2) { ++ if hwcap != 0 && hwcap2 != 0 { ++ return Ok(AuxVec { hwcap, hwcap2 }); ++ } ++ } ++ } ++ Err(()) ++} ++ ++/// Tries to read the `key` from the auxiliary vector. ++fn archauxv(key: usize) -> Result { ++ use mem; ++ ++ #[derive (Copy, Clone)] ++ #[repr(C)] ++ pub struct Elf_Auxinfo { ++ pub a_type: usize, ++ pub a_un: unnamed, ++ } ++ #[derive (Copy, Clone)] ++ #[repr(C)] ++ pub union unnamed { ++ pub a_val: libc::c_long, ++ pub a_ptr: *mut libc::c_void, ++ pub a_fcn: Option ()>, ++ } ++ ++ let mut auxv: [Elf_Auxinfo; 27] = ++ [Elf_Auxinfo{a_type: 0, a_un: unnamed{a_val: 0,},}; 27]; ++ ++ let mut len: libc::c_uint = mem::size_of_val(&auxv) as libc::c_uint; ++ ++ unsafe { ++ let mut mib = [libc::CTL_KERN, libc::KERN_PROC, libc::KERN_PROC_AUXV, libc::getpid()]; ++ ++ let ret = libc::sysctl(mib.as_mut_ptr(), ++ mib.len() as u32, ++ &mut auxv as *mut _ as *mut _, ++ &mut len as *mut _ as *mut _, ++ 0 as *mut libc::c_void, ++ 0, ++ ); ++ ++ if ret != -1 { ++ for i in 0..auxv.len() { ++ if auxv[i].a_type == key { ++ return Ok(auxv[i].a_un.a_val as usize); ++ } ++ } ++ } ++ } ++ return Ok(0); ++} Added: head/lang/rust/files/patch-src_stdsimd_crates_std__detect_src_detect_os_freebsd_mod.rs ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lang/rust/files/patch-src_stdsimd_crates_std__detect_src_detect_os_freebsd_mod.rs Fri Apr 26 04:28:47 2019 (r500077) @@ -0,0 +1,20 @@ +--- src/stdsimd/crates/std_detect/src/detect/os/freebsd/mod.rs.orig 2019-04-24 21:07:30 UTC ++++ src/stdsimd/crates/std_detect/src/detect/os/freebsd/mod.rs +@@ -1,9 +1,17 @@ + //! Run-time feature detection on FreeBSD + ++mod auxvec; ++ + cfg_if! { + if #[cfg(target_arch = "aarch64")] { + mod aarch64; + pub use self::aarch64::check_for; ++ } else if #[cfg(target_arch = "arm")] { ++ mod arm; ++ pub use self::arm::check_for; ++ } else if #[cfg(target_arch = "powerpc64")] { ++ mod powerpc; ++ pub use self::powerpc::check_for; + } else { + use arch::detect::Feature; + /// Performs run-time feature detection. Added: head/lang/rust/files/patch-src_stdsimd_crates_std__detect_src_detect_os_freebsd_powerpc.rs ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lang/rust/files/patch-src_stdsimd_crates_std__detect_src_detect_os_freebsd_powerpc.rs Fri Apr 26 04:28:47 2019 (r500077) @@ -0,0 +1,30 @@ +--- src/stdsimd/crates/std_detect/src/detect/os/freebsd/powerpc.rs.orig 2019-04-25 17:33:21 UTC ++++ src/stdsimd/crates/std_detect/src/detect/os/freebsd/powerpc.rs +@@ -0,0 +1,27 @@ ++//! Run-time feature detection for PowerPC on FreeBSD. ++ ++use crate::detect::{Feature, cache}; ++use super::{auxvec}; ++ ++/// Performs run-time feature detection. ++#[inline] ++pub fn check_for(x: Feature) -> bool { ++ cache::test(x as u32, detect_features) ++} ++ ++fn detect_features() -> cache::Initializer { ++ let mut value = cache::Initializer::default(); ++ let enable_feature = |value: &mut cache::Initializer, f, enable| { ++ if enable { ++ value.set(f as u32); ++ } ++ }; ++ ++ if let Ok(auxv) = auxvec::auxv() { ++ enable_feature(&mut value, Feature::altivec, auxv.hwcap & 0x10000000 != 0); ++ enable_feature(&mut value, Feature::vsx, auxv.hwcap & 0x00000080 != 0); ++ enable_feature(&mut value, Feature::power8, auxv.hwcap2 & 0x80000000 != 0); ++ return value; ++ } ++ value ++}