[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] build: Make FILE symbol paths consistent


  • To: Ross Lagerwall <ross.lagerwall@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 9 Feb 2023 09:44:00 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • 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=oSUux6/54go8UABCZxIEZeLRzksdaTnN8Sc75jvVj1A=; b=V7RJs5ghOz5TCKho7iwp+Lc71plYMGjrteEXHVWJ6qgGcwq0iIwnYkv+OAezSttdblhEyDxQM2C0YhvqEW1UhCzsyNNdkS7BqO3/uS8ToS+9I6ZFnNEvs8J+FuzLFw0KDEVSbu+A2CXxph6ukmZtk2OfFdtb5DgBp8d4zc5jZ6FFJqAwFF4iLztjYVvdLDXHGpnl8X+8EIvU0E6Tk76iv4jVb202YLB0jzsOo9CU/QKy5PAgq3tsSGVqU2Wz/OIaDsAh39yxU+Bmvrad6aemoN+dvbrxA6sUGRWxHIoBmTBIeF6dTvMQhpoOriQ0c+rEd0IBz4LH3/KMOgaZbzO9lQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=diVfFRjyW4jQxEkPjDup+bwZyucJ519j7ZLqe/bkRFoOsZ3Nd1oE4rsNesM5vRolrFQzsrwRSdFSbRTjAUkASJJwxMmLO2uuSqLknhmdaw6ao7UAtCemHQvHDUYVBz2pVCluaWoYJl6cuFAM2uRPQfBsdkXbvNilADrjIABCsvYy4jc6JbhN4Bq3MOnf4en23R/CLaIazDyMZxOzczIzkz7Qj9l1RHb146scPPZmFA4OXE3ve8yygkahRh2oP2VDZNgPiwBBk6YuNAo+L8oY2QcSGKfB+9HCXD+qov5BABWOGaX2SmhUrnfGOLQAWXc76MrefhLaQOnTuYweQbTuuw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Thu, 09 Feb 2023 08:44:22 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 08.02.2023 18:24, Ross Lagerwall wrote:
> The FILE symbols in out-of-tree builds may be either a relative path to
> the object dir or an absolute path depending on how the build is
> invoked. Fix the paths for C files so that they are consistent with
> in-tree builds - the path is relative to the "xen" directory (e.g.
> common/irq.c).
> 
> This fixes livepatch builds when the original Xen build was out-of-tree
> since livepatch-build always does in-tree builds.

Sounds all plausible, except that I was under the impression that as of
035ab75d8e37 ("build: fix enforce unique symbols for recent clang version")
things were consistent already. To clarify - Anthony, was this aspect
simply not considered at the time? What would help here is a Fixes: tag,
both for the purpose of review and for the purpose of deciding whether to
backport. It might be that 7a3bcd2babcc ("build: build everything from the
root dir, use obj=$subdir") is to blame, but I'm not really sure.

> --- a/xen/Rules.mk
> +++ b/xen/Rules.mk
> @@ -228,8 +228,9 @@ quiet_cmd_cc_o_c = CC      $@
>  ifeq ($(CONFIG_ENFORCE_UNIQUE_SYMBOLS),y)
>      cmd_cc_o_c = $(CC) $(c_flags) -c $< -o $(dot-target).tmp -MQ $@
>      ifneq ($(CONFIG_CC_IS_CLANG)$(call clang-ifversion,-lt,600,y),yy)

You're altering only logic for pre-6.0.0 Clang, aiui. This is something
that's absolutely necessary to state the latest in the description, but
perhaps already in the subject. Among other things that's also an aspect
when it comes to considering whether to backport.

> +        rel_path = $(patsubst $(abs_srctree)/%,%,$(call realpath,$(1)))

Personally I'm against use of underscores when dashes would do, and using
a dash here would also be consistent with e.g. ...

>          cmd_objcopy_fix_sym = \
> -         $(OBJCOPY) --redefine-sym $(<F)=$< $(dot-target).tmp $@ && rm -f 
> $(dot-target).tmp
> +           $(OBJCOPY) --redefine-sym $(<F)=$(call rel_path,$<) 
> $(dot-target).tmp $@ && rm -f $(dot-target).tmp
>      else
>          cmd_objcopy_fix_sym = mv -f $(dot-target).tmp $@
>      endif

... the several visible uses of $(dot-target) here.

Jan



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.