All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] livepatch-build-tools: allow livepatching version.c
@ 2023-12-05 12:34 Roger Pau Monne
  2023-12-05 14:15 ` Andrew Cooper
  0 siblings, 1 reply; 7+ messages in thread
From: Roger Pau Monne @ 2023-12-05 12:34 UTC (permalink / raw)
  To: xen-devel
  Cc: Konrad Rzeszutek Wilk, Ross Lagerwall, Roger Pau Monne,
	Andrew Cooper

Currently version.o is explicitly ignored as the file would change as a result
of the orignal and the patched build having possibly different dates and
times.

Fix such difference by exporting the date and time from the build script, so
that both builds share the same build time.  This allows checking for changes
in version.c, since the rest of fields need to be manually changed in order to
produce different output.

Setting XEN_BUILD_{DATE,TIME} as an environment variable has been supported
since before livepatch support was added to Xen, so it's safe to export those
variables unconditionally.

Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
---
 livepatch-build | 4 ++++
 livepatch-gcc   | 2 --
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/livepatch-build b/livepatch-build
index e2ccce4f7fd7..f622683fc56c 100755
--- a/livepatch-build
+++ b/livepatch-build
@@ -417,6 +417,10 @@ if [ "${SKIP}" != "build" ]; then
 
     export CROSS_COMPILE="${TOOLSDIR}/livepatch-gcc "
 
+    # Force same date and time to prevent unwanted changes in version.c
+    export XEN_BUILD_DATE=`LC_ALL=C date`
+    export XEN_BUILD_TIME=`LC_ALL=C date +%T`
+
     echo "Perform full initial build with ${CPUS} CPU(s)..."
     build_full
 
diff --git a/livepatch-gcc b/livepatch-gcc
index fcad80551aa0..e4cb6fb59029 100755
--- a/livepatch-gcc
+++ b/livepatch-gcc
@@ -33,7 +33,6 @@ if [[ "$TOOLCHAINCMD" =~ $GCC_RE ]] ; then
             obj=$2
             [[ $2 = */.tmp_*.o ]] && obj=${2/.tmp_/}
             case "$(basename $obj)" in
-            version.o|\
             debug.o|\
             check.o|\
             *.xen-syms.*.o|\
@@ -63,7 +62,6 @@ done
 elif [[ "$TOOLCHAINCMD" =~ $OBJCOPY_RE ]] ; then
     obj="${!#}"
     case "$(basename $obj)" in
-        version.o|\
         debug.o|\
         check.o|\
         boot.o|\

base-commit: e588b7914e7afa3abb64b15a32fc2fdb57ded341
prerequisite-patch-id: 3419543c1c7c96b551db398518dbb10d81b3d5d9
prerequisite-patch-id: 640658ca7a1a21a540bfd6a862ff83669f70a065
prerequisite-patch-id: 650cd4210c2e73e9d2588b048be2c8278ae96acd
-- 
2.43.0



^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-12-13 17:09 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-05 12:34 [PATCH] livepatch-build-tools: allow livepatching version.c Roger Pau Monne
2023-12-05 14:15 ` Andrew Cooper
2023-12-05 14:57   ` Roger Pau Monné
2023-12-06 12:11     ` Ross Lagerwall
2023-12-11 10:42       ` Roger Pau Monné
2023-12-13 16:39         ` Ross Lagerwall
2023-12-13 17:09           ` Roger Pau Monné

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.