Skip to contentSkip to conversation

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

PATCH In review Thomas Petazzoni via buildroot 4 participants 4 messages Jan 1, 2025 – Jan 8, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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/

---
 package/perl/perl.mk | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
package/perl/perl.mk +3 -1
index 0f7038a048..dc7c0b8d42 100644
@@ -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)' \
Signature · 6 lines
2.47.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Acked-by on v1 1/1
#1 lore raw
Quoted 16 lines · Thomas Petazzoni

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

Quoted 7 lines

Fixes:

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

Quoted 20 lines
---
 package/perl/perl.mk | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
package/perl/perl.mk +3 -2
index 0f7038a048..dc7c0b8d42 100644
@@ -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)' \
--
Quoted 3 lines

2.47.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#2 lore raw
In reply to Thomas Petazzoni via buildroot
Quoted 16 lines · Thomas Petazzoni via buildroot

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

Quoted 6 lines

Fixes:

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

Applied to master, thanks.
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#3 lore raw
In reply to Thomas Petazzoni via buildroot
Quoted 16 lines · Thomas Petazzoni via buildroot

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

Quoted 5 lines

Fixes:

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

Committed to 2024.02.x and 2024.11.x, thanks.

Signature · 5 lines
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot