When built for a flatpak in /app, we still need perl to use module
packages built in /usr, both to help with bootstrapping, and also for
using build-time only dependencies which should not need to be rebuilt.
Similarly, /usr/bin/perl is provided so that the /app perl remains
compatible with shebangs created for the /usr perl.
The build of perl included in runtimes (KDE platform and all the SDKs),
while built into /usr, also needs to find modules in /app, but (in the
use case of SDKs used with flatpak-builder) also build modules there.
The solution used here is to define vendorlib/vendorarch in /app, and
add the /usr vendor directories as otherlibdirs for those perl modules
which are also included in the runtimes/SDKs.
manNdir always need to be defined regardless of groff, as they are
relied upon later in the build.
If perl-locale was not installed, "perl -MPOSIX -e
'POSIX::strerror(0);'" never finished. POSIX::AUTOLOAD() compiles
"require locale;" defined in $reimpl{strerror}.
redhat-rpm-config added annobin flags to build_ldflags (bug #1983727):
$ rpm --eval '%{build_ldflags}'
-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1
perl needs to be rebuilt to pass them to XS modules:
$ perl -e 'use Config; print $Config{ldflags}, qq{\n}'
-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -fstack-protector-strong -L/usr/local/lib
Without that annocheck reports on i686:
Hardened: /usr/lib/perl5/vendor_perl/auto/JavaScript/Minifier/XS/XS.so: FAIL: stack-realign test because stack realign
See <https://bugzilla.redhat.com/show_bug.cgi?id=2013694#c10> and the
next comment.
Perl build script generates *.ph files from system header files.
The latest glibc apparently added a new header file features-time64.h
and features-time64.ph has to be added to package perl-ph.
If DynaLoader.pm is not installed:
$ perl -e 'require XSLoader; XSLoader::load(q{Cwd}, 0)'
Can't locate DynaLoader.pm in @INC (you may need to install the DynaLoader module) (@INC contains: /usr/local/lib64/perl5/5.32 /usr/local/share/perl5/5.32 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5) at /usr/share/perl5/XSLoader.pm line 115.
XSLoader::load() does "goto \&XSLoader::bootstrap_inherit" which does
"require DynaLoader". A private redefinition of DynaLoader package in
XSLoader is scoped to sub load {}. It's maybe an upstream bug.