]> git.pld-linux.org Git - packages/rust.git/commitdiff
- add x32 target
authorJan Rękorajski <baggins@pld-linux.org>
Sun, 1 Apr 2018 23:09:56 +0000 (01:09 +0200)
committerJan Rękorajski <baggins@pld-linux.org>
Sun, 1 Apr 2018 23:10:46 +0000 (01:10 +0200)
rust.spec
x32.patch [new file with mode: 0644]

index 3dab5a7ec09d856f86958cea16d3bd42fb39a3f4..eb31b405c48737028d64f60ec9475fe2fbebc0da 100644 (file)
--- 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 (file)
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
+             }
This page took 0.036218 seconds and 4 git commands to generate.