[PATCH master 2/3] sandbox: don't build tap support code without CONFIG_DRIVER_NET_TAP

Ahmad Fatoum a.fatoum at pengutronix.de
Tue Mar 25 05:47:39 PDT 2025


There's no point in compiling tap_alloc() if it's not going to be used.
As the file unconditionally uses <linux/*.h> headers, it breaks the
build, when those are not available.

Therefore only build the file if actually needed.

Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
 arch/sandbox/os/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/sandbox/os/Makefile b/arch/sandbox/os/Makefile
index 7a76fb0290e8..c40bc78d31dd 100644
--- a/arch/sandbox/os/Makefile
+++ b/arch/sandbox/os/Makefile
@@ -20,7 +20,8 @@ ifeq ($(CONFIG_SANDBOX_LINUX_I386),y)
 KBUILD_CFLAGS += -m32
 endif
 
-obj-y = common.o tap.o setjmp.o
+obj-y = common.o setjmp.o
+obj-$(CONFIG_DRIVER_NET_TAP) += tap.o
 obj-$(CONFIG_MALLOC_LIBC) += libc_malloc.o
 
 CFLAGS_sdl.o = $(shell $(PKG_CONFIG) sdl2 --cflags)
-- 
2.39.5




More information about the barebox mailing list