]> git.pld-linux.org Git - packages/rust.git/commitdiff
- started trying with rust-std on x32
authorJakub Bogusz <qboosh@pld-linux.org>
Wed, 9 Oct 2019 19:52:00 +0000 (21:52 +0200)
committerJakub Bogusz <qboosh@pld-linux.org>
Wed, 9 Oct 2019 19:52:00 +0000 (21:52 +0200)
rust.spec
x32.patch [deleted file]

index 31ce20d7e697f3e8d2960d677b6decc3f2c68ebe..35ff2b497a321ab6f4c174b61fc2a0fb07fb6df6 100644 (file)
--- a/rust.spec
+++ b/rust.spec
@@ -7,6 +7,8 @@
 %bcond_with    bootstrap       # bootstrap using precompiled binaries
 %bcond_with    full_debuginfo  # full debuginfo vs only std debuginfo (full takes gigabytes of memory to build)
 %bcond_without system_llvm     # system LLVM
+%bcond_without rustc           # rustc building
+%bcond_without cargo           # cargo building
 %bcond_with    tests           # build without tests
 
 # The channel can be stable, beta, or nightly
 %define                bootstrap_cargo 0.37.0
 %define                bootstrap_date  2019-07-04
 
+%ifarch x32
+%undefine      with_cargo
+%undefine      with_rustc
+%endif
 Summary:       The Rust Programming Language
 Summary(pl.UTF-8):     Język programowania Rust
 Name:          rust
@@ -39,7 +45,6 @@ Source1:      https://static.rust-lang.org/dist/%{bootstrap_date}/rust-%{bootstrap_ru
 # Source1-md5: 487d17bbb86891f58160ccf6f0347b49
 Source2:       https://static.rust-lang.org/dist/%{bootstrap_date}/rust-%{bootstrap_rust}-i686-unknown-linux-gnu.tar.gz
 # Source2-md5: 5f969ed3c9ef2a7e2a8011be7eb796c3
-Patch0:                x32.patch
 URL:           https://www.rust-lang.org/
 # for src/compiler-rt
 BuildRequires: cmake >= 3.4.3
@@ -61,20 +66,23 @@ BuildRequires:      procps
 # https://github.com/rust-lang/rust/issues/11937
 Requires:      gcc
 # Only x86_64 and i686 are Tier 1 platforms at this time.
+# x32 is Tier 2, only rust-std is available (no rustc or cargo).
 # https://doc.rust-lang.org/stable/book/getting-started.html#tier-1
-ExclusiveArch: %{x8664} %{ix86}
+ExclusiveArch: %{x8664} %{ix86} x32
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %ifarch x32
-%define                rust_triple     x86_64-unknown-linux-gnux32
+%define                rust_triple             x86_64-unknown-linux-gnux32
+%define                rust_bootstrap_triple   x86_64-unknown-linux-gnu
 %else
-%define                rust_triple     %{_target_cpu}-unknown-linux-gnu
+%define                rust_triple             %{_target_cpu}-unknown-linux-gnu
+%define                rust_bootstrap_triple   %{_target_cpu}-unknown-linux-gnu
 %endif
 
 %if %{without bootstrap}
 %define                local_rust_root %{_prefix}
 %else
-%define                bootstrap_root  rust-%{bootstrap_rust}-%{rust_triple}
+%define                bootstrap_root  rust-%{bootstrap_rust}-%{rust_bootstrap_triple}
 %define                local_rust_root %{_builddir}/%{rustc_package}/%{bootstrap_root}
 %endif
 
@@ -205,12 +213,9 @@ Dopełnianie parametrów polecenia cargo w powłoce Zsh.
 
 %prep
 %setup -q -n %{rustc_package}
-%ifarch x32
-%patch0 -p1
-%endif
 
 %if %{with bootstrap}
-%ifarch %{x8664}
+%ifarch %{x8664} x32
 tar xf %{SOURCE1}
 %endif
 %ifarch %{ix86}
@@ -218,7 +223,7 @@ tar xf %{SOURCE2}
 %endif
 %{__mv} %{bootstrap_root} %{bootstrap_root}-root
 %{bootstrap_root}-root/install.sh \
-       --components=cargo,rustc,rust-std-%{rust_triple} \
+       --components=cargo,rustc,rust-std-%{rust_bootstrap_triple} \
        --prefix=%{local_rust_root} \
        --disable-ldconfig
 test -f %{local_rust_root}/bin/cargo
diff --git a/x32.patch b/x32.patch
deleted file mode 100644 (file)
index bf40efe..0000000
--- a/x32.patch
+++ /dev/null
@@ -1,62 +0,0 @@
---- 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.410948 seconds and 4 git commands to generate.