From eb820eae8fd73d90722393e75ae537e541ae169c Mon Sep 17 00:00:00 2001 From: Ross Lagerwall Date: Tue, 20 Oct 2015 10:55:16 +0100 Subject: [PATCH] Add support for specifying the path to xen-syms This allows linking against a different xen-syms from the original built. This may be useful if the compile environment or source code is slightly different. --- xsplice-build | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/xsplice-build b/xsplice-build index 8b917a1..ff8e1c0 100755 --- a/xsplice-build +++ b/xsplice-build @@ -29,6 +29,7 @@ CPUS="$(getconf _NPROCESSORS_ONLN)" DEBUG=n XEN_DEBUG=n SKIP= +XENSYMS=xen-syms warn() { echo "ERROR: $1" >&2 @@ -109,7 +110,7 @@ function create_patch() mkdir -p "output/$(dirname $i)" || die echo "Processing ${i}" echo "Run create-diff-object on $i" >> "${OUTPUT}/create-diff-object.log" - "${SCRIPTDIR}"/create-diff-object $debugopt "original/$i" "patched/$i" xen-syms "output/$i" &>> "${OUTPUT}/create-diff-object.log" + "${SCRIPTDIR}"/create-diff-object $debugopt "original/$i" "patched/$i" "$XENSYMS" "output/$i" &>> "${OUTPUT}/create-diff-object.log" rc="${PIPESTATUS[0]}" if [[ $rc = 139 ]]; then warn "create-diff-object SIGSEGV" @@ -148,9 +149,10 @@ usage() { echo " -k, --skip Skip build or diff phase" >&2 echo " -d, --debug Enable debug logging" >&2 echo " --xen-debug Build debug Xen" >&2 + echo " --xen-syms Build against a xen-syms" >&2 } -options=$(getopt -o hs:p:o:j:k:d -l "help,srcdir:patch:output:cpus:,skip:,debug,xen-debug" -- "$@") || die "getopt failed" +options=$(getopt -o hs:p:o:j:k:d -l "help,srcdir:patch:output:cpus:,skip:,debug,xen-debug,xen-syms:" -- "$@") || die "getopt failed" eval set -- "$options" @@ -193,6 +195,12 @@ while [[ $# -gt 0 ]]; do outputarg="$1" shift ;; + --xen-syms) + shift + XENSYMS="$(realpath -m -- "$1")" + [ -f "$XENSYMS" ] || die "xen-syms file does not exist" + shift + ;; --) shift break -- 2.39.5