[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2] tests/vpci: Use $(CC) instead of $(HOSTCC)
- To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Michal Orzel <michal.orzel@xxxxxxx>
- Date: Wed, 4 Jun 2025 09:21:28 +0200
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
- 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=gxaFUMpZS8ns2MzsrcIMUMcaQb3KLMXDA3h61XvrduM=; b=RN2hjhJwNIHeGsbqbzAj03dUlB/5EnqsL7P8Vaqm8XA9Aln5DfRMM3ccJ/D9leAC+7xCZ3bSFaLNGdtM66jJ1/wnTGSc8eNzhs1YJsb3wcm5FbA5YGDISX9Trqu3F0VKLYjEwIuoDl9jW5tzdkVP/ubEKz3BhsI80042apfTUectEpxyb6sGSztHVMqvoqBpf7pp6XFxBEzJB0Y3gwpzczJE2SaQyt9Bpzk6ZUbiSXHMnFHYAGfY8YRaAubWwEwQEHnimebrACAcQWtuemPKHK26nDdtDYWGuhN3zB6QsitYGD3WBU0j9gOaVfa4QR/j8uyY6SmybY9d1b3rE/8GSw==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Lc0xrM6hvltbN3g003K9d5BD0/dr1w2+JzmkWwfo+Y1bexmespxz3Mvt5vIFIyYseXxWRcgf3kmWDyb/V9FXCfU1RohgxxGsWQ89DeoCKrg+uA7Oi30oPPNA3mE3JkNFkM8aTBvKisO0yOdD4dbBuki2fEbRl3znRazxBegtTkbMYYvc3cO8mFRyOb4cIKDNIUp7EGcR7aRmpo3GsDDPhmwHaIE5jv+nHVtMYK2e8bgkMKpYqTTGBrsGJt9amw+EmZsOJ89rEoV1PfTnm+rQ94riA0RlZ03z4SQsPVG7F0l7Nnn/nY0nNLmzTffRmMnGgMrnEKGE2J79ngb5HjJ3yQ==
- Cc: Michal Orzel <michal.orzel@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>
- Delivery-date: Wed, 04 Jun 2025 07:21:50 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
When cross-compiling, HOSTCC can be different than CC. 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)
+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:
--
2.25.1
|