From nobody Fri Nov 29 15:55:36 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=1637848053; cv=none; d=zohomail.com; s=zohoarc; b=No6AHixpLhX8fu1h63/ytC1tl3x8kv8pQ+nvUTmNR3uaDuc4Z5mLAwOkI0MtonJTv0yj0KTH2ZVCVtM+oKoGBQULZ0/2eL8Aodeb/OTj+GuKes7FQWuUpEep8VARpTuYlgpZcPNIYFS9ZKsPI3+T/VS/l83rXTSKvJD3Sh8bn/8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1637848053; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=HoN2Fs8Fs/HDdWtr5uuEJg59mjgUIRD4GY+2T9tMdNA=; b=UrCM6decKYDeEAAutvnl8z/S87HTOscdrTuQO4DjZoMxsNqmpuK8PcOfMWQsINuKzB1TfXfQPFT1soWVIorS3cR32v/cOInyEonJ+dYF86eFnumPvRK/XFgeAXtc60Xw6Txje8FqH7597rWkVT1PR7xK+hGiMneHoWDKtpgBiJE= 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 1637848053120587.2917465189068; Thu, 25 Nov 2021 05:47:33 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.231263.400155 (Exim 4.92) (envelope-from ) id 1mqF5q-00010R-NA; Thu, 25 Nov 2021 13:47:18 +0000 Received: by outflank-mailman (output) from mailman id 231263.400155; Thu, 25 Nov 2021 13:47:18 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mqF5q-0000zR-AY; Thu, 25 Nov 2021 13:47:18 +0000 Received: by outflank-mailman (input) for mailman id 231263; Thu, 25 Nov 2021 13:47:16 +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 1mqF0C-0007NX-8R for xen-devel@lists.xenproject.org; Thu, 25 Nov 2021 13:41:28 +0000 Received: from esa5.hc3370-68.iphmx.com (esa5.hc3370-68.iphmx.com [216.71.155.168]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 61f79501-4df5-11ec-9787-a32c541c8605; Thu, 25 Nov 2021 14:41:27 +0100 (CET) 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: 61f79501-4df5-11ec-9787-a32c541c8605 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1637847687; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=bOo1Z/T3w/mQYlFp7E4qcB5DbSAxG5uo05MNRdVl4wM=; b=WmeMt6eol6eXiJiDQHaBeQt+BeUhVjf6XdQmY1J5eqAzvPsjDKl2RmW9 fBfF96meiQC2+YtJH3JgiU8LOK6SugiFBBxSaDaQhi77B/lYOpVJISLjt +s5pmt3qAl9SosUcebiIBx5cJjErwRXCCE0trLZBiiPz2KetVd5saVsOY k=; Authentication-Results: esa5.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none IronPort-SDR: +AdAtrej9VQcLCNpbiZ2x08WtITeZXq32uP157ac+kl7ZTVAVH2dOY2W1eXGn48ZGsqdipKmEE g7jzeit6lnDIjV8o7ZQyrd7+W3sccuQy65coc+yXa/y0XtLgLB3XThh6jirkmAhbMXo6ZE4yRM 2G5lFJNbpycYnGhftFNwl1cjiQxxahMVOzqR5o/hjGoyLgrCE4RCOH3gRGGPFaiwKIji8G9cFA 3odwANGryscHjCRKm2/0QqB97rlFUCkU2ZLj/nNGndWbMst4sNJFkfXamG7APEKCGu86N/tPOM bnUU+YAQ3K24FPP8rX0UvgWR X-SBRS: 5.1 X-MesageID: 58135478 X-Ironport-Server: esa5.hc3370-68.iphmx.com X-Remote-IP: 162.221.156.83 X-Policy: $RELAYED IronPort-Data: A9a23:Gydnl65YohovGKVaAfNshwxRtMXAchMFZxGqfqrLsTDasY5as4F+v mcXXWiCbKrcazD8eN1yYdzk9kwGusSEyIdqTAo+r31hHi5G8cbLO4+Ufxz6V8+wwmwvb67FA +E2MISowBUcFyeEzvuV3zyIQUBUjclkfJKlYAL/En03FVAMpBsJ00o5wrdg2NMw27BVPivW0 T/Mi5yHULOa82Yc3lI8s8pvfzs24ZweEBtB1rAPTagjUG32zhH5P7pGTU2FFFPqQ5E8IwKPb 72rIIdVXI/u10xF5tuNyt4Xe6CRK1LYFVDmZnF+A8BOjvXez8CbP2lS2Pc0MC9qZzu1c99Zk NZPl5GpFgMSBe7TheoHcClnNHxPBPgTkFPHCSDXXc27ykTHdz3nwul0DVFwNoodkgp1KTgQr 7pCcmlLN03dwbLtqF64YrAEasALJc/3PIQZqzd4wCvQF/oOSpHfWaTao9Rf2V/cg+gTTa+FO pZGOVKDajzNZRZmJnMeUa5lhbm6olfaWBtDqGy88P9fD2/7k1UqjemF3MDuUt6XQ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lglPbJG05vUaO31ThwGg6nUXH wI= IronPort-HdrOrdr: A9a23:i+1JrK7viDgtcXJUdQPXwPDXdLJyesId70hD6qhwISY6TiX+rb HJoB17726NtN9/YhEdcLy7VJVoBEmskKKdgrNhWotKPjOW21dARbsKheCJrgEIWReOktK1vZ 0QCpSWY+eQMbEVt6nHCXGDYrQd/OU= X-IronPort-AV: E=Sophos;i="5.87,263,1631592000"; d="scan'208";a="58135478" From: Anthony PERARD To: CC: Anthony PERARD , Jan Beulich , Andrew Cooper , George Dunlap , Ian Jackson , Julien Grall , Stefano Stabellini , Wei Liu Subject: [XEN PATCH v8 25/47] build: rework coverage and ubsan CFLAGS handling Date: Thu, 25 Nov 2021 13:39:44 +0000 Message-ID: <20211125134006.1076646-26-anthony.perard@citrix.com> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20211125134006.1076646-1-anthony.perard@citrix.com> References: <20211125134006.1076646-1-anthony.perard@citrix.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @citrix.com) X-ZM-MESSAGEID: 1637848055297100001 Content-Type: text/plain; charset="utf-8" When assigning a value a target-specific variable, that also affect prerequisite of the target. This is mostly fine, but there is one case where we will not want the COV_FLAGS added to the CFLAGS. In arch/x86/boot, we have "head.o" with "cmdline.S" as prerequisite and ultimately "cmdline.o", we don't want COV_FLAGS to that last one. Signed-off-by: Anthony PERARD Reviewed-by: Jan Beulich --- Notes: v8: - reorder target-specific assignments - fix typo in comment - reviewed xen/Rules.mk | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/xen/Rules.mk b/xen/Rules.mk index 9eb3093f43fb..d6eabd3415b5 100644 --- a/xen/Rules.mk +++ b/xen/Rules.mk @@ -126,19 +126,31 @@ targets +=3D $(targets-for-builtin) =20 $(filter %.init.o,$(obj-y) $(obj-bin-y) $(extra-y)): CFLAGS-y +=3D -DINIT_= SECTIONS_ONLY =20 +non-init-objects =3D $(filter-out %.init.o, $(obj-y) $(obj-bin-y) $(extra-= y)) + ifeq ($(CONFIG_COVERAGE),y) ifeq ($(CONFIG_CC_IS_CLANG),y) COV_FLAGS :=3D -fprofile-instr-generate -fcoverage-mapping else COV_FLAGS :=3D -fprofile-arcs -ftest-coverage endif -$(filter-out %.init.o $(nocov-y),$(obj-y) $(obj-bin-y) $(extra-y)): CFLAGS= -y +=3D $(COV_FLAGS) + +# Reset COV_FLAGS in cases where an objects has another one as prerequisite +$(nocov-y) $(filter %.init.o, $(obj-y) $(obj-bin-y) $(extra-y)): \ + COV_FLAGS :=3D + +$(non-init-objects): _c_flags +=3D $(COV_FLAGS) endif =20 ifeq ($(CONFIG_UBSAN),y) # Any -fno-sanitize=3D options need to come after any -fsanitize=3D options -$(filter-out %.init.o $(noubsan-y),$(obj-y) $(obj-bin-y) $(extra-y)): \ -CFLAGS-y +=3D $(filter-out -fno-%,$(CFLAGS_UBSAN)) $(filter -fno-%,$(CFLAG= S_UBSAN)) +UBSAN_FLAGS :=3D $(filter-out -fno-%,$(CFLAGS_UBSAN)) $(filter -fno-%,$(CF= LAGS_UBSAN)) + +# Reset UBSAN_FLAGS in cases where an objects has another one as prerequis= ite +$(noubsan-y) $(filter %.init.o, $(obj-y) $(obj-bin-y) $(extra-y)): \ + UBSAN_FLAGS :=3D + +$(non-init-objects): _c_flags +=3D $(UBSAN_FLAGS) endif =20 ifeq ($(CONFIG_LTO),y) @@ -167,6 +179,9 @@ a_flags =3D -MMD -MP -MF $(depfile) $(XEN_AFLAGS) =20 include $(BASEDIR)/arch/$(TARGET_ARCH)/Rules.mk =20 +c_flags +=3D $(_c_flags) +a_flags +=3D $(_c_flags) + c_flags +=3D $(CFLAGS-y) a_flags +=3D $(CFLAGS-y) $(AFLAGS-y) =20 --=20 Anthony PERARD