From nobody Mon May 13 06:47:55 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=reject dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1702544108; cv=none; d=zohomail.com; s=zohoarc; b=gf4zYhsfQ1ILoRylBzYazuaHL+GihNkQ78DFdiiLZuwOsz8fkt/ac2C/z/eBLAfvQ+ojy1ACx0GoOuQKwUTxWX9ApDGV/69lLH767CRfGoZCKf0vEeaxQdb2VhBMalK9fcPygoXxrFd3+MnKXAA5k5JzvmlLHjQX8zuh3pkIqHw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1702544108; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=FvgrAtAP6VYVedQI8IfKjme4qoauzMRvA4DIc1jKOdw=; b=bXNwZHtqp8V2d+KgOjCGs1CPNgCIBZVRDCpiAC+2UxiHhdf52Oohjc2tbz4jyNbf/sYaw7eAbfmgbEYvOrVGA+se+mBpO+9xszAt+szna+KAlO/5lT0Q4vUcLl/Fqc0RrXUYJBl3Q42D8L/QCpPiz92S3W+nPcVUR5talOxPwkc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1702544108978321.76682465988085; Thu, 14 Dec 2023 00:55:08 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.654346.1021157 (Exim 4.92) (envelope-from ) id 1rDhUU-0008NR-1Y; Thu, 14 Dec 2023 08:54:46 +0000 Received: by outflank-mailman (output) from mailman id 654346.1021157; Thu, 14 Dec 2023 08:54:46 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rDhUT-0008NK-Uq; Thu, 14 Dec 2023 08:54:45 +0000 Received: by outflank-mailman (input) for mailman id 654346; Thu, 14 Dec 2023 08:54:44 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rDhUS-0008NC-NF for xen-devel@lists.xenproject.org; Thu, 14 Dec 2023 08:54:44 +0000 Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [2a00:1450:4864:20::432]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 6c631de5-9a5e-11ee-98e9-6d05b1d4d9a1; Thu, 14 Dec 2023 09:54:43 +0100 (CET) Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-3333131e08dso8273516f8f.2 for ; Thu, 14 Dec 2023 00:54:43 -0800 (PST) Received: from localhost ([213.195.127.70]) by smtp.gmail.com with ESMTPSA id q9-20020a05600000c900b0033330846e76sm15512801wrx.86.2023.12.14.00.54.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 00:54:41 -0800 (PST) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 6c631de5-9a5e-11ee-98e9-6d05b1d4d9a1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1702544082; x=1703148882; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=FvgrAtAP6VYVedQI8IfKjme4qoauzMRvA4DIc1jKOdw=; b=Ztf/xUt9RuQGq7gEiJBGCnfhZ12abaA6xgyEk6hWUonY3wgCLdt/XfYhe3UIBnhMdk w+jzpc3KWbHiYPt+s/2jrqzeb0ezZz1VBP3QOFZ7dU5s73UQhUmzPwj+fAGOZiyCipNo 9KE0LDH4DJA2sOaJBej1lURc4lP3tBpQx7APc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702544082; x=1703148882; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=FvgrAtAP6VYVedQI8IfKjme4qoauzMRvA4DIc1jKOdw=; b=ROIobfAziuRHsz5FlAwiQPczsKJBbNvOAn+C4uO8Gr9p1wrKMOY7CUmLe51jyEDQud qcGZJfaD/dLx9xBI35SeVfv1q0s0po7j057UnU2WTEjJEu1q0VWibfsLS6P324dv60aG U6Bc6PoqfUJZhN5MeUhsZEIQuHcFE/mo6SyynJVntbTzkOyTckn0xh9Ut7kSnkel+vxK pPw0/ZxfBWR5bBfqonWRM8zJiZiEf5sMUC9fOXMg6ZEn39kSrEJ5EvfQ1aDI9D0Eov5B 3ZPkqs/xgwms6cgEkZi7qvcVRxUMtL8QhrrOzonW6giZKwF4NV6CGH6UbEMi5pAFw1U4 /quw== X-Gm-Message-State: AOJu0Ywbz826lcfvLsv00KAOXR/YJ5bl7Frq8FseMky9o0GdTJhQT6NY UljxY7zOTTYM8kcA6WgVrnIsN2O5w/9fBvCEat4= X-Google-Smtp-Source: AGHT+IFU8Qv/tdCnT5BeSTEX/hkrxGa9t0zfcoWcV+Xqvp15vnK39v0RQF4OE00yGG4MnkqHBsQhaQ== X-Received: by 2002:a05:6000:1370:b0:336:49da:57f with SMTP id q16-20020a056000137000b0033649da057fmr170089wrz.51.1702544082073; Thu, 14 Dec 2023 00:54:42 -0800 (PST) From: Roger Pau Monne To: xen-devel@lists.xenproject.org Cc: Konrad Rzeszutek Wilk , Ross Lagerwall , Roger Pau Monne , Andrew Cooper Subject: [PATCH v2] livepatch-build-tools: allow livepatching version.c Date: Thu, 14 Dec 2023 09:54:24 +0100 Message-ID: <20231214085424.16890-1-roger.pau@citrix.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @citrix.com) X-ZM-MESSAGEID: 1702544109998100001 Currently version.o is explicitly ignored as the file would change as a res= ult of the orignal and the patched build having possibly different dates, times= or changeset strings (by the patched build appending -dirty). Fix such difference by exporting the date and time from the build script, so that both builds share the same build time. The changeset string gets set = in .scmversion, and is cleaned on script exit if it wasn't present initially. = 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 and .scmversion has been supported since before livepatch support was added to Xen, so it's saf= e to export those variables unconditionally. Reported-by: Andrew Cooper Signed-off-by: Roger Pau Monn=C3=A9 Reviewed-by: Ross Lagerwall --- Changes since v1: - Also ensure consistent changeset version. --- livepatch-build | 14 ++++++++++++++ livepatch-gcc | 2 -- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/livepatch-build b/livepatch-build index e2ccce4f7fd7..332d26f5c6b6 100755 --- a/livepatch-build +++ b/livepatch-build @@ -392,6 +392,10 @@ echo "Output directory: $outputarg" echo "=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D" echo =20 +cleanup_version() { + rm -rf "${SRCDIR}/xen/.scmversion" +} + if [ "${SKIP}" !=3D "build" ]; then # Make sure output directory doesn't exist, and create it. [ -e "$outputarg" ] && die "Output directory exists" @@ -417,6 +421,16 @@ if [ "${SKIP}" !=3D "build" ]; then =20 export CROSS_COMPILE=3D"${TOOLSDIR}/livepatch-gcc " =20 + # Force same date and time to prevent unwanted changes in version.c + export XEN_BUILD_DATE=3D`LC_ALL=3DC date` + export XEN_BUILD_TIME=3D`LC_ALL=3DC date +%T` + + # Ensure uniform changeset between builds + if [ ! -e "${SRCDIR}/xen/.scmversion" ]; then + trap cleanup_version EXIT + echo "unavailable" > "${SRCDIR}/xen/.scmversion" + fi + echo "Perform full initial build with ${CPUS} CPU(s)..." build_full =20 diff --git a/livepatch-gcc b/livepatch-gcc index fcad80551aa0..e4cb6fb59029 100755 --- a/livepatch-gcc +++ b/livepatch-gcc @@ -33,7 +33,6 @@ if [[ "$TOOLCHAINCMD" =3D~ $GCC_RE ]] ; then obj=3D$2 [[ $2 =3D */.tmp_*.o ]] && obj=3D${2/.tmp_/} case "$(basename $obj)" in - version.o|\ debug.o|\ check.o|\ *.xen-syms.*.o|\ @@ -63,7 +62,6 @@ done elif [[ "$TOOLCHAINCMD" =3D~ $OBJCOPY_RE ]] ; then obj=3D"${!#}" case "$(basename $obj)" in - version.o|\ debug.o|\ check.o|\ boot.o|\ base-commit: 0ed8ef88dc300750696a64e89efa3b82502f6dc7 --=20 2.43.0