selftests/nolibc: libc-test: use HOSTCC instead of CC
authorZhangjin Wu <falcon@tinylab.org>
Fri, 11 Aug 2023 20:30:25 +0000 (04:30 +0800)
committerWilly Tarreau <w@1wt.eu>
Wed, 23 Aug 2023 03:18:50 +0000 (05:18 +0200)
libc-test is mainly added to compare the behavior of nolibc to the
system libc, it is meaningless and error-prone with cross compiling.

Let's use HOSTCC instead of CC to avoid wrongly use cross compiler when
CROSS_COMPILE is passed or customized.

Signed-off-by: Zhangjin Wu <falcon@tinylab.org>
Fixes: cfb672f94f6e ("selftests/nolibc: add run-libc-test target")
Signed-off-by: Willy Tarreau <w@1wt.eu>
tools/testing/selftests/nolibc/Makefile

index 56abe04..dfe6677 100644 (file)
@@ -178,7 +178,7 @@ nolibc-test: nolibc-test.c
 endif
 
 libc-test: nolibc-test.c
-       $(QUIET_CC)$(CC) -o $@ $<
+       $(QUIET_CC)$(HOSTCC) -o $@ $<
 
 # local libc-test
 run-libc-test: libc-test