5
5
6
6
%ifarch %ix86
7
7
%global rust_triple i686-unknown-linux-gnu
8
+ %define xbuildjobs %{nil }
8
9
%else
9
10
%ifarch %{arm }
10
11
%global rust_triple armv7-unknown-linux-gnueabihf
12
+ %define xbuildjobs %{nil }
11
13
%else
12
14
%ifarch aarch64
13
15
%global rust_triple aarch64 -unknown-linux-gnu
16
+ # Limit build jobs in order to not exhaust memory on builds. JB#50504
17
+ %define xbuildjobs -j 4
14
18
%endif
15
19
%endif
16
20
%endif
@@ -43,6 +47,7 @@ Patch3: 0003-Disable-statx-for-all-builds.-JB-50106.patch
43
47
%global local_rust_root %{_builddir }/%{bootstrap_root }/usr
44
48
%global bootstrap_source rust-%{rust_version }-%{rust_triple }.tar.gz
45
49
50
+ BuildRequires: ccache
46
51
BuildRequires: make
47
52
BuildRequires: cmake
48
53
BuildRequires: gcc
@@ -226,9 +231,13 @@ export RUSTFLAGS="%{rustflags}"
226
231
227
232
# full debuginfo is exhausting memory; just do libstd for now
228
233
# https://github.com/rust-lang/rust/issues/45854
229
- # %define enable_debuginfo --debuginfo-level=0 --debuginfo-level-std=2
230
- # %define enable_debuginfo --disable-debuginfo --disable-debuginfo-only-std --disable-debuginfo-tools --disable-debuginfo-lines
234
+ # Limit memory usage for aarch64 build even more. JB#50504
235
+ %ifarch aarch64
236
+ %define enable_debuginfo --debuginfo-level= 0 --debuginfo-level-rustc= 0 --debuginfo-level-std= 0 --debuginfo-level-tools= 0 --debuginfo-level-tests= 0
237
+ %else
231
238
%define enable_debuginfo --debuginfo-level= 0 --debuginfo-level-std= 2 --disable-debuginfo --disable-debuginfo-only-std --disable-debuginfo-tools --disable-debuginfo-lines
239
+ %endif
240
+
232
241
233
242
%configure --disable-option-checking \
234
243
--libdir= %{common_libdir } \
@@ -237,19 +246,22 @@ export RUSTFLAGS="%{rustflags}"
237
246
--local -rust-root= %{local_rust_root } \
238
247
--enable-local -rebuild \
239
248
--enable-llvm-link-shared \
249
+ --enable-ccache \
240
250
--enable-optimize \
241
251
--disable-docs \
242
252
--disable-compiler-docs \
253
+ --disable-jemalloc \
243
254
--disable-rpath \
244
255
--disable-codegen-tests \
256
+ --disable-verbose-tests \
245
257
%{enable_debuginfo } \
246
258
--enable-extended \
247
259
--enable-vendor \
260
+ --set rust.codegen-units-std= 1 \
248
261
--tools= cargo \
249
- --llvm-root= /usr/ \
250
- --enable-parallel-compiler
262
+ --llvm-root= /usr/
251
263
252
- %{python } ./x.py build
264
+ %{python } ./x.py %{ xbuildjobs } build
253
265
254
266
255
267
%install
0 commit comments