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

Re: [XEN PATCH v2] build: Fix x86 out-of-tree build without EFI


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • Date: Wed, 17 Aug 2022 15:12:50 +0100
  • Authentication-results: esa3.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Wed, 17 Aug 2022 14:13:20 +0000
  • Ironport-data: A9a23:a5RYZqm/1ESZ2LYEix3SdJ7o5gxMJkRdPkR7XQ2eYbSJt1+Wr1Gzt xJKC2GPPv+IMGGheIh2btixo00EuJKDzIRnSQE6+y02FSMWpZLJC+rCIxarNUt+DCFioGGLT Sk6QoOdRCzhZiaE/n9BCpC48T8mk/ngqoPUUIbsIjp2SRJvVBAvgBdin/9RqoNziJ2yDhjlV ena+qUzA3f4nW8vWo4ow/jb8kk37K2t4GpwUmEWPpingnePzxH5M7pHTU2BByOQapVZGOe8W 9HCwNmRlo8O105wYj8Nuu+TnnwiGtY+DyDX4pZlc/HKbix5jj4zys4G2M80Mi+7vdkrc+dZk 72hvbToIesg0zaldO41C3G0GAkmVUFKFSOuzdFSfqV/wmWfG0YAzcmCA2kmIqgH2b8uDVtS2 qwkOD0pRw+Bq9OPlefTpulE3qzPLeHuNYIb/Hph0SvYHbAtRpWrr6fivIECmm1q34YXQKiYN 5FxhTlHNXwsZzVGPEsXD5Qv2v+lnHDlfxVTqU6PpLpx6G/WpOB0+Oe9a4KNIIPXLSlTtmrBg VyY5mX+ORglDMGblBuf73S3oMaayEsXX6pNTeblp5aGmma7zGEJFAcfU1f9pPCjk1O/QPpWM UlS8S0rxYAM80isQsj4TgePineOtR4BWPJdC+Q/rgqKz8L88wufQ2QJUDNFQNgnr9MtAywn0 EeTmNHkDiApt6eaIVqC8p+EoDX0PjIaRUcAbyIZSQoO4/H4vZo+yBnIS75LErOxj9DzMSH9x XaNtidWr64IkccB2qG//FbGqzGhvJ7ESkgy/Aq/Y46+xlonPsj/PdXusAWFq6YbRGqEcrWfl Ggbvte9tbkCN42ixBCdTcEkA7OF1s/QZVUwnmVT84kdGyWFoiD9Jd4Lum0veS+FIe5fJ2a3P Ra7VRd5ocYKYSD0NfIfj5eZUZxC8ET2KTjyuhk4hPJqa4M5SgKI9ToGiaW4jzG0yxhEfU3S1 P6mnSeQ4ZUyU/0PIMKeHbt17FPS7nlWKZnvbZ761Q+79rGVeWSYT7wIWHPXML5hsvzY8VSJq o0DXydv9/m4eLyWX8Uq2dRLcQBiwYYTX/gaVPC7hsbce1E7SQnN+tfawK87epwNopm5Ytzgp yjlMmcFmQWXuJEyAV/VApyVQO+wAM0XQLNSFXBEAGtELFB9ONvws/9BKMVfkHtO3LUL8MOYh sItI62oasmjgByek9jBRfERdLBfSSk=
  • Ironport-hdrordr: A9a23:d3YNWa2QshVAz/fH/mtAvQqjBLIkLtp133Aq2lEZdPRUGvb3qy mLpoV+6faUskd1ZJhOo7290cW7LU80sKQFhrX5Xo3SPjUO2lHJEGgK1+KLqFfd8m/Fh41gPM 9bAs5D4bbLbGSS4/yU3DWF
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Wed, Aug 17, 2022 at 12:38:36PM +0200, Jan Beulich wrote:
> On 17.08.2022 11:15, Anthony PERARD wrote:
> > --- a/xen/common/efi/efi-common.mk
> > +++ b/xen/common/efi/efi-common.mk
> > @@ -9,9 +9,9 @@ CFLAGS-y += -iquote $(srcdir)
> >  # e.g.: It transforms "dir/foo/bar" into successively
> >  #       "dir foo bar", ".. .. ..", "../../.."
> >  $(obj)/%.c: $(srctree)/common/efi/%.c FORCE
> > -   $(Q)test -f $@ || \
> > -       ln -nfs $(subst $(space),/,$(patsubst %,..,$(subst /, 
> > ,$(obj))))/source/common/efi/$(<F) $@
> > +   $(Q)ln -nfs $(subst $(space),/,$(patsubst %,..,$(subst /, 
> > ,$(obj))))/source/common/efi/$(<F) $@
> 
> I'm afraid the commit message hasn't made clear to me why this part of
> the change is (still) needed (or perhaps just wanted). The rest of this
> lgtm now, thanks.

There's an explanation in the commit message, quoted here:
> >  The issue is that in out-of-tree, make might find x86/efi/stub.c via
> >  VPATH, but as the target needs to be rebuilt due to FORCE, make
> >  actually avoid changing the source tree and rebuilt the target with
> >  VPATH ignored, so $@ lead to the build tree where "stub.c" dosen't
> >  exist yet so a link is made to "common/stub.c".

The problem with `test -f $@` it doesn't test what we think it does. It
doesn't test for the presence of a regular file in the source tree as
stated in the original tree. First, `test -f` happily follow symlinks.
Second, $@ is always going to point to the build dir, as GNU Make will
try to not make changes to the source tree, if I understand the logic
correctly.

Instead of `test -f`, we could probably remove the "FORCE" from the
prerequisite, but there's still going to be an issue if there's a file
with the same name in both common and per-arch directory, when the common
file is newer.

So `test -f` needs to go.

Cheers,

-- 
Anthony PERARD



 


Rackspace

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