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

Re: [PATCH v2] tests/vpci: Use $(CC) instead of $(HOSTCC)


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: "Orzel, Michal" <michal.orzel@xxxxxxx>
  • Date: Wed, 4 Jun 2025 10:25:07 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=bjpbt+0/ueKdclJinFewhBc63ULLjOAw6TcJiBj7BW0=; b=xlSNwKpPzbBZKMXOeZ//mN8gAreroNofy6M47tAMT0l60krd6+NUYcqA8X/vj8el6x4zo95AE1/AJSKLem2hqixG5kapEJQE5MFgs8ZaAdHEWSEdip1PYlBoP/0+tMesvY1EDHzNKyXZu5e9CUg936ZpT91+a189TXAatJALE5brUpBkY6xRwYr4ubSwSxKeb/SD+OfZqUMKjO8n1Ih1D7gGytvv4LP7/dMh1RkPsl/hodifnmjFSIow8P1UkIScswZC4OZw8SfnRPAoELh2PdSrKtqzsDDTRG/pAQHwMrc8M1/R3be1H5KoWHjqdZGzCpxWiO6leS+3crZZFfZW4g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=j9uweb1VZ87CrPOXpUV0JQ9Ta6Ur/9Uf57rXK8/6swxvEgI24oTUumcmh+vWZy3S6tuG5SVuwuee7P5JpAZ54BZpU2enj1jAv4g97rU4RJZOuJp0vR7A/NRXou06/tkIw1/NnrtLpy9vV3Mtf22Ht1HXIiGFlSLpssz+OhV9I81Vu4Pgw1GpHOjc8NIsL8UzxEZvMaIZQy6DOIGTU4mvIYMfmYKLs6IUEUW9f2P2ltUPifWUIxPLq1/smq+R61b76bFNxenhmVEDNtSUtwQW0Wc4egl5F+N1ymyOdLPDLLgERKj4eAXY/3H89+VozK2O7otiY6Y6G98VSk/1+4a54w==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com;
  • Cc: Roger Pau Monné <roger.pau@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Wed, 04 Jun 2025 08:25:26 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>


On 04/06/2025 10:07, Jan Beulich wrote:
> On 04.06.2025 09:21, Michal Orzel wrote:
>> When cross-compiling, HOSTCC can be different than CC.
> 
> I'm sorry for being pedantic, but the two can also be different for other
> reasons (and I'd like to avoid this becoming a bad precedent, then getting
> copied elsewhere). Both may target the same architecture. Hence I'd like
> to suggest ...
> 
>> With the recent
>> `install` rule addition, this would put a binary of a wrong format in
>> the destdir (e.g. building tests on x86 host for Arm target).
>>
>> Take the opportunity to adjust the `run` rule to only run the test if
>> HOSTCC is CC, else print a warning message.
>>
>> Fixes: 96a587a05736 ("tools/tests: Add install target for vPCI")
>> Signed-off-by: Michal Orzel <michal.orzel@xxxxxxx>
>> ---
>> Changes in v2:
>>  - change Fixes tag
>>  - add `run` rule adjustment from Roger
>> ---
>>  tools/tests/vpci/Makefile | 6 +++++-
>>  1 file changed, 5 insertions(+), 1 deletion(-)
>>
>> diff --git a/tools/tests/vpci/Makefile b/tools/tests/vpci/Makefile
>> index 9450f7593a41..f2226a5543bc 100644
>> --- a/tools/tests/vpci/Makefile
>> +++ b/tools/tests/vpci/Makefile
>> @@ -8,10 +8,14 @@ all: $(TARGET)
>>  
>>  .PHONY: run
>>  run: $(TARGET)
>> +ifeq ($(CC),$(HOSTCC))
>>      ./$(TARGET)
>> +else
>> +    $(warning HOSTCC != CC, cannot run test)
> 
> ... s/cannot/will not/ here. Alternatively, -dumpmachine output of both
If this is just s/cannot/will not/ I hope this can be done on commit.

~Michal

> could be compared, yet even that would leave us with false negatives
> (e.g. x86_64-suse-linux vs x86_64-pc-linux-gnu as I can see for my
> system compiler vs the ones I built myself).
> 
> Jan
> 
>> +endif
>>  
>>  $(TARGET): vpci.c vpci.h list.h main.c emul.h
>> -    $(HOSTCC) $(CFLAGS_xeninclude) -g -o $@ vpci.c main.c
>> +    $(CC) $(CFLAGS_xeninclude) -g -o $@ vpci.c main.c
>>  
>>  .PHONY: clean
>>  clean:
> 




 


Rackspace

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