No need to prefix $(LDLIBPTH) when running $(CC) to link perl and miniperl.
authorNicholas Clark <nick@ccl4.org>
Fri, 27 Apr 2012 15:56:34 +0000 (17:56 +0200)
committerNicholas Clark <nick@ccl4.org>
Tue, 30 Jul 2013 09:31:29 +0000 (11:31 +0200)
When perl is build with a shared perl library, $(LDLIBPTH) is used to prefix
the appropriate LD_LIBRARY_PATH=... before commands in the Makefile so that
the uninstalled ./perl will be able to find it.

Commit c4f23d77f4b3486a (in May 1998) added the code for LDLIBPTH, but also
added it to the default command line used to invoke $(CC) to link perl and
miniperl. These commands don't need to run ./perl, hence the use of
$(LDLIBPTH) is superfluous here. Removing it makes the code simpler.

$(LDLIBPTH) was first removed in commit d182087b9c1b8811 (April 2003), but
that change was reverted by commit f913803b6e67ae4c (in Aug 2003) as part of
an attempt to fix problems reported by a perl smoker on a platform where the
C compiler is actually a Perl wrapper script. However, from subsequent
discussion it seems that the reversion didn't actually fix the problem, and
both the documentation of LD_LIBRARY_PATH and attempting to replicate the
smoker's setup suggest that this particular change is independent of the
problem. I can't replicate the smoker's reported problems building a shared
library perl with (or without) this commit on a current Power Linux machine
using a Perl script to wrap the C compiler, where the #! line on that Perl
script is an install of perl 5.8.0 also using a shared perl library. Hence
I'm confident that this change is independent of the true cause of the
smoker's problems. See the discussion in RT #23212 for more details.

Makefile.SH

index 15b32fd..9d44c2c 100755 (executable)
@@ -900,7 +900,7 @@ lib/buildcustomize.pl: $& $(mini_obj) write_buildcustomize.pl
                $spitshell >>$Makefile <<'!NO!SUBS!'
 lib/buildcustomize.pl: $& $(mini_obj) write_buildcustomize.pl
        -@rm -f miniperl.xok
-       $(LDLIBPTH) $(CC) $(CLDFLAGS) -o $(MINIPERL_EXE) \
+       $(CC) $(CLDFLAGS) -o $(MINIPERL_EXE) \
            $(mini_obj) $(libs)
        $(LDLIBPTH) $(RUN) ./miniperl$(HOST_EXE_EXT) -w -Ilib -Idist/Exporter/lib -MExporter -e '<?>' || sh -c 'echo >&2 Failed to build miniperl.  Please run make minitest; exit 1'
        $(MINIPERL) -f write_buildcustomize.pl
@@ -912,7 +912,7 @@ lib/buildcustomize.pl: $& $(mini_obj) write_buildcustomize.pl
 
 $(PERL_EXE): $& perlmain$(OBJ_EXT) $(LIBPERL) $(static_ext) ext.libs $(PERLEXPORT) write_buildcustomize.pl
        -@rm -f miniperl.xok
-       $(SHRPENV) $(LDLIBPTH) $(CC) -o perl $(CLDFLAGS) $(CCDLFLAGS) perlmain$(OBJ_EXT) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs)
+       $(SHRPENV) $(CC) -o perl $(CLDFLAGS) $(CCDLFLAGS) perlmain$(OBJ_EXT) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs)
 
 # Microperl.  This is just a convenience thing if one happens to
 # build also the full Perl and therefore the real big Makefile: