[packages/rust] - add x32 target

baggins baggins at pld-linux.org
Mon Apr 2 01:10:56 CEST 2018


commit e064fbd0ff6c448db03c8b2f662c38d4adacccc2
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Mon Apr 2 01:09:56 2018 +0200

    - add x32 target

 rust.spec | 10 +++++++++-
 x32.patch | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 71 insertions(+), 1 deletion(-)
---
diff --git a/rust.spec b/rust.spec
index 3dab5a7..eb31b40 100644
--- a/rust.spec
+++ b/rust.spec
@@ -38,6 +38,7 @@ Source1:	https://static.rust-lang.org/dist/%{bootstrap_date}/rust-%{bootstrap_ru
 # Source1-md5:	61be17f80e1811211450e5b733624232
 Source2:	https://static.rust-lang.org/dist/%{bootstrap_date}/rust-%{bootstrap_rust}-i686-unknown-linux-gnu.tar.gz
 # Source2-md5:	5568788cd5d96173a89bd0e82a2aa356
+Patch0:		x32.patch
 URL:		https://www.rust-lang.org/
 # for src/compiler-rt
 BuildRequires:	cmake >= 3.4.3
@@ -61,9 +62,13 @@ Requires:	gcc
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 # Only x86_64 and i686 are Tier 1 platforms at this time.
 # https://doc.rust-lang.org/stable/book/getting-started.html#tier-1
-ExclusiveArch:	%{x8664} %{ix86}
+ExclusiveArch:	%{x8664} %{ix86} x32
 
+%ifarch x32
+%define		rust_triple	x86_64-unknown-linux-gnux32
+%else
 %define		rust_triple	%{_target_cpu}-unknown-linux-gnu
+%endif
 
 %if %{without bootstrap}
 %define		local_rust_root	%{_prefix}
@@ -159,6 +164,9 @@ programowania Rust i jego biblioteki standardowej.
 
 %prep
 %setup -q -n %{rustc_package}
+%ifarch x32
+%patch0 -p1
+%endif
 
 %if %{with bootstrap}
 %ifarch %{x8664}
diff --git a/x32.patch b/x32.patch
new file mode 100644
index 0000000..bf40efe
--- /dev/null
+++ b/x32.patch
@@ -0,0 +1,62 @@
+--- rustc-1.25.0-src/src/vendor/parking_lot_core/src/thread_parker/linux.rs~	2018-03-25 17:53:26.000000000 +0200
++++ rustc-1.25.0-src/src/vendor/parking_lot_core/src/thread_parker/linux.rs	2018-04-01 10:17:03.297595480 +0200
+@@ -68,7 +68,7 @@
+             }
+             let ts = libc::timespec {
+                 tv_sec: diff.as_secs() as libc::time_t,
+-                tv_nsec: diff.subsec_nanos() as libc::c_long,
++                tv_nsec: diff.subsec_nanos() as libc::c_longlong,
+             };
+             let r = libc::syscall(libc::SYS_futex, &self.futex, FUTEX_WAIT | FUTEX_PRIVATE, 1, &ts);
+             debug_assert!(r == 0 || r == -1);
+--- rustc-1.25.0-src/src/vendor/parking_lot/src/elision.rs~	2018-03-25 17:53:25.000000000 +0200
++++ rustc-1.25.0-src/src/vendor/parking_lot/src/elision.rs	2018-04-01 10:23:02.095389442 +0200
+@@ -101,7 +101,7 @@
+     fn elision_acquire(&self, current: usize, new: usize) -> Result<usize, usize> {
+         unsafe {
+             let prev: usize;
+-            asm!("xacquire; lock; cmpxchgq $2, $1"
++            asm!("xacquire; lock; cmpxchg $2, $1"
+                  : "={rax}" (prev), "+*m" (self)
+                  : "r" (new), "{rax}" (current)
+                  : "memory"
+@@ -118,7 +118,7 @@
+     fn elision_release(&self, current: usize, new: usize) -> Result<usize, usize> {
+         unsafe {
+             let prev: usize;
+-            asm!("xrelease; lock; cmpxchgq $2, $1"
++            asm!("xrelease; lock; cmpxchg $2, $1"
+                  : "={rax}" (prev), "+*m" (self)
+                  : "r" (new), "{rax}" (current)
+                  : "memory"
+--- rustc-1.25.0-src/src/vendor/filetime/src/unix/mod.rs~	2018-03-25 17:53:25.000000000 +0200
++++ rustc-1.25.0-src/src/vendor/filetime/src/unix/mod.rs	2018-04-01 23:34:09.811654820 +0200
+@@ -72,7 +72,7 @@
+     fn to_timespec(ft: &FileTime) -> timespec {
+         timespec {
+             tv_sec: ft.seconds() as time_t,
+-            tv_nsec: ft.nanoseconds() as c_long,
++            tv_nsec: ft.nanoseconds() as libc::c_longlong,
+         }
+     }
+ }
+--- rustc-1.25.0-src/src/vendor/time/src/sys.rs~	2018-03-25 17:53:24.000000000 +0200
++++ rustc-1.25.0-src/src/vendor/time/src/sys.rs	2018-04-01 23:40:21.243254373 +0200
+@@ -491,13 +491,13 @@
+                 let nanoseconds = other - Duration::seconds(seconds);
+                 let nanoseconds = nanoseconds.num_nanoseconds().unwrap();
+                 self.t.tv_sec += seconds as libc::time_t;
+-                self.t.tv_nsec += nanoseconds as libc::c_long;
+-                if self.t.tv_nsec >= ::NSEC_PER_SEC as libc::c_long {
+-                    self.t.tv_nsec -= ::NSEC_PER_SEC as libc::c_long;
++                self.t.tv_nsec += nanoseconds as libc::c_longlong;
++                if self.t.tv_nsec >= ::NSEC_PER_SEC as libc::c_longlong {
++                    self.t.tv_nsec -= ::NSEC_PER_SEC as libc::c_longlong;
+                     self.t.tv_sec += 1;
+                 } else if self.t.tv_nsec < 0 {
+                     self.t.tv_sec -= 1;
+-                    self.t.tv_nsec += ::NSEC_PER_SEC as libc::c_long;
++                    self.t.tv_nsec += ::NSEC_PER_SEC as libc::c_longlong;
+                 }
+                 self
+             }
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/rust.git/commitdiff/e064fbd0ff6c448db03c8b2f662c38d4adacccc2



More information about the pld-cvs-commit mailing list