From e95dd257263c5ad1adfc564233d71ed14215a586 Mon Sep 17 00:00:00 2001 From: Michel Alexandre Salim Date: Sep 19 2021 23:25:03 +0000 Subject: Add documentation for build constraints macro Signed-off-by: Michel Alexandre Salim --- diff --git a/guidelines/modules/ROOT/pages/RPMMacros.adoc b/guidelines/modules/ROOT/pages/RPMMacros.adoc index e4c8342..e73f439 100644 --- a/guidelines/modules/ROOT/pages/RPMMacros.adoc +++ b/guidelines/modules/ROOT/pages/RPMMacros.adoc @@ -138,3 +138,15 @@ $ rpm -E "%{build_ldflags}" -Wl,-z,relro -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld .... +From Fedora 33 and EPEL 7 onwards, the `+%{limit_build}+` macro can be used to +constrain resource use during the build process. Currently the amount of RAM +needed per core can be specified (and defaults to 1024 MB otherwise): + +.... +$ rpm -E "%make_build %{limit_build -m 2048}" +/usr/bin/make -O -j16 V=1 VERBOSE=1 + +$ rpm -E "%make_build %{limit_build -m 40960}" +/usr/bin/make -O -j16 V=1 VERBOSE=1 -j1 +.... +