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

[xen staging] tests/vpci: Use $(CC) instead of $(HOSTCC)



commit 86a12671c5d33063b6f958bdcca7c9d14cd5aac8
Author:     Michal Orzel <michal.orzel@xxxxxxx>
AuthorDate: Wed Jun 4 09:21:28 2025 +0200
Commit:     Roger Pau Monne <roger.pau@xxxxxxxxxx>
CommitDate: Mon Jun 9 12:12:43 2025 +0200

    tests/vpci: Use $(CC) instead of $(HOSTCC)
    
    Depending on the build environment, 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>
    Reviewed-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
---
 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 9450f7593a..97359ff67f 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, will not 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:
--
generated by git-patchbot for /home/xen/git/xen.git#staging



 


Rackspace

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