7
7
%bcond_with bootstrap # bootstrap using precompiled binaries
8
8
%bcond_with full_debuginfo # full debuginfo vs only std debuginfo (full takes gigabytes of memory to build)
9
9
%bcond_without system_llvm # system LLVM
10
- %bcond_without rustc # rustc building
11
- %bcond_without cargo # cargo building
12
10
%bcond_with tests # build without tests
13
11
14
12
# The channel can be stable, beta, or nightly
28
26
%define bootstrap_date 2020-05-07
29
27
30
28
%ifarch x32
31
- %undefine with_cargo
32
- %undefine with_rustc
29
+ %define with_cross 1
33
30
%endif
34
31
Summary: The Rust Programming Language
35
32
Summary(pl.UTF-8): Język programowania Rust
@@ -49,23 +46,47 @@ Source3: https://static.rust-lang.org/dist/%{bootstrap_date}/rust-std-%{bootstra
49
46
# Source3-md5: 4b07c6922a0965791cf8eb28fee9e89d
50
47
Source4: https://static.rust-lang.org/dist/%{bootstrap_date }/rust-%{bootstrap_rust }-aarch64 -unknown-linux-gnu.tar.xz
51
48
# Source4-md5: 3a9d54ab96f96664b2f6077cccb4e70b
52
- Patch0: %{name }-x32.patch
49
+ Patch0: %{name }-no-miri.patch
50
+ Patch1: %{name }-x32.patch
53
51
URL: https://www.rust-lang.org/
54
52
# for src/compiler-rt
55
53
BuildRequires: cmake >= 3.4.3
56
54
BuildRequires: curl
55
+ # make check needs "ps" for src/test/run-pass/wait-forked-but-failed-child.rs
56
+ BuildRequires: procps
57
+ BuildRequires: python >= 1:2.7
58
+ BuildRequires: rpmbuild(macros) >= 1.752
59
+ %if %{without cross}
57
60
BuildRequires: libstdc++-devel
58
61
%{?with_system_llvm:BuildRequires: llvm-devel >= 7.0}
59
62
BuildRequires: openssl-devel >= 1.0.1
60
- BuildRequires: python >= 1:2.7
61
63
BuildRequires: zlib-devel
64
+ %endif
62
65
%if %{without bootstrap}
63
66
BuildRequires: %{name } >= %{bootstrap_rust }
64
67
BuildRequires: cargo >= %{bootstrap_cargo }
65
68
BuildConflicts: %{name } > %{version }
66
69
%endif
67
- # make check needs "ps" for src/test/run-pass/wait-forked-but-failed-child.rs
68
- BuildRequires: procps
70
+ %ifarch x32
71
+ BuildRequires: glibc-devel(x32)
72
+ BuildRequires: glibc-devel(x86_64 )
73
+ %if "%{_host_cpu }" == "x86_64 "
74
+ # building on x86_64 host with --target x32-pld-linux
75
+ BuildRequires: gcc-multilib-x32
76
+ BuildRequires: libstdc++-devel
77
+ %{?with_system_llvm:BuildRequires: llvm-devel >= 7.0}
78
+ BuildRequires: openssl-devel >= 1.0.1
79
+ BuildRequires: zlib-devel
80
+ %else
81
+ # building x86_64-hosted crosscompiler on x32 host
82
+ BuildRequires: gcc-multilib-64
83
+ BuildRequires: libstdc++-multilib-64-devel
84
+ # how to specify?
85
+ #BuildRequires: llvm-devel.x86_64 >= 7.0
86
+ #BuildRequires: openssl-devel.x86_64
87
+ #BuildRequires: zlib-devel.x86_64
88
+ %endif
89
+ %endif
69
90
# The C compiler is needed at runtime just for linking. Someday rustc might
70
91
# invoke the linker directly, and then we'll only need binutils.
71
92
# https://github.com/rust-lang/rust/issues/11937
@@ -78,10 +99,12 @@ BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
78
99
79
100
%ifarch x32
80
101
%define rust_triple x86_64 -unknown-linux-gnux32
102
+ %define rust_host_triple x86_64 -unknown-linux-gnu
81
103
%define rust_bootstrap_triple x86_64 -unknown-linux-gnu
82
104
%else
83
105
%define rust_triple %{_target_cpu }-unknown-linux-gnu
84
- %define rust_bootstrap_triple %{_target_cpu }-unknown-linux-gnu
106
+ %define rust_host_triple %{rust_triple }
107
+ %define rust_bootstrap_triple %{rust_triple }
85
108
%endif
86
109
87
110
%if %{without bootstrap}
@@ -129,7 +152,7 @@ bezpieczną wielowątkowość.
129
152
Summary: Common debugger pretty printers for Rust
130
153
Summary(pl.UTF-8): Narzędzia wypisujące struktury Rusa wspólne dla różnych debuggerów
131
154
Group: Development/Debuggers
132
- BuildArch: noarch
155
+ %{? noarchpackage }
133
156
134
157
%description debugger-common
135
158
This package includes the common functionality for rust-gdb and
@@ -144,7 +167,7 @@ Summary(pl.UTF-8): Ładne wypisywanie struktur Rusta w GDB
144
167
Group: Development/Debuggers
145
168
Requires: %{name }-debugger-common = %{version }-%{release }
146
169
Requires: gdb
147
- BuildArch: noarch
170
+ %{? noarchpackage }
148
171
149
172
%description gdb
150
173
This package includes the rust-gdb script, which allows easier
@@ -160,7 +183,7 @@ Summary(pl.UTF-8): Ładne wypisywanie struktur Rusta w LLDB
160
183
Group: Development/Debuggers
161
184
Requires: %{name }-debugger-common = %{version }-%{release }
162
185
Requires: lldb
163
- BuildArch: noarch
186
+ %{? noarchpackage }
164
187
165
188
%description lldb
166
189
This package includes the rust-lldb script, which allows easier
@@ -174,7 +197,7 @@ odpluskwianie programów w języku Rust.
174
197
Summary: Documentation for Rust
175
198
Summary(pl.UTF-8): Dokumentacja do Rusta
176
199
Group: Documentation
177
- BuildArch: noarch
200
+ %{? noarchpackage }
178
201
179
202
%description doc
180
203
This package includes HTML documentation for the Rust programming
@@ -227,6 +250,8 @@ Dopełnianie parametrów polecenia cargo w powłoce Zsh.
227
250
%prep
228
251
%setup -q -n %{rustc_package }
229
252
%patch0 -p1
253
+ # irrelevant when not building rustc for x32
254
+ #patch1 -p1
230
255
231
256
%if %{with bootstrap }
232
257
%ifarch %{x8664 } x32
@@ -236,7 +261,6 @@ tar xf %{SOURCE1}
236
261
tar xf %{SOURCE2 }
237
262
%endif
238
263
%ifarch x32
239
- tar xf %{SOURCE1 }
240
264
cd %{bootstrap_root }
241
265
tar xf %{SOURCE3 }
242
266
%{__mv} rust-std-%{bootstrap_rust }-%{rust_triple } rust-std-%{rust_triple }
@@ -280,10 +304,9 @@ find vendor -name .cargo-checksum.json \
280
304
-exec sed -i.uncheck -e 's/"files":{[^}]*}/"files":{ }/' '{}' '+'
281
305
282
306
%build
283
- export PKG_CONFIG_ALLOW_CROSS=1
284
307
%configure \
285
- --build=%{rust_triple } \
286
- --host=%{rust_triple } \
308
+ --build=%{rust_bootstrap_triple } \
309
+ --host=%{rust_host_triple } \
287
310
--target=%{rust_triple } \
288
311
--libdir=%{common_libdir } \
289
312
--disable-codegen-tests \
@@ -385,6 +408,15 @@ rm -rf $RPM_BUILD_ROOT
385
408
%attr(755,root,root) %{rustlibdir }/%{rust_triple }/lib/* .so
386
409
%{rustlibdir }/%{rust_triple }/lib/* .rlib
387
410
411
+ # for cross-compiler (e.g. x86_64-hosted x32 rust)
412
+ %if "%{rust_host_triple }" != "%{rust_triple }"
413
+ %dir %{rustlibdir }/%{rust_host_triple }
414
+ %{rustlibdir }/%{rust_host_triple }/analysis
415
+ %dir %{rustlibdir }/%{rust_host_triple }/lib
416
+ %attr(755,root,root) %{rustlibdir }/%{rust_host_triple }/lib/*.so
417
+ %{rustlibdir }/%{rust_host_triple }/lib/*.rlib
418
+ %endif
419
+
388
420
%files debugger-common
389
421
%defattr(644,root,root,755)
390
422
%dir %{_datadir }/%{name }
0 commit comments