From af4f4b3baf4657d8a441e20651f85b2d3a39a6f9 Mon Sep 17 00:00:00 2001 From: David Disseldorp Date: Thu, 24 Sep 2026 00:19:29 +1000 Subject: [PATCH] lkl: drop libarchive cptofs dependency Unlike fs2tar, cptofs doesn't appear to use libarchive in any way. The dependency appears to have been added by accident via commit 2030bf6e0e867e ("lkl tools: improve the build system"). cptofs depends on argp.h, so add and use a new LKL_HOST_CONFIG_ARGP config to avoid Windows and Android build failures. We could consider using https://packages.msys2.org/packages/libargp-devel and / or https://android.googlesource.com/platform/external/argp-standalone in future. Signed-off-by: David Disseldorp --- tools/lkl/Build | 2 +- tools/lkl/Makefile.autoconf | 1 + tools/lkl/Targets | 4 +--- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/tools/lkl/Build b/tools/lkl/Build index 6048440d0e1b6c..262de7665f1a4f 100644 --- a/tools/lkl/Build +++ b/tools/lkl/Build @@ -1,6 +1,6 @@ CFLAGS_lklfuse.o += -D_FILE_OFFSET_BITS=64 -cptofs-$(LKL_HOST_CONFIG_ARCHIVE) += cptofs.o +cptofs-$(LKL_HOST_CONFIG_ARGP) += cptofs.o fs2tar-$(LKL_HOST_CONFIG_ARCHIVE) += fs2tar.o lklfuse-$(LKL_HOST_CONFIG_FUSE) += lklfuse.o diff --git a/tools/lkl/Makefile.autoconf b/tools/lkl/Makefile.autoconf index b8129d55a231a9..654dcb93f3d0bf 100644 --- a/tools/lkl/Makefile.autoconf +++ b/tools/lkl/Makefile.autoconf @@ -85,6 +85,7 @@ define posix_host $(if $(filter yes,$(vde)),$(call virtio_net_vde)) $(if $(strip $(call find_include,fuse3/fuse.h)),$(call set_autoconf_var,FUSE,y)) $(if $(strip $(call find_include,archive.h)),$(call set_autoconf_var,ARCHIVE,y)) + $(if $(strip $(call find_include,argp.h)),$(call set_autoconf_var,ARGP,y)) $(if $(strip $(call find_include,linux/if_tun.h)),$(call set_autoconf_var,VIRTIO_NET_MACVTAP,y)) $(if $(filter $(1),elf64-x86-64-freebsd),$(call set_autoconf_var,NEEDS_LARGP,y)) $(if $(filter $(1),elf32-i386),$(call set_autoconf_var,I386,y)) diff --git a/tools/lkl/Targets b/tools/lkl/Targets index bedc64d94ea362..fdc6bac4a4e276 100644 --- a/tools/lkl/Targets +++ b/tools/lkl/Targets @@ -22,9 +22,7 @@ progs-$(LKL_HOST_CONFIG_ARCHIVE) += fs2tar LDLIBS_fs2tar-y := -larchive LDLIBS_fs2tar-$(LKL_HOST_CONFIG_NEEDS_LARGP) += -largp - -progs-$(LKL_HOST_CONFIG_ARCHIVE) += cptofs -LDLIBS_cptofs-y := -larchive +progs-$(LKL_HOST_CONFIG_ARGP) += cptofs LDLIBS_cptofs-$(LKL_HOST_CONFIG_NEEDS_LARGP) += -largp # tools/build/Makefile.build does not support parallel builds when