This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
fix PathTools dynamic linking for Perl 5.6
On Perl 5.6, PathTools's use of SvPV_nomg() is satisfied by a definition
in ppport.h. That definition calls out to the function sv_2pv_flags(),
which is also not defined by the 5.6. ppport.h can define the function,
but doesn't unless requested to. Cwd.xs wasn't requesting it, resulting
in Cwd.so having a reference to a non-existent function of a decorated
version of that name. Fix this by making Cwd.xs request that function.
Some of the existing test cases already exercise the call out to
sv_2pv_flags(), but in non-obvious ways. Add a more direct test,
requesting canonisation of a number. However, the use of PERL_DL_NONLAZY
for running the test suite hides the problem. The XS loading for
PathTools is optional, so with PERL_DL_NONLAZY making the loading fail
due to the unresolvable symbol, PathTools just falls back to its pure
Perl backup implementation, and passes all the tests. The problem only
really manifests when PERL_DL_NONLAZY is unset, i.e., in real use: the
XS loading succeeds, so PathTools will rely on the XS, but then the code
fails when called. This issue remains, lurking to bite if PathTools
develops another dynamic linking problem in the future.