[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 1/3] livepatch: use basename to perform object file matching
- To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Roger Pau Monne <roger.pau@xxxxxxxxxx>
- Date: Thu, 10 Mar 2022 16:08:32 +0100
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=KPIrQ2uUJcoC3uPyB57aRxa3Wp1cquKb0s6A4/jRqUY=; b=NxmmD28ZgdFk2qdxSDGlXXzZE2AVaTxY0YOzbehPxsdl0NJM6ugm3nr0KsxNRe9J0+wP5y+11kAD55zGnhImn3tAUsn9PDY0Es52lHIqCvMjI/w2FGKyALaGcTqyMW+uXblWFRMn5sLvGWcWwJKb1cPemIzzKeVAb3YUT/rZYxWMaRwFFkrUXzLLwsprh/dkTRKroihr33LHgBLFlyPLxeEzPopWUAuurVlV3Mbhva/NuBoKJ3YtXGlDQ8Xou+8K++uBK8Cw61WgDG5d/HQteC5f9HLOuWVsxqg+DP7dxXeZUnmzeJo5nWeTYrfewvcj24qAlho1v+MYJVBxtD/xJg==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NIg/p07TqaXhi2rotEG8q51luUv+aJqcI0NRkE9s4qB7suMjtO0jeUE1/p3F9fKHZiLDAx1U5VCt+TraQThbf8tuVTgujg97bXCPlF+4Ze/8BwKOn5q7uJff5hfYjNX5PqNeUO23PnTN/qI0e61t9bZe6yTqSfxygNwRqC7KTmDfUcY7ehasFtr9A0HVG59/U57N12sZou3dP8Fbc392eoAnbL7uFJ3keTeCPRLmdoo/2VxUogfU12tlZsWaVyTKLyrIdroPiZYvV6gE5TN95/zMxlpbUcCuK80u6LuwVAZMgnTtrLRH9/mUEoG03gjwYSbEWn5Ifh6tYiwrIZzZng==
- Authentication-results: esa3.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
- Cc: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>, Ross Lagerwall <ross.lagerwall@xxxxxxxxxx>, <doebel@xxxxxxxxx>, Roger Pau Monne <roger.pau@xxxxxxxxxx>
- Delivery-date: Thu, 10 Mar 2022 15:11:49 +0000
- Ironport-data: A9a23:6iso96Cd5V6QnBVW/zLjw5YqxClBgxIJ4kV8jS/XYbTApG501GAHy GJNXj2GPq3fN2L8ctp0bY/i8ktQ7ZPdzYAyQQY4rX1jcSlH+JHPbTi7wuYcHM8wwunrFh8PA xA2M4GYRCwMZiaA4E/raNANlFEkvU2ybuOU5NXsZ2YgHWeIdA970Ug5w7Vg2tYy6TSEK1jlV e3a8pW31GCNg1aYAkpMg05UgEoy1BhakGpwUm0WPZinjneH/5UmJMt3yZWKB2n5WuFp8tuSH I4v+l0bElTxpH/BAvv9+lryn9ZjrrT6ZWBigVIOM0Sub4QrSoXfHc/XOdJFAXq7hQllkPht0 /x8r6KxZT0zHaTIt/xEfQBBCAZxaPguFL/veRBTsOSWxkzCNXDt3+9vHAc9OohwFuRfWD8Us 6ZCcXZUM07F17neLLGTE4GAguw5K8bmJsUHs2xIxjDFF/c2B5vERs0m4PcGgWZq3Z0STZ4yY eIHU2VeSBrKQyZXI2wIMswGuf2yhSfGJmgwRFW9+vNsvjm7IBZK+LTqPdDYfvSDQMxHmUDeq m+u12f+BAsTOJqAyD6G2nW2j+TLkGXwX4d6PK218LtmjUOewkQXCQYKTh2rrP+hkEm8VtlDb UsO9UITQbMarRLxCIOnBlvh/SDC7kV0t8ds//MS9Bqk+7Dq4iqjHEsNShFZMfI/rdQRSml/v rOWpO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vtChPlHb21LtBPB5ryw6SHlYndotvaPKA18A==
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
The changes in the Xen build logic has resulted in the compiler and
objcopy being called from xen/ instead of relative to each object
directory. This requires using basename so that the directory is not
taken into account when checking against the list of files to be
explicitly ignored.
Also adjust the paths used to store the differing object files, as
with the current logic the resulting path will be wrong when using
newer Xen versions, changed_objs would end containing entries like:
xen/arch/x86/hvm/vmx/arch/x86/hvm/vmx/vmx.o
Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
---
livepatch-gcc | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/livepatch-gcc b/livepatch-gcc
index 91333d5..fe782e0 100755
--- a/livepatch-gcc
+++ b/livepatch-gcc
@@ -32,10 +32,10 @@ if [[ "$TOOLCHAINCMD" =~ $GCC_RE ]] ; then
if [ "$1" = "-o" ]; then
obj=$2
[[ $2 = */.tmp_*.o ]] && obj=${2/.tmp_/}
- case "$obj" in
+ case "$(basename $obj)" in
version.o|\
debug.o|\
- efi/check.o|\
+ check.o|\
*.xen-syms.*.o|\
*.xen.efi.*.o|\
built_in.o|\
@@ -46,6 +46,7 @@ if [[ "$TOOLCHAINCMD" =~ $GCC_RE ]] ; then
*.o)
path="$(pwd)/$(dirname $obj)"
dir="${path#$LIVEPATCH_BUILD_DIR}"
+ obj=$(basename $obj)
if [ -n "$LIVEPATCH_CAPTURE_DIR" -a -d
"$LIVEPATCH_CAPTURE_DIR" ]; then
echo "$dir/$obj" >> "${LIVEPATCH_CAPTURE_DIR}/changed_objs"
keep=yes
@@ -61,15 +62,16 @@ if [[ "$TOOLCHAINCMD" =~ $GCC_RE ]] ; then
done
elif [[ "$TOOLCHAINCMD" =~ $OBJCOPY_RE ]] ; then
obj="${!#}"
- case "$obj" in
+ case "$(basename $obj)" in
version.o|\
debug.o|\
- efi/check.o|\
+ check.o|\
.*.o)
;;
*.o)
path="$(pwd)/$(dirname $obj)"
dir="${path#$LIVEPATCH_BUILD_DIR}"
+ obj=$(basename $obj)
if [ -n "$LIVEPATCH_CAPTURE_DIR" -a -d "$LIVEPATCH_CAPTURE_DIR" ];
then
echo "$dir/$obj" >> "${LIVEPATCH_CAPTURE_DIR}/changed_objs"
keep=yes
@@ -85,7 +87,7 @@ ret="$?"
if [[ "$keep" = "yes" ]] ; then
mkdir -p "$(dirname $LIVEPATCH_CAPTURE_DIR/$dir/$obj)"
- cp "$obj" "$LIVEPATCH_CAPTURE_DIR/$dir/$obj"
+ cp "$path/$obj" "$LIVEPATCH_CAPTURE_DIR/$dir/$obj"
fi
exit "$ret"
--
2.34.1
|