From e172bb48d3460d994e5eaff9059b3055172d28bb Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN" Date: Fri, 28 Mar 2025 20:26:56 +0100 Subject: [PATCH] package/libcap: do not attempt to run ldconfig The libcap Makefile is hand-coded (i.e. not autotools), and hard-codes calls to /sbin/ldconfig, unless it is installed out-of-tree. For target packages, this is done, but for host package this is not done, as we do set PREFIX instead, which causes libcap's Makefile to call ldconfig and emits a spurious warning (twice): install -m 0755 libcap.so.2.73 /home/ymorin/dev/buildroot/O/master/per-package/host-libcap/host/lib/libcap.so.2.73 ln -sf libcap.so.2.73 /home/ymorin/dev/buildroot/O/master/per-package/host-libcap/host/lib/libcap.so.2 ln -sf libcap.so.2 /home/ymorin/dev/buildroot/O/master/per-package/host-libcap/host/lib/libcap.so /sbin/ldconfig /sbin/ldconfig: Can't create temporary cache file /etc/ld.so.cache~: Permission denied make[4]: [Makefile:200: install-shared-cap] Error 1 (ignored) This is just a warning, but it is incorrect still. Fake an out-of-tree install with a non-empy DESTDIR that is just '/', and thus does in fact not install out-of-tree. This is enough to actually silence the warning. Add a little comment to explain that. Signed-off-by: Yann E. MORIN Cc: Bernd Kuhls Cc: Thomas Petazzoni Signed-off-by: Julien Olivain --- package/libcap/libcap.mk | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/package/libcap/libcap.mk b/package/libcap/libcap.mk index 5a6ed5b494..25b3a46c44 100644 --- a/package/libcap/libcap.mk +++ b/package/libcap/libcap.mk @@ -64,8 +64,11 @@ define HOST_LIBCAP_BUILD_CMDS $(HOST_LIBCAP_MAKE_FLAGS) endef +# Set DESTDIR to a non-empty path, so that libcap's Makefile +# does not trigger calls to ldconfig define HOST_LIBCAP_INSTALL_CMDS - $(HOST_MAKE_ENV) $(MAKE) -C $(@D) $(HOST_LIBCAP_MAKE_FLAGS) install + $(HOST_MAKE_ENV) $(MAKE) -C $(@D) $(HOST_LIBCAP_MAKE_FLAGS) \ + DESTDIR=/ install endef $(eval $(generic-package))