From owner-svn-ports-all@freebsd.org Sat Sep 29 13:37:38 2018 Return-Path: Delivered-To: svn-ports-all@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 14B7D109EC39; Sat, 29 Sep 2018 13:37:38 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BDC6C7B213; Sat, 29 Sep 2018 13:37:37 +0000 (UTC) (envelope-from zeising@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 B49B524295; Sat, 29 Sep 2018 13:37:37 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w8TDbbwQ003875; Sat, 29 Sep 2018 13:37:37 GMT (envelope-from zeising@FreeBSD.org) Received: (from zeising@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w8TDbb4M003874; Sat, 29 Sep 2018 13:37:37 GMT (envelope-from zeising@FreeBSD.org) Message-Id: <201809291337.w8TDbb4M003874@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zeising set sender to zeising@FreeBSD.org using -f From: Niclas Zeising Date: Sat, 29 Sep 2018 13:37:37 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r480907 - head/x11/alacritty/files X-SVN-Group: ports-head X-SVN-Commit-Author: zeising X-SVN-Commit-Paths: head/x11/alacritty/files X-SVN-Commit-Revision: 480907 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Sep 2018 13:37:38 -0000 Author: zeising Date: Sat Sep 29 13:37:37 2018 New Revision: 480907 URL: https://svnweb.freebsd.org/changeset/ports/480907 Log: x11/alacritty: Fix build on 32bit architectures Pull in commit a769e80 from upstream (with some fixes to make it apply) to fix build on 32bit architectures. Added: head/x11/alacritty/files/ head/x11/alacritty/files/patch-src_grid_storage.rs (contents, props changed) Added: head/x11/alacritty/files/patch-src_grid_storage.rs ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/x11/alacritty/files/patch-src_grid_storage.rs Sat Sep 29 13:37:37 2018 (r480907) @@ -0,0 +1,41 @@ +From a769e80eb4383b4c4a274c5ad192958961122d09 Mon Sep 17 00:00:00 2001 +From: Johannes +Date: Thu, 20 Sep 2018 02:04:07 +0200 +Subject: [PATCH] Fix build failure on 32-bit machines + +Alacritty has some checks in place to make sure that unsafe +code would not fail because of invalid struct sizes. This managed +to successfully catch an incorrect unsafe block on 32-bit machines. + +To make sure this block works on both 32-bit and 64-bit systems, +it has been altered to make use of the platform-dependent `usize` +type. This will always make use of correct sizes without having to +rely on conditional compilation. +--- src/grid/storage.rs.orig 2018-09-29 13:21:20 UTC ++++ src/grid/storage.rs +@@ -223,7 +223,7 @@ impl Storage { + /// instructions. This implementation achieves the swap in only 8 movups + /// instructions. + pub fn swap(&mut self, a: usize, b: usize) { +- assert_eq_size!(Row, [u32; 8]); ++ assert_eq_size!(Row, [usize; 4]); + + let a = self.compute_index(a); + let b = self.compute_index(b); +@@ -232,13 +232,13 @@ impl Storage { + // Cast to a qword array to opt out of copy restrictions and avoid + // drop hazards. Byte array is no good here since for whatever + // reason LLVM won't optimized it. +- let a_ptr = self.inner.as_mut_ptr().offset(a as isize) as *mut u64; +- let b_ptr = self.inner.as_mut_ptr().offset(b as isize) as *mut u64; ++ let a_ptr = self.inner.as_mut_ptr().add(a) as *mut usize; ++ let b_ptr = self.inner.as_mut_ptr().add(b) as *mut usize; + + // Copy 1 qword at a time + // + // The optimizer unrolls this loop and vectorizes it. +- let mut tmp: u64; ++ let mut tmp: usize; + for i in 0..4 { + tmp = *a_ptr.offset(i); + *a_ptr.offset(i) = *b_ptr.offset(i);