summaryrefslogtreecommitdiff
path: root/tcwg_kernel-build.sh
diff options
context:
space:
mode:
authorMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>2018-12-06 19:21:49 +0000
committerMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>2018-12-11 15:22:04 +0000
commit5d1de6f179f7b69bc6d57a0edfb63b9e2dc11bac (patch)
tree4aeeb98298e37216b1fe2c3ee22aefdc0a6b2155 /tcwg_kernel-build.sh
parente3ff3490d4f594587f50641c6049ba6e003cc935 (diff)
tcwg_kernel-build.sh: Support building glibc and gcc-stage2
Make ABE routines more generic to enable building glibc and gcc stage2. These routines are going to be moved to round-robin.sh helper files to share with other jobs. Change-Id: I81038aa53293075faba643e4ad93303d5bd18041
Diffstat (limited to 'tcwg_kernel-build.sh')
-rwxr-xr-xtcwg_kernel-build.sh70
1 files changed, 46 insertions, 24 deletions
diff --git a/tcwg_kernel-build.sh b/tcwg_kernel-build.sh
index 2bf30632..0c8df057 100755
--- a/tcwg_kernel-build.sh
+++ b/tcwg_kernel-build.sh
@@ -119,9 +119,9 @@ reset_artifacts ()
! -path $top_artifacts/jenkins ! -path "$top_artifacts/jenkins/*" \
-print0 | xargs -0 rm -rf
- # Set success metric to worst possible (-3).
+ # Set success metric to worst possible (-10).
echo "Starting build" > $top_artifacts/results
- echo "-3" >> $top_artifacts/results
+ echo "-10" >> $top_artifacts/results
# Clone base-artifacts so that run_step can rsync artifacts for skipped
# steps.
@@ -224,17 +224,12 @@ EOF
export PATH=$(pwd)/bin:$PATH
- # TODO: Fix install_sysroot logic in ABE.
- # ABE tries to install sysroot even for partial builds, e.g.,
- # with "--build binutils". Workaround by patching ABE.
- sed -i -e "s/do_install_sysroot/:/" lib/control.sh
-
./configure --with-git-reference-dir=/home/tcwg-buildslave/snapshots-ref
)
}
# Build ABE component
-# $1: Component -- Binutils or stage1 GCC.
+# $1: Component -- ABE component to build.
build_abe_1 ()
{
(
@@ -242,16 +237,32 @@ build_abe_1 ()
local component="$1"
- clone_repo $component
+ local project stage
+ case "$component" in
+ stage1)
+ project=gcc
+ stage="--stage 1"
+ ;;
+ stage2)
+ project=gcc
+ stage="--stage 2"
+ ;;
+ *)
+ project=$component
+ stage=""
+ ;;
+ esac
+
+ clone_repo $project
# Don't use ABE's repo clone functions and setup abe/snapshots/ directory
# to have the right entries.
local git_dir git_path
- git_dir="$(basename ${git_repo[$component]})"
+ git_dir="$(basename ${git_repo[$project]})"
git_path="abe/snapshots/$git_dir"
rm -rf $git_path $git_path~master
- ln -s $(pwd)/$component $git_path
- ln -s $(pwd)/$component $git_path~master
+ ln -s $(pwd)/$project $git_path
+ ln -s $(pwd)/$project $git_path~master
cd abe
@@ -264,16 +275,24 @@ build_abe_1 ()
export PATH=$(pwd)/bin:$PATH
+ if [ x"$component" != x"stage2" ]; then
+ # TODO: Fix install_sysroot logic in ABE.
+ # ABE tries to install sysroot even for partial builds, e.g.,
+ # with "--build binutils". Workaround by patching ABE.
+ sed -i -e "s/do_install_sysroot/:/" lib/control.sh
+ else
+ git checkout -- lib/control.sh
+ fi
+
ccache -z
- # Run "./abe.sh --build $component".
+ # Run "./abe.sh --build $project".
./abe.sh \
- --build $component \
+ --build $project \
--target $gnu_target \
--extraconfigdir config/master \
--disable update \
- binutils=binutils-gdb.git~master \
- gcc=gcc.git~master \
- --stage 1
+ $project=${git_repo[$project]}~master \
+ $stage
ccache -s
)
}
@@ -288,7 +307,7 @@ build_abe ()
local component="$1"
# Attempt to build GCC only if binutils build (in previous step) was OK.
- if [ x"$component" = x"gcc" -a ! -f $run_step_prev_artifacts/build-ok ]; then
+ if [ x"$component" != x"binutils" -a ! -f $run_step_prev_artifacts/build-ok ]; then
return
fi
@@ -299,8 +318,11 @@ build_abe ()
if [ $res = 0 ]; then
echo "Finished build_abe $component" >> $top_artifacts/results
case "$component" in
- binutils) echo "-2" >> $top_artifacts/results ;;
- gcc) echo "-1" >> $top_artifacts/results ;;
+ binutils) echo "-9" >> $top_artifacts/results ;;
+ stage1) echo "-8" >> $top_artifacts/results ;;
+ linux) echo "-7" >> $top_artifacts/results ;;
+ glibc) echo "-6" >> $top_artifacts/results ;;
+ stage2) echo "-5" >> $top_artifacts/results ;;
*) assert false ;;
esac
@@ -476,13 +498,13 @@ no_regression_p ()
return 0
fi
- if ! [ "$linux_n_obj" -ge "-3" ]; then
+ if ! [ "$linux_n_obj" -ge "-10" ]; then
# Something is very wrong with result (e.g., it's not a number).
return 1
fi
# Assume worst for non-existent baseline.
- local base_linux_n_obj="-3"
+ local base_linux_n_obj="-10"
if [ -f base-artifacts/results ]; then
base_linux_n_obj=$(tail -n1 base-artifacts/results)
@@ -490,7 +512,7 @@ no_regression_p ()
# Current build is not ideal, so make sure baseline "all" is
# better than the current result.
base_linux_n_obj=$(($linux_n_obj+1))
- elif ! [ "$base_linux_n_obj" -ge "-3" ]; then
+ elif ! [ "$base_linux_n_obj" -ge "-10" ]; then
# Something is very wrong with baseline result
# (e.g., it's not a number).
return 0
@@ -585,7 +607,7 @@ case "$toolchain" in
gnu)
run_step prepare_abe
run_step build_abe binutils
- run_step build_abe gcc
+ run_step build_abe stage1
;;
llvm)
run_step build_llvm