--- perl-5.18.1.orig/Makefile.SH	2013-08-12 04:44:47.000000000 +0200
+++ perl-5.18.1/Makefile.SH	2014-02-18 16:20:59.000000000 +0100
@@ -319,7 +319,7 @@ MINIPERL = \$(LDLIBPTH) \$(RUN) ./minipe
 
 # Macros to invoke a copy of our fully operational perl during the build.
 PERL_EXE = perl\$(EXE_EXT)
-RUN_PERL = \$(LDLIBPTH) \$(RUN) ./perl\$(EXE_EXT)
+RUN_PERL = \$(LDLIBPTH) \$(RUN) @@STAGING_HOST_DIR@@/perl-host\$(EXE_EXT)
 
 # Macros to run our tests
 RUN_TESTS = \$(LDLIBPTH) ./runtests
@@ -665,9 +665,10 @@ bitcount.h: generate_uudmap$(HOST_EXE_EX
 	$(RUN) ./generate_uudmap$(HOST_EXE_EXT) $(generated_headers)
 
 generate_uudmap$(OBJ_EXT): mg_raw.h
+	$(CC_FOR_BUILD) -o generate_uudmap$(OBJ_EXT) -c generate_uudmap.c
 
 generate_uudmap$(HOST_EXE_EXT): generate_uudmap$(OBJ_EXT)
-	$(CC) -o generate_uudmap$(EXE_EXT) $(LDFLAGS) generate_uudmap$(OBJ_EXT) $(libs)
+	$(CC_FOR_BUILD) -o generate_uudmap$(EXE_EXT) generate_uudmap$(OBJ_EXT)
 
 miniperlmain$(OBJ_EXT): miniperlmain.c patchlevel.h
 	$(CCCMD) $(PLDLFLAGS) $*.c
@@ -881,7 +882,6 @@ $(MINIPERL_EXE): $& $(mini_obj)
 	-@rm -f miniperl.xok
 	$(LDLIBPTH) $(CC) $(CLDFLAGS) -o $(MINIPERL_EXE) \
 	    $(mini_obj) $(libs)
-	$(LDLIBPTH) $(RUN) ./miniperl$(HOST_EXE_EXT) -w -Ilib -MExporter -e '<?>' || $(MAKE) minitest
 !NO!SUBS!
 		;;
 	esac
@@ -1058,7 +1058,7 @@ uni.data: $(MINIPERL_EXE) $(CONFIGPM) li
 # But also this ensures that all extensions are built before we try to scan
 # them, which picks up Devel::PPPort's documentation.
 pod/perltoc.pod: $(perltoc_pod_prereqs)  $(PERL_EXE) $(ext) pod/buildtoc
-	$(RUN_PERL) -f -Ilib pod/buildtoc -q
+	$(RUN_PERL) -f @@LIB@@ pod/buildtoc -q
 
 pod/perlapi.pod: pod/perlintern.pod
 
