[Buildroot] [PATCH] package/libcap: do not attempt to run ldconfig
Arnout Vandecappelle
arnout at rnout.be
Wed Apr 16 21:20:25 UTC 2025
On 28/03/2025 20:26, Yann E. MORIN wrote:
> 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 libcpa'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 <yann.morin.1998 at free.fr>
> Cc: Bernd Kuhls <bernd at kuhls.net>
> Cc: Thomas Petazzoni <thomas.petazzoni at bootlin.com>
Applied to 2025.02.x, thanks.
Regards,
Arnout
> ---
> 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))
More information about the buildroot
mailing list