diff options
author | Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org> | 2019-03-15 15:37:34 +0530 |
---|---|---|
committer | Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org> | 2019-03-19 09:34:14 +0000 |
commit | 278e12dee52779d31cc1b10d39f1dda5b814cf48 (patch) | |
tree | 891ef50cb6e2f9ce1f5b23ce991819b63f5e7071 | |
parent | aca75e6b808dd130d940d7b0ad806b0d9e12c936 (diff) |
Patch [3/3] Merge tcwg_gnu: Add support for various bootstrap configs.
Change-Id: I21fad361d7b12c9a15617069073daf44ca56894b
-rw-r--r-- | round-robin.sh | 37 | ||||
-rwxr-xr-x | tcwg_gnu-build.sh | 203 |
2 files changed, 56 insertions, 184 deletions
diff --git a/round-robin.sh b/round-robin.sh index 6e669e11..f207d4a0 100644 --- a/round-robin.sh +++ b/round-robin.sh @@ -211,7 +211,9 @@ build_abe () local component="$1" - local project stage + local project stage action + action="build" + case "$component" in stage1) project=gcc @@ -221,6 +223,30 @@ build_abe () project=gcc stage="--stage 2" ;; + bootstrap) + project=gcc + stage="--enable bootstrap" + ;; + bootstrap_ubsan) + project=gcc + stage="--set buildconfig=bootstrap-ubsan" + ;; + bootstrap_O3) + project=gcc + stage="--set buildconfig=bootstrap-O3" + ;; + bootstrap_O1) + project=gcc + stage="--set buildconfig=bootstrap-O1" + ;; + bootstrap_lto) + project=gcc + stage="--set buildconfig=bootstrap-lto" + ;; + bootstrap_debug) + project=gcc + stage="--set buildconfig=bootstrap-debug" + ;; *) project=$component stage="" @@ -266,10 +292,15 @@ build_abe () fi ccache -z + local target_opt="" + if [ x"${rr[target]}" != x"native" ]; then + target_opt="--target $gnu_target" + fi + # Run "./abe.sh --build $project". ./abe.sh \ - --build $project \ - --target $gnu_target \ + --$action $project \ + $target_opt \ --extraconfigdir config/master \ $custom_abe_src_opt \ $stage diff --git a/tcwg_gnu-build.sh b/tcwg_gnu-build.sh index 9485e0ba..1a546169 100755 --- a/tcwg_gnu-build.sh +++ b/tcwg_gnu-build.sh @@ -15,25 +15,18 @@ rr[mode]="${rr[mode]-baseline}" # Set custom revision for one of the projects, and use baseline revisions # for all other projects. -rr[ci_project]="${rr[ci_project]-tcwg_kernel}" +rr[ci_project]="${rr[ci_project]-tcwg_gnu}" rr[baseline_branch]="${rr[baseline_branch]-linaro-local/ci/${rr[ci_project]}/${rr[ci_config]}}" rr[reset_baseline]="${rr[reset_baseline]-false}" rr[top_artifacts]="${rr[top_artifacts]-$(pwd)/artifacts}" -# {toolchain_name}-{toolchain_ver}-{target}-{linux}-{linux_config} +# {toolchain_name}-{toolchain_ver}-{target}-{bootstrap_config} IFS=- read -a ci_config <<EOF ${rr[ci_config]} EOF -rr[toolchain]=${rr[toolchain]-${ci_config[0]}} -rr[release]=${rr[release]-${ci_config[1]}} -rr[target]=${rr[target]-${ci_config[2]}} -rr[linux_config]=${rr[linux_config]-${ci_config[4]}} - -case "${rr[toolchain]}" in - llvm) rr[components]="llvm linux" ;; - gnu) rr[components]="binutils gcc linux" ;; - *) assert false ;; -esac +rr[target]="native" +bootstrap_config=${bootstrap_config-${ci_config[3]}} +rr[components]="gcc" # Use baseline branches by default. for c in ${rr[components]}; do @@ -58,12 +51,8 @@ case "${rr[mode]}" in default_finish_at="update_baseline" ;; "bisect") - case "${rr[toolchain]}:$(print_single_updated_component)" in - gnu:binutils) default_start_at="build_abe-binutils" ;; - gnu:gcc) default_start_at="build_abe-stage1" ;; - gnu:linux) default_start_at="build_linux" ;; - llvm:llvm) default_start_at="build_llvm" ;; - llvm:linux) default_start_at="build_linux" ;; + case "$(print_single_updated_component)" in + gcc) default_start_at="build_abe-$bootstrap_config" ;; *) assert false ;; esac default_finish_at="check_regression" @@ -79,183 +68,35 @@ fi run_step_init "$start_at" "$finish_at" "${rr[top_artifacts]}" "$verbose" -# Build Linux kernel -build_linux_1 () -{ - ( - set -euf -o pipefail - - clone_repo linux - - rm -rf $(pwd)/bin - mkdir $(pwd)/bin - - local bin cc ld_opt - - case "${rr[toolchain]}" in - llvm) - bin="$(pwd)/llvm-install/bin" - cc="$bin/clang" - ;; - gnu) - bin="$(pwd)/abe/builds/destdir/x86_64-unknown-linux-gnu/bin" - cc="$bin/$(print_gnu_target ${rr[target]})-gcc" - ;; - esac - - case "${rr[toolchain]}-${rr[release]}-${rr[target]}-${rr[linux_config]}" in - llvm-*-aarch64-defconfig) ld_opt="LD=$bin/ld.lld" ;; - llvm-master-arm-defconfig) ld_opt="LD=$bin/ld.lld" ;; - *) ld_opt="" ;; - esac - - # Use binutils, etc from $bin - export PATH="$bin:$PATH" - - # Use ccache only when bisecting linux (or preparing to). - # Otherwise the compiler is new in every build and we would - # only clobber ccache volume. - local ccache="" - if [ x"${rr[mode]}" != x"jenkins-full" \ - -a x"$(print_single_updated_component)" = x"linux" ]; then - ccache="ccache" - fi - cat > $(pwd)/bin/${rr[target]}-cc <<EOF -#!/bin/sh -exec $ccache $cc "\$@" -EOF - chmod +x $(pwd)/bin/${rr[target]}-cc - - # Define make variables. - local opts="CC=$(pwd)/bin/${rr[target]}-cc $ld_opt SUBLEVEL=0 EXTRAVERSION=-bisect" - 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]})-" - opts="$opts HOSTCC=gcc" - fi - - cd linux - - make $opts distclean - - make $opts ${rr[linux_config]} - sed -i -e 's:CONFIG_LOCALVERSION_AUTO=y:# CONFIG_LOCALVERSION_AUTO is not set:' .config - set +f; rm -f localversion*; set -f - make $opts oldconfig - - ccache -z - KBUILD_BUILD_TIMESTAMP=0 make $opts -j$(nproc --all) -s -k & - local res=0 && wait $! || res=$? - ccache -s - return $res - ) -} - -# Build linux and count number successfully built .o files in linux -build_linux () -{ - ( - set -euf -o pipefail - - build_linux_1 & - local res=0 && wait $! || res=$? - - # Number of .o files created is the main success metric. - local linux_n_obj - linux_n_obj=$(find linux -name "*.o" | wc -l) - echo "linux_n_obj:" >> ${rr[top_artifacts]}/results - echo "$linux_n_obj" >> ${rr[top_artifacts]}/results - - if [ $res = 0 ]; then - echo "linux build successful:" >> ${rr[top_artifacts]}/results - echo "all" >> ${rr[top_artifacts]}/results - fi - - return $res - ) -} - -# Boot linux kernel -boot_linux () -{ - ( - set -euf -o pipefail - - local image cpu - case ${rr[target]} in - aarch64) - image=linux/arch/arm64/boot/Image.gz - cpu="-cpu cortex-a53" - ;; - arm) - image=linux/arch/arm/boot/zImage - cpu="" - ;; - *) assert false ;; - esac - timeout 10s qemu-system-${rr[target]} \ - -kernel $image -machine virt $cpu -m 512 \ - -serial mon:stdio -display none \ - -append "console=ttyAMA0 panic=-1" -no-reboot - - echo "linux boot successful:" >> ${rr[top_artifacts]}/results - echo "boot" >> ${rr[top_artifacts]}/results - ) -} - # Exit with code 0 if no regression compared to base-artifacts/results. no_regression_p () { ( set -euf -o pipefail - local linux_n_obj - linux_n_obj=$(tail -n1 ${rr[top_artifacts]}/results) + # The following check tests for an empty branch, and we return 0 if results + # are not present, since that's an inherently better state. If base-artifacts + # were not existing, then it would fail in reset_artifacts() stage. - # Assume worst for non-existent baseline. - local base_linux_n_obj="-10" - if [ -f base-artifacts/results ]; then - base_linux_n_obj=$(tail -n1 base-artifacts/results) + if ! [ -f base-artifacts/results ]; then + return 0 fi - case "$linux_n_obj:$base_linux_n_obj" in - boot:*) return 0 ;; - *:boot) return 1 ;; - all:*) return 0 ;; - *:all) return 1 ;; - *) - if ! [ "$linux_n_obj" -ge "-10" ]; then - # Something is very wrong with result (e.g., it's not a number). - return 1 - fi - if ! [ "$base_linux_n_obj" -ge "-10" ]; then - # Something is very wrong with result (e.g., it's not a number). - return 0 - fi + local build_result_ref build_result_new + build_result_ref=$(tail -n1 base-artifacts/results) + build_result_new=$(tail -n1 ${rr[top_artifacts]}/results) - if [ $linux_n_obj -ge $base_linux_n_obj ]; then - return 0 - else - return 1 - fi - ;; - esac + if [ $build_result_new -lt $build_result_ref ]; then + return 1 + fi + + return 0 ) } run_step stop_on_fail -10 reset_artifacts -case "${rr[toolchain]}" in - gnu) - run_step stop_on_fail x prepare_abe - run_step skip_on_fail -9 build_abe binutils - run_step skip_on_fail -8 build_abe stage1 - ;; - llvm) - run_step skip_on_fail -1 build_llvm - ;; -esac -run_step skip_on_fail x build_linux -run_step skip_on_fail x boot_linux +run_step stop_on_fail x prepare_abe +run_step skip_on_fail -5 build_abe ${bootstrap_config} run_step reset_on_fail x check_regression run_step stop_on_fail x update_baseline run_step stop_on_fail x push_baseline |