[PATCH net-next v2 2/2] selftests: drv-net: Use cross-compilation environment for the io_uring check
From: Maxime Chevallier (Netdev Foundation)
Date: Thu Sep 03 2026 - 13:21:58 EST
To test for the presence of zerocopy support in the available liburing,
a small check program is compiled.
The CC value used for the io_uring library check defaults to the host
compiler, which will fail in cross-compiling environments.
Normally the CC for cross-compile is set in lib.mk, but this also
requires the test list to be set when we include it, and this check
needs to run first.
Note that this doesn't cover the LLVM cross-compiling case though.
Suggested-by: Matthieu Baerts (NGI0) <matttbe@xxxxxxxxxx>
Signed-off-by: Maxime Chevallier (Netdev Foundation) <maxime.chevallier@xxxxxxxxxxx>
---
V2: Use an LLVM-aware construct for CC construction, from Mattieu
tools/testing/selftests/drivers/net/hw/Makefile | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/tools/testing/selftests/drivers/net/hw/Makefile b/tools/testing/selftests/drivers/net/hw/Makefile
index 6105be8e590f..f9458dc6c150 100644
--- a/tools/testing/selftests/drivers/net/hw/Makefile
+++ b/tools/testing/selftests/drivers/net/hw/Makefile
@@ -1,5 +1,10 @@
# SPDX-License-Identifier: GPL-2.0+ OR MIT
+# Set CC for the io_uring check
+ifeq ($(LLVM)$(CC),cc)
+CC := $(CROSS_COMPILE)gcc
+endif
+
# Check if io_uring supports zero-copy receive
HAS_IOURING_ZCRX := $(shell \
echo -e '#include <liburing.h>\n' \
--
2.55.0