We don't want to set LD_LIBRARY_PATH to a directory filled with target
libraries when running a host perl. When the host and target
architecture are the same, some libraries will be loaded from this
path, resulting in the build to break because of glibc/musl mismatch.
Reported-by: John Audia <therealgraysky@proton.me>
Fixes: e7b5a35e5c ("perl: drop 110-always_use_miniperl.patch")
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
The patch was introduced in commit 4c57844f0f ("lang/perl: Add hack to
make perl always use miniperl during build"), but it is not actually
necessary. By setting $perl to a non-empty value (using 'perl' as is
common on desktop distros), the logic works as intended and selects the
correct perl binary for host and target builds.
As miniperl just symlinks to host perl for target builds, the main
effect of this change is not unconditionally passing `-Ilib -I.`
anymore. This seems like a good thing; host libraries should be used
with host perl by default.
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
Reverts [1] to resolve the following build error on macOS:
/Volumes/wrt3200/openwrt/staging_dir/hostpkg/usr/bin/perl installperl --destdir=/Volumes/wrt3200/openwrt/build_dir/target-arm_cortex-a9+vfpv3-d16_musl_eabi/perl/perl-5.38.2/ipkg-install
WARNING: You've never run 'make test' or some tests failed! (Installing anyway.)
/usr/bin/perl5.38.2
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: input file: /Volumes/wrt3200/openwrt/build_dir/target-arm_cortex-a9+vfpv3-d16_musl_eabi/perl/perl-5.38.2/ipkg-install/usr/bin/perl5.38.2 is not a Mach-O file
[1] 88efce3814
Signed-off-by: Georgi Valkov <gvalkov@gmail.com>