develooper Front page | perl.perl5.porters | Postings from September 2016

[perl #126599] Unnecessary preload wrapper in Makefile

Thread Previous
James E Keenan via RT
September 12, 2016 02:24
[perl #126599] Unnecessary preload wrapper in Makefile
Message ID:
On Mon Nov 30 20:20:55 2015, wrote:
> Hi,
> I already sent this mail a while ago, but somehow it never got to this
> list, so I'm resending it.

You sent it to, which is not the correct address.  It appears that the message lurked in some dark corner of our system until the sysadmin spotted it today and moved it into the Perl 5 bug queue.

> The Makefile.SH in perl contains some code that will in certain
> situations create a wrapper script called preload used during
> compilation.
> I think this is
> a) not needed
> b) doesn't really work how it's intended
> c) can cause problems.
> The point of the wrapper seems to be to make sure that during the
> compilation perl uses the newly compiled libperl and not a libperl that
> might be already installed on the system.
> However the Makefile is already setting LD_LIBRARY_PATH, so that should
> not happen. The LD_LIBRARY_PATH method is less problematic, as I'll
> explain below.
> The check whether this preload script gets used looks like this:
> 	    if test -f $archlib/CORE/$libperl; then
> This check will only be true if the paths used in the newly compiled
> perl are the same as in the one already on the system. E.g. if there's
> a libperl on the system with prefix /usr and the newly compiled perl
> has prefix /usr/local the check will fail. It won't matter, because as
> explained above the whole thing isn't needed anyway.
> Finally why I actually found this and why I think it causes problems: I
> tried to compile Perl with Address Sanitizer. This can cause the
> compilation to fail if this preload script is created. The reason is
> that if you LD_PRELOAD a library that was build with address sanitizer
> and then call any executable not built with address sanitizer it will
> crash. This caused gcc to crash. This does not happen with the
> LD_LIBRARY_PATH, because then only the libraries needed will be
> preloaded.
> Conclusion: Please just remove this, I don't think it does any good and
> it can cause problems. See attached patch.

The patch you attached was drawn against perl-5.22 and so would be unlikely to apply.

I have created this branch:


... and manually modified Makefile.SH consistent with your request.  It is now smoke-testing.

However, I approach this patch with skepticism.  The code in question in Makefile.SH has been in place for over 13 years and pertains to linux, which is the tested operating system on which Perl 5 blead is most frequently tested.  Hence, if the problem about which you wrote is a significant problem, I would have expected it to have been reported a long time ago.

I'm bcc-ing some of the original contributors to this section of the codebase.

Thanks for the patch.

James E Keenan (

via perlbug:  queue: perl5 status: new

Thread Previous Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About