aboutsummaryrefslogtreecommitdiff
path: root/stress
diff options
context:
space:
mode:
authorRenato Golin <renato.golin@linaro.org>2016-09-17 18:22:38 +0100
committerRenato Golin <renato.golin@linaro.org>2016-09-17 20:46:12 +0100
commit250b7aa1f79ef4377c7ae3e55560849db5b5bcf9 (patch)
tree693e4a025a21c302cd6d98fdd6088d7a03e6fca1 /stress
parent2f8ac15f73eb1c3b072b3126e3a82827c2fc07dd (diff)
downloadlinaro-scripts-250b7aa1f79ef4377c7ae3e55560849db5b5bcf9.tar.gz
Add LINK_JOBS logic to all three builder scripts
The stress, helper and bisect build scripts needed the LLVM_LINK_JOBS option to make sure it doesn't run out of memory while linking, especially in SoCs that have a lot more cores than RAM (ex. HiKey). This patch calculates the jobs by seeing how much RAM the target has and adding +1, as link jobs rarely take more than 1GB, but the final ones do use several hundred. Also making sure we don't exceed the number of cores. A few other small changes: * Replace "else if" by "elif" * Build only minimal targets on ARM (even o full build) * Fixed a -j$PARALLEL bug introduced by a prvious commit * Converted a few backticks into $() Change-Id: If4f2189623338d2924357ecd3d4ee18feb522c32
Diffstat (limited to 'stress')
-rwxr-xr-xstress/build-llvm-forever.sh11
1 files changed, 8 insertions, 3 deletions
diff --git a/stress/build-llvm-forever.sh b/stress/build-llvm-forever.sh
index 5fc4096..2e07ff1 100755
--- a/stress/build-llvm-forever.sh
+++ b/stress/build-llvm-forever.sh
@@ -21,13 +21,18 @@
set +e
-ROOT=`pwd`
-CPUS=`grep -c proc /proc/cpuinfo`
+ROOT=$(pwd)
+CPUS=$(grep -c proc /proc/cpuinfo)
+LINK=$(free -g | awk '/Mem/ {print $2}')
+if [ "$LINK" -gt "$CPUS" ]; then
+ LINK=$CPUS
+else
+ LINK=$((LINK+1))
+fi
LINK_JOBS=
GEN="Unix Makefiles"
BUILD="make"
if ninja --version > /dev/null; then
- LINK=`free -g | awk '/Mem/ {print $2}'`
LINK_JOBS="-DLLVM_PARALLEL_LINK_JOBS=$LINK"
GEN="Ninja"
BUILD="ninja"