summaryrefslogtreecommitdiff
path: root/round-robin.sh
diff options
context:
space:
mode:
authorPrathamesh Kulkarni <prathamesh.kulkarni@linaro.org>2021-03-17 22:33:56 +0530
committerPrathamesh Kulkarni <prathamesh.kulkarni@linaro.org>2021-03-26 07:55:11 +0000
commit4a8fbb43593f20dde641f42d2c3fd20875da1d66 (patch)
treea863a683ef40fa0303daaf38d76424a322bee6a6 /round-robin.sh
parentff52371e08cf84dc989bfd6c84806cb4f7c3765c (diff)
Make build_abe apply an optional patch for $component specified by --patch.
The change lets build_abe take an optional argument following --patch, that specifies a patch to be applied for $component. And in tcwg_bmk-build.sh, apply linaro-local/vect-metric-branch to stage-2 gcc for applying vect metric patch. Change-Id: Ica927685e40ea0ae3988557e5cb561c83abf2f3b
Diffstat (limited to 'round-robin.sh')
-rw-r--r--round-robin.sh26
1 files changed, 25 insertions, 1 deletions
diff --git a/round-robin.sh b/round-robin.sh
index ee18731d..297e4646 100644
--- a/round-robin.sh
+++ b/round-robin.sh
@@ -319,6 +319,12 @@ build_abe ()
shift
done
+ local patch_branch=""
+ if [ $# -gt 0 ] && [ x"$1" = x"--patch" ]; then
+ patch_branch="$2"
+ shift 2
+ fi
+
if [ x"$project" = x"gcc" ] && [ $# != 0 ]; then
stage="$stage $*"
fi
@@ -332,6 +338,7 @@ build_abe ()
local custom_abe_src_opt=""
local git_dir="$project"
+ local n_patches=0
case "$component" in
# Use our custom sources for everything, but kernel headers and dejagnu.
linux|dejagnu) ;;
@@ -342,6 +349,12 @@ build_abe ()
if ! $check; then
clone_repo $project
+ if [ x"$patch_branch" != x"" ]; then
+ git -C $project fetch "https://git.linaro.org/toolchain/$project.git" "refs/heads/$patch_branch"
+ git -C $project cherry-pick FETCH_HEAD
+ n_patches=1
+ fi
+
# Don't use ABE's repo clone functions and setup abe/snapshots/
# directory to have the right entries.
local git_path
@@ -398,7 +411,18 @@ build_abe ()
$target_opt \
--extraconfigdir config/master \
$custom_abe_src_opt \
- $stage
+ $stage &
+ res=0 && wait $! || res=$?
+
+ # Revert patches if applied.
+ if [ -d ../$project ]; then
+ git -C ../$project reset --hard HEAD~$n_patches
+ fi
+
+ # If abe failed to build component, return exit status.
+ if [ x"$res" != x"0" ]; then
+ return $res
+ fi
ccache -s
if $check; then