package/perl: properly pass CFLAGS/LDFLAGS when building host-perl

HOST_CFLAGS and HOST_LDFLAGS are currently not accounted for when
building host-perl. In particular, it means that executables
built/installed by host-perl do not have a RPATH pointing to
HOST_DIR/lib, which can cause issues as libcrypt.so can now be
provided by host-libxcrypt.

This was causing check-host-rpath to complain in the situation where:

1. host-perl was built, with no RPATH, linked against the system
   libcrypt.so

2. host-libxcrypt was built afterwards, installed as
   HOST_DIR/lib/libcrypt.so, which made check-host-rpath complain as
   HOST_DIR/bin/perl is linked against a library present in
   HOST_DIR/lib but doesn't have a RPATH to HOST_DIR/lib

Fixes:

  http://autobuild.buildroot.net/results/d4348d7f872ccd734795a1d071960a696148ed6a/

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Acked-by: Francois Perrad <francois.perrad@gadz.org>
Signed-off-by: Julien Olivain <ju.o@free.fr>
(cherry picked from commit 65127a8a772132c3d0905241563d1978a2b332ba)
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
This commit is contained in:
Thomas Petazzoni 2025-01-01 21:21:11 +01:00 committed by Peter Korsgaard
parent bb0db27065
commit 445badfa8b

View File

@ -98,7 +98,9 @@ endef
HOST_PERL_CONF_OPTS = \
-des \
-Dprefix="$(HOST_DIR)" \
-Dcc="$(HOSTCC)"
-Dcc="$(HOSTCC)" \
-Dccflags="$(HOST_CFLAGS)" \
-Dldflags="$(HOST_LDFLAGS)"
define HOST_PERL_CONFIGURE_CMDS
(cd $(@D); $(HOST_MAKE_ENV) HOSTCC='$(HOSTCC_NOCCACHE)' \