diff mbox series

[v2,3/7] selftests/nolibc: libc-test: use HOSTCC instead of CC

Message ID e82f5bc54c59f831df652403b2d5b13a93d1d2c5.1691783604.git.falcon@tinylab.org (mailing list archive)
State Accepted
Commit 418c846821506d01882a948ce90947f264afc606
Headers show
Series selftests/nolibc: customize CROSS_COMPILE for all supported architectures | expand

Commit Message

Zhangjin Wu Aug. 11, 2023, 8:30 p.m. UTC
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>
---
 tools/testing/selftests/nolibc/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Willy Tarreau Aug. 13, 2023, 9:19 a.m. UTC | #1
On Sat, Aug 12, 2023 at 04:30:25AM +0800, Zhangjin Wu wrote:
> 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.

Indeed. This one is actually a fix for this one, I'll pick it separately
as it's independent on this series:

    85a0b029a1ce ("selftests/nolibc: add run-libc-test target")

Thanks,
Willy
diff mbox series

Patch

diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selftests/nolibc/Makefile
index d1012f006405..91ccfc27780f 100644
--- a/tools/testing/selftests/nolibc/Makefile
+++ b/tools/testing/selftests/nolibc/Makefile
@@ -191,7 +191,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