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

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


  • To: Jan Beulich <jbeulich@xxxxxxxx>, Anthony Perard <anthony.perard@xxxxxxxxxx>
  • From: Ross Lagerwall <ross.lagerwall@xxxxxxxxxx>
  • Date: Thu, 9 Feb 2023 11:40:06 +0000
  • Accept-language: en-US
  • 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
  • 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=PF7vTThuVCOAUt/1NEGOBbhrKn/lQ2AKokltyd0IAj8=; b=Qpxf0Ejq5D31Oyc4xqeRh5drGG+lEhzPhivbd+U0Nc9UvpGAmfYgH53rkummTMT8MLTVMdNa/Vcjfkya4X82ZJ4WICqYuUrCMCUMYKWYJquO0JI7ZHpZeV8uPg0AQq5JgH455pfoMEZAQ+qKN0XHRfvFEXiFNkTNHaIsdWJ3R71UEffKOUefC/WP0tTbRMKAQCptZEFzXbVgqrgtl9UOoWjPsJze0uN95Mam7p2yvxJ69/8lUlA583fT+ghdw3XtqtfCO87uPIOCDLbmR9jNeCH/B2U56JaIGvzPSCe6eYz60dWOUzcQI/0p3ltrZ0hnsYHxwgF9AvDJNGVybQFKiw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TFh1bluAtKMN5eV29zapSuHwobx81LvXZfTRDHTD0+vCBgXdbIraWlyjA7C0RuVaF9/n9vOlkbgLwLVuhrrK4kTp+r6LouYcuOCLFEvQBdA2AiLJvIr29ifii+SJBRS1aINSp6TPlpOjLRJO6ASRFwWIru4SRaddEMUL0o8Vgp5UoA6ejdSHIthYkS4OGEdTLW9c70kfgQMlhVqsGmmQUOWuVigQAH3ekbSHf13zpGUC/uoIGmY7JTr7ONo1H77Pw++jP6+M5TImdmR1xRmv9LwyfRwz8YPyHUGHuCyq8E4QZimuwaXkEJbmRSP87pc/rPgTUjahnSBGsV/KjKgjUA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.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" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Thu, 09 Feb 2023 11:40:47 +0000
  • Ironport-data: A9a23:fpL92aAugFdMkxVW/+Piw5YqxClBgxIJ4kV8jS/XYbTApGsr1DUPy GNJCD2GbKrZZ2TyL911bo6xpE4B68eExtIwQQY4rX1jcSlH+JHPbTi7wuUcHAvJd5GeExg3h yk6QoOdRCzhZiaE/n9BCpC48T8nk/nOHuGmYAL9EngZbRd+Tys8gg5Ulec8g4p56fC0GArIs t7pyyHlEAbNNwVcbyRFtMpvlDs15K6p4GlA7wRnDRx2lAS2e0c9Xcp3yZ6ZdxMUcqEMdsamS uDKyq2O/2+x13/B3fv8z94X2mVTKlLjFVDmZkh+AsBOsTAbzsAG6Y4pNeJ0VKtio27hc+ada jl6ncfYpQ8BZsUgkQmGOvVSO3kW0aZuoNcrLZUj2CA6IoKvn3bEmp1T4E8K0YIw//1FKl0f+ s4hCgsBTyCogbPszLSQc7w57igjBJGD0II3nFhFlGmcJ9B5BJfJTuPN+MNS2yo2ioZWB/HCa sEFaD1pKhPdfxlIPVRRA5U79AuqriCnL3sE9xTK/exuuzO7IA9ZidABNPLPfceRA8FckUuCu WvC+0zyAw0ANczZwj2Amp6prr6fwn2rBdlIfFG+3uFTslecwE0zMQ8fcEma/fyplmiEX/sKf iT4/QJr98De7neDTNPwQhm5q36spQMHVpxbFOhSwAOQzqvZ5S6JC25CSSROAPQ9r9M/TzEu0 l6PnvvqCCZpvbnTTmiSnp+LqRuiNC5TKnUNDQcUQA1A79T9rYUbihPUUs0lAKOzlsfyGzz73 3aNtidWulkIpcsC1qH+91aYhTup/8DNVlRsvl6RWX+55ARkYoLjf5av9VXQ8fdHKsCeU0WFu 38H3cOZ6YjiEK2wqcBEe81VdJnB2hpPGGe0bYJHd3X5ywmQxg==
  • Ironport-hdrordr: A9a23:Y/L+MaltmHpyaepdFoaH10bDsoDpDfMsimdD5ihNYBxZY6Wkfp +V8cjzhCWftN9OYhodcIa7Sde9qADnhOZICOgqTNGftWzd1FdAQ7sSircKrweQfhEWs9Qtr5 uIEJIOauEYb2IK9voSiTPQe7lPsbq6HbiT5ds2jU0dMD2CA5sQnjuRYTzrbXGeMTM2eabReq DsgvavkwDQCUj/I/7LTkUtbqzmnZnmhZjmaRkJC1oO7xSPtyqh7PrAHx2Rzn4lIkRyKeNJyw n4uj28wp/mn+Cwyxfa2WOWxY9RgsHdxtxKA9HJotQJKx334zzYJbhJavmnhnQYseuv4FElnJ 3nuBE7Jfl+7HvXYyWcvQbt4Q/9yzwjgkWSh2NwuUGT4fAReQhKR/apxLgpPycx0nBQ9u2UBZ g7kF5w/vBsfGr9dCeU3am9a/glrDv2nZMYq59ns5Vua/psVFZvl/1swKp0KuZ3IMuo0vFvLA ApNrCW2Mpr
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Msip_labels:
  • Thread-index: AQHZO+JENUXJLbr7Kk6Vg23vMgRDg67GTYoAgAAe+3g=
  • Thread-topic: [PATCH] build: Make FILE symbol paths consistent

> From: Jan Beulich <jbeulich@xxxxxxxx>
> Sent: Thursday, February 9, 2023 8:44 AM
> To: Ross Lagerwall <ross.lagerwall@xxxxxxxxxx>; Anthony Perard 
> <anthony.perard@xxxxxxxxxx>
> 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 <xen-devel@xxxxxxxxxxxxxxxxxxxx>
> Subject: Re: [PATCH] build: Make FILE symbol paths consistent 
>  
> 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.

035ab75d8e37 ensures uniqueness for symbols but it doesn't ensure they
are consistent when using out of tree builds, i.e. the FILE symbols are
the same regardless of the value of "O=". Since this inconsistency
could only happen after out-of-tree builds were introduced, I guess it
should be:
Fixes: 7115fa562fe7 ("build: adding out-of-tree support to the xen build")

> 
> > --- 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.

I think that's backwards. The check is: if !(cc_is_clang && clang-version < 6)

I can mention in the description that this change doesn't cover older
versions of clang (which presumably have never worked with
livepatch-build-tools since it embeds full paths but that is a separate
issue).

> 
> > +        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.

I'm not sure if there is much consistency since other variables like
abs_srctree and abs_objtree also use underscores but I can change it
if you prefer.

Ross


 


Rackspace

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