From patchwork Thu Nov 28 14:51:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Lagerwall X-Patchwork-Id: 11266121 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 12CEE13B6 for ; Thu, 28 Nov 2019 14:53:05 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E255221771 for ; Thu, 28 Nov 2019 14:53:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=citrix.com header.i=@citrix.com header.b="LTr1kreh" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E255221771 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=citrix.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iaL97-0000oN-8a; Thu, 28 Nov 2019 14:51:53 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iaL95-0000oI-PM for xen-devel@lists.xenproject.org; Thu, 28 Nov 2019 14:51:51 +0000 X-Inumbo-ID: 953b2b5f-11ee-11ea-a3d3-12813bfff9fa Received: from esa1.hc3370-68.iphmx.com (unknown [216.71.145.142]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 953b2b5f-11ee-11ea-a3d3-12813bfff9fa; Thu, 28 Nov 2019 14:51:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1574952701; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=qSFGDub9dwV2EFLWtKK8KYIfUxh/CZEHhtBfPNddfo0=; b=LTr1krehe4M5esb7URaAENMW2NrhIpZiZs4ZHqh2HW5QMBwSSqPbcdOz jZPH9sT7/JsQ4GKIMmhWR2tI/pagHZb8KwIXixweVyJZYef3nUNkmm7wH 2xX47h1wCPhWx45OkMcOqvRXF5tYGZcZG2I6W9lttyObM7A348QtBOMMK 4=; Authentication-Results: esa1.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=ross.lagerwall@citrix.com; spf=Pass smtp.mailfrom=ross.lagerwall@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: None (esa1.hc3370-68.iphmx.com: no sender authenticity information available from domain of ross.lagerwall@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa1.hc3370-68.iphmx.com; envelope-from="ross.lagerwall@citrix.com"; x-sender="ross.lagerwall@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa1.hc3370-68.iphmx.com: domain of ross.lagerwall@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa1.hc3370-68.iphmx.com; envelope-from="ross.lagerwall@citrix.com"; x-sender="ross.lagerwall@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ip4:168.245.78.127 ~all" Received-SPF: None (esa1.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa1.hc3370-68.iphmx.com; envelope-from="ross.lagerwall@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: lr+2sJexp+jG5hwxQ8JmZLcygHP4f0QAhP+ustAiiB7IAXNypAR1LUccuTKtX3t9EKRlqRoS2W mh8Th0Z1Ir8srDKkhPK4matNwByHxkAtwJoDS9cXo2pUvEQfI4HqrZnVziC2IQSfmVsEuR4Xdn 2W2/Md+NVqKP6m2BDfioLFyHVCsyRpJA3Uc02yXkmw+wgeSFZnSkFOavjOrB+L5l5ZAOXe3XQl aoU4GjFPh2zYUP38MVbjn9QYSS7FY+FIU98Uw7dAKtQVupTSooY6MN9I86hjyFt5nXgq0OTXLU KX4= X-SBRS: 2.7 X-MesageID: 9082639 X-Ironport-Server: esa1.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.69,253,1571716800"; d="scan'208";a="9082639" From: Ross Lagerwall To: Date: Thu, 28 Nov 2019 14:51:35 +0000 Message-ID: <20191128145135.11974-1-ross.lagerwall@citrix.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Subject: [Xen-devel] [PATCH LP-BUILD_TOOLS] Fix building with updated ENFORCE_UNIQUE_SYMBOLS behaviour X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Sergey Dyasli , Andrew Cooper , Ross Lagerwall , Jan Beulich , Konrad Rzeszutek Wilk Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" The patch "build: provide option to disambiguate symbol names" changes ENFORCE_UNIQUE_SYMBOLS so that gcc generates output to a temporary file and then objcopy is used to create the final object file. This breaks livepatch-build's interposition of GCC to capture the changed object files so intercept calls to objcopy as well to capture the final object files. While in the area, add a couple of extra object files to be ignored when patching. Signed-off-by: Ross Lagerwall --- With this change, I've built and successfully applied a trivial livepatch with Jan's patch applied and ENFORCE_UNIQUE_SYMBOLS turned on. To be applied at the same time as Jan's patch. livepatch-gcc | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/livepatch-gcc b/livepatch-gcc index 01e4b8c..91333d5 100755 --- a/livepatch-gcc +++ b/livepatch-gcc @@ -26,6 +26,7 @@ declare -a args=("$@") keep=no declare -r GCC_RE='gcc.*' +declare -r OBJCOPY_RE='objcopy.*' if [[ "$TOOLCHAINCMD" =~ $GCC_RE ]] ; then while [ "$#" -gt 0 ]; do if [ "$1" = "-o" ]; then @@ -34,7 +35,9 @@ if [[ "$TOOLCHAINCMD" =~ $GCC_RE ]] ; then case "$obj" in version.o|\ debug.o|\ + efi/check.o|\ *.xen-syms.*.o|\ + *.xen.efi.*.o|\ built_in.o|\ prelink.o|\ .*.o) @@ -56,6 +59,25 @@ if [[ "$TOOLCHAINCMD" =~ $GCC_RE ]] ; then fi shift done +elif [[ "$TOOLCHAINCMD" =~ $OBJCOPY_RE ]] ; then + obj="${!#}" + case "$obj" in + version.o|\ + debug.o|\ + efi/check.o|\ + .*.o) + ;; + *.o) + path="$(pwd)/$(dirname $obj)" + dir="${path#$LIVEPATCH_BUILD_DIR}" + if [ -n "$LIVEPATCH_CAPTURE_DIR" -a -d "$LIVEPATCH_CAPTURE_DIR" ]; then + echo "$dir/$obj" >> "${LIVEPATCH_CAPTURE_DIR}/changed_objs" + keep=yes + fi + ;; + *) + ;; + esac fi "$TOOLCHAINCMD" "${args[@]}"