summaryrefslogtreecommitdiff
path: root/tcwg_kernel-build.sh
diff options
context:
space:
mode:
authorMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>2018-12-11 14:20:07 +0000
committerMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>2018-12-12 09:44:22 +0000
commit0727043453cb1523cb2a67458faf5b80de0a9dc4 (patch)
treeb5f8ce820dd2e5a7bfa84e34f70e78d55379958d /tcwg_kernel-build.sh
parent1187c164a885d9d6d7dc01364d33d5d295c58512 (diff)
tcwg_kernel-build.sh: Make build_linux depend only on ${rr[]}
rr[linux_config]="$linux_config" rr[toolchain]="$toolchain" Change-Id: I3a8bb31e2c9cb6954810fa8cd3b3215356c8730d
Diffstat (limited to 'tcwg_kernel-build.sh')
-rwxr-xr-xtcwg_kernel-build.sh20
1 files changed, 12 insertions, 8 deletions
diff --git a/tcwg_kernel-build.sh b/tcwg_kernel-build.sh
index 65434ef8..63101223 100755
--- a/tcwg_kernel-build.sh
+++ b/tcwg_kernel-build.sh
@@ -99,8 +99,10 @@ run_step_init "$start_at" "$finish_at" "${rr[top_artifacts]}" "$base_artifacts_o
rr[current_project]="$current_project"
rr[current_rev]="$current_rev"
rr[git_read_only]="$git_read_only"
+rr[linux_config]="$linux_config"
rr[mode]="$mode"
rr[target]="$target"
+rr[toolchain]="$toolchain"
# Reset artifacts to an empty state. ${rr[top_artifacts]}/results is the most
# important artifact, since it records the metric of how successful the build
@@ -313,7 +315,7 @@ build_abe ()
fi
build_abe_1 $component &
- res=0; wait $! || res=$?
+ local res=0; wait $! || res=$?
# Update artifacts on success.
if [ $res = 0 ]; then
@@ -391,7 +393,7 @@ build_llvm ()
set -euf -o pipefail
build_llvm_1 &
- res=0; wait $! || res=$?
+ local res=0; wait $! || res=$?
# Update artifacts on success.
if [ $res = 0 ]; then
@@ -413,7 +415,9 @@ build_linux ()
rm -rf $(pwd)/bin
mkdir $(pwd)/bin
- case "$toolchain" in
+ local bin cc
+
+ case "${rr[toolchain]}" in
llvm)
bin="$(pwd)/llvm-install/bin"
cc="$bin/clang"
@@ -440,7 +444,7 @@ EOF
chmod +x $(pwd)/bin/${rr[target]}-cc
# Define make variables.
- opts="CC=$(pwd)/bin/${rr[target]}-cc"
+ local opts="CC=$(pwd)/bin/${rr[target]}-cc"
if [ x"${rr[target]}" != x"$(uname -m)" ]; then
opts="$opts ARCH=$(print_kernel_target ${rr[target]})"
opts="$opts CROSS_COMPILE=$(print_gnu_target ${rr[target]})-"
@@ -451,11 +455,11 @@ EOF
make $opts distclean
- make $opts $linux_config
+ make $opts ${rr[linux_config]}
ccache -z
make $opts -j$(nproc --all) -s -k &
- res=0 && wait $! || res=$?
+ local res=0 && wait $! || res=$?
ccache -s
return $res
)
@@ -470,7 +474,7 @@ count_linux_objs ()
# Run only if compiler was successfully built in the previous step.
if [ -f $run_step_prev_artifacts/build-ok ]; then
build_linux &
- res=0; wait $! || res=$?
+ local res=0; wait $! || res=$?
# Number of .o files created is the main success metric.
echo "linux_n_obj:" >> ${rr[top_artifacts]}/results
@@ -604,7 +608,7 @@ push_baseline ()
}
run_step reset_artifacts
-case "$toolchain" in
+case "${rr[toolchain]}" in
gnu)
run_step prepare_abe
run_step build_abe binutils