Skip to content
This repository was archived by the owner on Jun 1, 2023. It is now read-only.

Commit 33f6f7f

Browse files
committed
B-C mingw: no duplicate -Lcoredir
mingw still looks with PERL_CORE into the absolute wrong libdir. let the absolute -L"c:/cperl/lib/CORE" not leak into CORE testing because it can hold a different version.
1 parent 7e47d9c commit 33f6f7f

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

cpan/B-C/script/perlcc.PL

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -696,7 +696,7 @@ sub cc_harness {
696696
!NO!SUBS!
697697
print OUT <<"!EXPANDED!";
698698
\$coredir = \"$srcdir\";
699-
\$coredir .= \"\\\\lib\\\\CORE\" if \$^O eq 'MSWin32';
699+
\$coredir .= \"/lib/CORE\" if \$^O eq 'MSWin32'; # forward slashes yes
700700
\$command = "\$Config{ccflags} -I\\\"\$coredir\\\" -L\\\"\$coredir\\\" -o \\\"\$Output\\\" \\\"\$cfile\\\" ";
701701
!EXPANDED!
702702
print OUT <<'!NO!SUBS!';
@@ -735,7 +735,11 @@ print OUT <<'!NO!SUBS!';
735735
my @mods = split /,?-?u/, $stash; # XXX -U stashes
736736
$ldopts = ExtUtils::Embed::ldopts("-std", \@mods);
737737
} else {
738-
$ldopts = ExtUtils::Embed::ldopts("-std");
738+
if ($ENV{PERL_CORE} and $^O eq 'MSWin32') {
739+
$ldopts = $Config{libs};
740+
} else {
741+
$ldopts = ExtUtils::Embed::ldopts("-std"); # critical on mingw
742+
}
739743
}
740744
$ldopts .= " ".opt('Wl') if opt('Wl');
741745
@@ -767,7 +771,7 @@ print OUT <<'!NO!SUBS!';
767771
# on mingw we still search for cperl52x.dll not the importlib
768772
# coredir + includedir is ../../lib/CORE on windows
769773
$libdir = "../..";
770-
$ldopts .= " -L$coredir" if $^O eq 'MSWin32';
774+
# $ldopts .= " -L$coredir" if $^O eq 'MSWin32';
771775
} else {
772776
$libdir = $Config{prefix} . "/lib";
773777
$coredir = $ENV{PERL_SRC} || $Config{archlib}."/CORE";

0 commit comments

Comments
 (0)