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

Re: [PATCH 0/5] tools/tests: More cleanup for automation improvements


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 16 Jun 2021 16:14:15 +0200
  • 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-SenderADCheck; bh=F2tpvVs5LBonr6F4loQtC2jEdHbJJ3jKJIJ2pWSo1qw=; b=ZXV5mzueSi1hp3eQuwVx19rr5yii74dtTcbXiIXss3+0OYPDnU7zligMQOuacdGPaNK78SGwaF9VI1V00vuyFqo56QbONxV7ybyuuUATtAIPt/nQ5XEqeBiLzMTZeAO1C0td7ymFeulg9PoKnyyP+Vg24wMz1srPaANCPAv7Z066lBwEdpFTEgJQxLUVCQU61NB2VBhDxq+SqgAMUdQtJpxDe7NJ038fOf4MrZtBdjUIpwK75Vi7YvBxJdka9kbcDHzNI4wgLSBs4dA1pjtq8aumJFRofLY56OsRgaRKYsAWaSlnG+Ib5e66axvteamZrxzYJ2F3D1v+owlLwKS/xw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SRElto/ZisgzpoUO14o1GrsioCGUFnLecs1EQ0+FxoWQwSKQ3kPQSBmZ/4ErIE1YTHIwT2XFw6COnGYP5DdjQ4kSq9fisJhTjLZ5bacWFEPuOIN8dhBQcp39POYHI3ht1jFuWNKrvQnPPysTZKZQlF4+vAQqdQ2UXsbz/mHDz206+fA04RmuCL6FRG3NmU9ccjaf9hb9CI5NB+8ichGmUs6IIT1sae6r3Hjc115bpPv3+mOhTp3Jd5r2H4tPVzbKkNG+5bH2pUXnqwtUOPFbJaCrDQWghraEVADZoC/vvUEfZab1ZTQkWPrrdUAQ5fTiGg/h95VZhSnWH52bWjr50g==
  • Authentication-results: lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=none action=none header.from=suse.com;
  • Cc: Ian Jackson <iwj@xxxxxxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Wed, 16 Jun 2021 14:14:27 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 16.06.2021 15:22, Andrew Cooper wrote:
> On 16/06/2021 07:38, Jan Beulich wrote:
>> On 15.06.2021 18:19, Andrew Cooper wrote:
>>> Jan/Roger: x86_emulator and vpci use $(HOSTCC) not $(CC).  While they are 
>>> unit
>>> tests, we still potentially want to run them in dom0 rather than the build
>>> environment - particularly for x86_emulator which is heavily CPUID based and
>>> wants to run on a wide set of hardware.  Any issues moving them off 
>>> $(HOSTCC)?
>> Well, yes, I'm afraid: If anything, we may need to build two binaries,
>> or build the one binary two different ways: The "run" (and "run32" for
>> the emulator harness) target wants a binary built with HOSTCC. The
>> install target (which prior to your series does nothing) indeed wants
>> building with CC. So maybe we want something like
>>
>> install: HOSTCC:=$(CC)
>>
>> plus suitable detection of whether the opposite set of objects are
>> presently in the build area, requiring a full rebuild? (Of course this
>> will work only as long as HOSTCC isn't used for any build time helper
>> binaries. See "x86emul: test AMX insns" for when this starts not to be
>> the case anymore for the emulator harness. So we'd need yet another
>> variable to express this detail.)
> 
> Having slept on the problem overnight, I'm going to argue that HOSTCC is
> conceptually wrong to use here in the first place.
> 
> In an arm64 environment, cross-compiling x86_64, this will explode
> everywhere, and the fault is with using HOSTCC rather than CC.

In principle, if there wasn't the massive amount of inline assembly,
and if the emulator wasn't just re-executing the instructions it is
asked to emulate, building all of this on Arm ought to be possible.
But with the code we have this simply makes no sense.

> HOSTCC is specifically for compiling utilities executed as part of the
> build.  Tests, and particularly arch-specific ones like x86_emulate, are
> not in this category.

Hmm, right now they definitely are. Running them directly (which is
their only purpose right now, with the install targets doing nothing)
from the build tree puts them into this category. But they aren't
anymore as soon as you want to install them. Hence the need to have
two modes here.

>  Whether you happen to be able to run
> test_x86_emulator in the build environment is a property of whether
> you're cross-compiling.

In a way, yes. I'd consider the run32 target to also be cross-like,
yet that binary can then still be run from the build tree (if the
distro supports 32-bit binaries).

> For a non-cross-compiled builds, HOSTCC and CC are largely
> interchangeable, and won't impact the ability to run the binary in the
> build environment.

Not exactly, I think. If I override CC but not HOSTCC (which I do
normally), I still don't need to worry about that other CC finding
all the bits and pieces it needs for building a host binary. For the
C compiler this may not mean much, but the C++ compiler (if we used
it and hence would need to treat it similarly) wants e.g. its own
copies of the headers, which may not be readily available. I will
admit that my environment may be pretty non-standard, as I run non-
default compilers (and binutils) also directly from their build
trees. But things have been working fine this way for all sorts of
projects, so I expect the test harness here to not break in this
regard.

Jan




 


Rackspace

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