[packages/llvm] add lowmem bcond for reducing memory requirements during build
atler
atler at pld-linux.org
Sun Nov 29 12:10:16 CET 2020
commit 1431eb62de5fe504a3dae0baf3e524632814224c
Author: Jan Palus <atler at pld-linux.org>
Date: Sun Nov 29 12:03:52 2020 +0100
add lowmem bcond for reducing memory requirements during build
llvm.spec | 14 ++++++++++++++
1 file changed, 14 insertions(+)
---
diff --git a/llvm.spec b/llvm.spec
index 4c02a83..e12be7e 100644
--- a/llvm.spec
+++ b/llvm.spec
@@ -23,6 +23,7 @@
%bcond_with cxxmodules # C++20 modules (requires support in bootstrap compiler)
%bcond_with apidocs # doxygen docs (HUGE, so they are not built by default)
%bcond_with tests # run tests
+%bcond_with lowmem # lower memory requirements
# No ocaml on other arches or no native ocaml (required for ocaml-ctypes)
%ifnarch %{ix86} %{x8664} %{arm} aarch64 ppc sparc sparcv9
@@ -33,6 +34,10 @@
%undefine with_rt
%endif
+%ifarch %{arm} aarch64
+%define lowmem 1
+%endif
+
Summary: The Low Level Virtual Machine (An Optimizing Compiler Infrastructure)
Summary(pl.UTF-8): Niskopoziomowa maszyna wirtualna (infrastruktura kompilatora optymalizującego)
Name: llvm
@@ -574,6 +579,12 @@ install -d build
cd build
CPPFLAGS="%{rpmcppflags} -D_FILE_OFFSET_BITS=64"
+%if %{with lowmem}
+export CFLAGS="%{rpmcflags} -g0"
+export CXXFLAGS="%{rpmcxxflags} -g0"
+export LDFLAGS="%{rpmldflags} -Wl,--reduce-memory-overheads"
+%endif
+
%cmake .. \
-DBUILD_SHARED_LIBS:BOOL=OFF \
-DENABLE_LINKER_BUILD_ID:BOOL=ON \
@@ -600,6 +611,9 @@ CPPFLAGS="%{rpmcppflags} -D_FILE_OFFSET_BITS=64"
%endif
-DLLVM_LINK_LLVM_DYLIB:BOOL=ON \
-DLLVM_DEFAULT_TARGET_TRIPLE:STRING=%{_target_platform} \
+%if %{with lowmem}
+ -DLLVM_PARALLEL_LINK_JOBS:STRING=1 \
+%endif
-DSPHINX_WARNINGS_AS_ERRORS=OFF
%{__make} \
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/llvm.git/commitdiff/803f8d9bd02a9ff3a000f3af5899b3375673bde5
More information about the pld-cvs-commit
mailing list