From patchwork Wed Mar 2 14:27:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Roger_Pau_Monn=C3=A9?= X-Patchwork-Id: 12766195 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 61D0DC433EF for ; Wed, 2 Mar 2022 14:29:44 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.282300.480967 (Exim 4.92) (envelope-from ) id 1nPPyv-0002VN-Cv; Wed, 02 Mar 2022 14:29:33 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 282300.480967; Wed, 02 Mar 2022 14:29:33 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nPPyv-0002VG-9O; Wed, 02 Mar 2022 14:29:33 +0000 Received: by outflank-mailman (input) for mailman id 282300; Wed, 02 Mar 2022 14:29:32 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nPPyu-0000Xm-Aw for xen-devel@lists.xenproject.org; Wed, 02 Mar 2022 14:29:32 +0000 Received: from esa1.hc3370-68.iphmx.com (esa1.hc3370-68.iphmx.com [216.71.145.142]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 2b7d3436-9a35-11ec-8539-5f4723681683; Wed, 02 Mar 2022 15:29:31 +0100 (CET) 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: 2b7d3436-9a35-11ec-8539-5f4723681683 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1646231371; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=F212JEjE8ExwUhiwnl1J2kabdh8N5NeS+VZ3pk+r8zo=; b=bLlF2pyyxeLHpuqIPZWdGIi24F0wDHdE/8hfv+LwYQDgpYVgcP4SxSzL /eH+Qx4FJe8lAhr1uLlJcDK8n+mFRO/Khub5rO5OhbHxNWDQhRCrhn2g0 7XAraAYhrbM+uJFij1kd1A669twZ+lU13i84pEjGqJYLi8swUy8QYdHT0 E=; Authentication-Results: esa1.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com X-SBRS: 5.1 X-MesageID: 65714265 X-Ironport-Server: esa1.hc3370-68.iphmx.com X-Remote-IP: 162.221.156.83 X-Policy: $RELAYED IronPort-Data: A9a23:lj14xKvZPaFo725k3SNvI1tLtOfnVHxeMUV32f8akzHdYApBsoF/q tZmKWqEParbMGL0KNB3bti/pEoGuJ/Uz4A1Sgc4/y4zRCMU+JbJXdiXEBz9bniYRiHhoOOLz Cm8hv3odp1coqr0/0/1WlTZhSAgk/nOHNIQMcacUsxLbVYMpBwJ1FQyw4bVvqYy2YLjW1jV4 4upyyHiEATNNwBcYzp8B52r8HuDjNyq0N/PlgVjDRzjlAa2e0g9VPrzF4noR5fLatA88tqBb /TC1NmEElbxpH/BPD8HfoHTKSXmSpaKVeSHZ+E/t6KK2nCurQRquko32WZ1he66RFxlkvgoo Oihu6BcRi8UJo7Cp8lFDyVfFjhTM4Rl5bzEHnaW5Jn7I03uKxMAwt1rBUAye4YZ5vx2ESdF8 vlwxDIlN07ZwbjsmfTiF7cq1p9LwMrDZevzvll6yj7UF7A+SI3rSKTW/95Imjw3g6iiGN6AO pVANWAxMXwsZTV3GWgnV7sdtdyti1PvKx9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pUGmjd3yRTo8BcYEr5leaAHl500pu8w5+L 5X3kqC3qAnQy/orWDY3ZzlRhtqnk27rT4JiugIlUFSVoMYdft4sZEfxkVIC50NdRiKp7zPKN MeTP002cwmMm9zNxvizytSKZ2XLzgO9y69Mwk/Upf/6UkSoJh7p3Fos/D30E1wsK7VcKM0ld gsAp4Y542mcfVmGJ6VfN1xOvdfKla9CC4kY1jiaWgOKsk8SgbwQtjMkfII2N0= X-IronPort-AV: E=Sophos;i="5.90,149,1643691600"; d="scan'208";a="65714265" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TRW+ahLuRH0wQAbwrnfdTFFqYrpkmDWxASA2uB825eLaCdboj3tQsJmd0QoxdVUCaIX3xK19RcvTdETXJJFDR1et7+tUiBs28sV0FIijI3oWRkkHSmDIsnkUtUwiK/VKQYDvxAIS/jYTLmPeTR5SyKewh8t3qjrtFwYmdrJ1aq0JCv5yO2nQkF8BW1LZHCTOJatHYXvoHv+sXesoyamWY8ZPyR6Tt2Bj8Wh8F3dCBr4fV+/QiKCbwKE8Dz1SZreuhwBJAh1QPGF2iwgTUNkjGf5OKU5AG1eufnWXjRCYJe5g10DTr2LSeI5gdgPZdeSt9RXzsUlUUKkL9sUjNUDmUg== 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=Ju2JmzDTMXMnNqshHl/210cGfKHE694TMbi1tFP55XY=; b=NyB64aYXGKLnKkx+C2kzmiRtLDNJ4ii1w9rKRK5mQchD2wEVoZ6WhaMtBPumvbE5fh0aR8gOPwilNjT70qvvict84fhPm3Lkgcalqd4ZM4SfrLqVTMoodcPUZaIwrmSNSGsQqM9yxpPiEjbBZqrRq/p3wVAcRNS3xaPiHLahKVArB9GBWlZlEwM6WcjahNYCa+qpWeZ7xHth6VrftRAuuaWpJQTVHs5Tcp6O/7JvFbmOjfyHLNxcP6PnMpuZyUX7zCRtWIBn9T1qR0T0ZwW/Zceva7n5rh5XHGcxPXmIbrh4ofZHb0mMCQSObxQBBHpP+tOR8iNn0CNTv2boqxeaVA== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Ju2JmzDTMXMnNqshHl/210cGfKHE694TMbi1tFP55XY=; b=QNc2Q0GbP7TEKhy4HBRVKhpZYkQy/0SeXUgFcDwbE5C4mt73DxyIqKrCzcdB4EniEnoYpsgNa3bbZvYxv667L/aTmw3TiHLWyhjfSlAo2PJoLiKQEEeqOuvgXHZbB83PlIq2kGI9HYH6UKp7a10j9dkanVb5E4fLMKjMn59wswo= From: Roger Pau Monne To: CC: , , , , , Roger Pau Monne Subject: [PATCH 4/4] livepatch: differentiate between old and new build systems Date: Wed, 2 Mar 2022 15:27:11 +0100 Message-ID: <20220302142711.38953-5-roger.pau@citrix.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220302142711.38953-1-roger.pau@citrix.com> References: <20220302142711.38953-1-roger.pau@citrix.com> X-ClientProxiedBy: LO2P123CA0086.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:138::19) To DS7PR03MB5608.namprd03.prod.outlook.com (2603:10b6:5:2c9::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2ca53acc-a8a0-4fc0-4ac5-08d9fc590189 X-MS-TrafficTypeDiagnostic: BY5PR03MB5111:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: PBi1/X1DU4N/wu046ziwigGuxdf4LUwvJr4s8SyJR5wxuzreL7c16TTH0Bww3qJxGks/9tCFNui8Psiu2Z287Pgbbeu/g2UykZ8SMG65Q7dpxjm6MxblnGh2/LnbITVvax8M06wu9zJdr7SSYaRuyYbPx8aRHeH+71yeVISOdt8/bjTkganefUA4HQGb9eLUJeIwnTPcTddJq7dvIuADupfa4j37ZziQtyb3BhuKA0APD5x0+oUGflDEPu0BlU7I78irxEDs/NlIHOVjX8iNnprHtTFV9Ivx3OUk9RvJOdHSg/CQwZlf5FqC9KKIjJ4CZ6x4cUqbwSxaB8WZw/IEXtdUR7n4duFUhLxNvQpoQ8nuPY2QW3erNghk3Jz8SMmBkySGlQITX2eqMUFt/Y/4dPPfoC1XvZ9l+iLTLyACi6dJQWti76wqRow6sBJODD1OCkCr/txZ96kOmcrl/jfmDhXo/5QJvRhEcsdqyW8uUAcSf/MRJ/LLRtRfRH6GS7/zMNUiSwJc+nOQR7jdMzbKbPWViyITkBuH4brIUgAkX513bFJAmjpZwkRfjlwHV/LiR/fsKvhbNx9hk3Wig6JvnbIHhLi/afjRnoaT4CiXe3yq1W4Z2Ka4PfzvG+zNdPMZWlGVDt0maLL3q5nkV1v/xQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS7PR03MB5608.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(38100700002)(2906002)(6512007)(6506007)(82960400001)(83380400001)(186003)(2616005)(26005)(107886003)(6486002)(1076003)(36756003)(508600001)(4326008)(6916009)(316002)(86362001)(8936002)(8676002)(66476007)(66946007)(66556008)(6666004)(5660300002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf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pl8dngQW/2GQhAw3dAEjHpOlR2YsTub0bWjDalT1X?= =?utf-8?q?4Jggw5rV56pVnvxiEriNagxnUtsoNwnva0dE9l9+XnVsKeQwMPv53WppaDTvorxFW?= =?utf-8?q?PtRGmyGpsyr2+1rt8ZLzqM2MhKB+OssAys2ERoEcB+GE62/2TywGQHT3HK4C/gYJt?= =?utf-8?q?WpKpApnt8aDFmdUpdi1tGnTsLhmbv0Ah3hXTSzuGP7xReim31T6z8k8/C7/5htLHT?= =?utf-8?q?FsvZdTA0H+YxyOVXuz5c/wqh+Lb4cKnfkv1mrpep/dxL9iGlsbH6+7M7zhtmzUC//?= =?utf-8?q?3KvR52iYy12frK8XKB2bpu5PF6Xg1/oBnEgs+dLOSbjYY1OCyS0/U6AT1uwgklH/C?= =?utf-8?q?MCkKB0XPslXwwUeHegrNA1Cyvn6IENbIbRZbN2JdtVm0VEJCod55M//C78Tglw3yx?= =?utf-8?q?JStLcQ8ABI6cEHrDBnN3FTnvLr5gadIolngm3QBhTynqRNSfLow2jxM8wybKNo4X1?= =?utf-8?q?yWkAtW37Qb+/CeNj2UZ3ml6D6dpNWsunSjT2eJolI4gHSOHadHAcwtwGVEPkxbeB6?= =?utf-8?q?ZyvTBuejX8m6Fb1fhzGK/BDRSdN2WAiINAtajoT94HIqRxukU0Pux1YrRnx4yHrBK?= =?utf-8?q?z36QhrjbUE23lz+guxKRKMtSWeTPqa8NzbCtIp6qhNc9x++oTHklA7cAGwyoJ77yp?= =?utf-8?q?lPZmmdZzXG/xZ8HEKcTp9358sZeVK41++Rvq3IVCIylmN2BvQEWKOBc=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 2ca53acc-a8a0-4fc0-4ac5-08d9fc590189 X-MS-Exchange-CrossTenant-AuthSource: DS7PR03MB5608.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Mar 2022 14:29:07.0533 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: LjS7dSGqpEwBJn5id195MVJBByNLwPl0f7nY7yYVWw/v3RytnRUYeFkwdgcs2iox0+xhgM1wiPyjdVgocipsfQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR03MB5111 X-OriginatorOrg: citrix.com Do not attempt to modify the build system if CFLAGS are not set in Rules.mk, and instead rely on CONFIG_LIVEPATCH already setting -f{function,data}-sections. Signed-off-by: Roger Pau Monné Reviewed-by: Bjoern Doebel Reviewed-by: Ross Lagerwall --- This depends on getting the patch to add -f{function,data}-sections when using CONFIG_LIVEPATCH accepted. --- livepatch-build | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/livepatch-build b/livepatch-build index 38a92be..656cdac 100755 --- a/livepatch-build +++ b/livepatch-build @@ -98,14 +98,20 @@ function build_special() # Build with special GCC flags cd "${SRCDIR}/xen" || die - sed -i 's/CFLAGS += -nostdinc/CFLAGS += -nostdinc -ffunction-sections -fdata-sections/' Rules.mk - cp -p arch/x86/Makefile arch/x86/Makefile.bak - sed -i 's/--section-alignment=0x200000/--section-alignment=0x1000/' arch/x86/Makefile - # Restore timestamps to prevent spurious rebuilding - touch --reference=arch/x86/Makefile.bak arch/x86/Makefile - make "-j$CPUS" $XEN_DEBUG &> "${OUTPUT}/build_${name}_compile.log" || die - sed -i 's/CFLAGS += -nostdinc -ffunction-sections -fdata-sections/CFLAGS += -nostdinc/' Rules.mk - mv -f arch/x86/Makefile.bak arch/x86/Makefile + if grep -q 'nostdinc' Rules.mk; then + # Support for old build system, attempt to set -f{function,data}-sections and rebuild + sed -i 's/CFLAGS += -nostdinc/CFLAGS += -nostdinc -ffunction-sections -fdata-sections/' Rules.mk + cp -p arch/x86/Makefile arch/x86/Makefile.bak + sed -i 's/--section-alignment=0x200000/--section-alignment=0x1000/' arch/x86/Makefile + # Restore timestamps to prevent spurious rebuilding + touch --reference=arch/x86/Makefile.bak arch/x86/Makefile + make "-j$CPUS" $XEN_DEBUG &> "${OUTPUT}/build_${name}_compile.log" || die + sed -i 's/CFLAGS += -nostdinc -ffunction-sections -fdata-sections/CFLAGS += -nostdinc/' Rules.mk + mv -f arch/x86/Makefile.bak arch/x86/Makefile + else + # -f{function,data}-sections set by CONFIG_LIVEPATCH + make "-j$CPUS" $XEN_DEBUG &> "${OUTPUT}/build_${name}_compile.log" || die + fi unset LIVEPATCH_BUILD_DIR unset LIVEPATCH_CAPTURE_DIR