diff -Naur perl-5.32.0-orig/configpm perl-5.32.0/configpm
--- perl-5.32.0-orig/configpm	2020-06-15 02:01:24.000000000 +0300
+++ perl-5.32.0/configpm	2020-07-15 08:48:13.273201700 +0300
@@ -459,8 +459,8 @@
 
 my $osname = fetch_string({}, 'osname');
 my $from = $osname eq 'VMS' ? 'PERLSHR image' : 'binary (from libperl)';
-my $env_cygwin = $osname eq 'cygwin'
-    ? 'push @env, "CYGWIN=\"$ENV{CYGWIN}\"" if $ENV{CYGWIN};' . "\n" : "";
+my $env_cygwin = ($^O eq 'cygwin' || $^O eq 'msys')
+    ? 'push @env, "MSYS=\"$ENV{MSYS}\"" if $ENV{MSYS};' . "\n" : "";
 
 $heavy_txt .= sprintf <<'ENDOFBEG', $osname, $osname, $from, $osname, $env_cygwin;
 # This file was created by configpm when Perl was built. Any changes
diff -Naur perl-5.32.0-orig/Configure perl-5.32.0/Configure
--- perl-5.32.0-orig/Configure	2020-07-15 08:44:24.668906400 +0300
+++ perl-5.32.0/Configure	2020-07-15 08:48:13.288863200 +0300
@@ -1428,7 +1428,7 @@
 : MiNT
     _exe=""
 elif test -d c:/. -o -n "$is_os2" ; then
-: OS/2 or cygwin
+: OS/2 or cygwin or msys
     _exe=".exe"
 fi
 
@@ -3467,6 +3467,9 @@
 		cygwin*) osname=cygwin
 			osvers="$3"
 			;;
+		msys*) osname=msys
+			osvers="$3"
+			;;
 		*dc.osx) osname=dcosx
 			osvers="$3"
 			;;
@@ -8692,7 +8695,7 @@
 	;;
 *)	case "$useshrplib" in
 	'')	case "$osname" in
-		svr4*|nonstopux|dgux|dynixptx|esix|powerux|haiku|cygwin*)
+		svr4*|nonstopux|dgux|dynixptx|esix|powerux|haiku|cygwin*|msys*)
 			dflt=y
 			also='Building a shared libperl is required for dynamic loading to work on your system.'
 			;;
@@ -8763,6 +8766,13 @@
 			majonly=cygperl5.$majonly.$so
 			dflt=$majmin
 			;;
+		msys*) # ld links now against the dll directly
+			majmin="msys-perl5_${patchlevel}_${subversion}.${so}"
+			majonly=`echo $patchlevel $subversion |
+				$awk '{printf "%03d%03d", $1, $2}'`
+			majonly=msys-perl5.$majonly.$so
+			dflt=$majmin
+			;;
 		*)	# Try to guess based on whether libc has major.minor.
 			case "$libc" in
 			*libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
@@ -8854,6 +8864,9 @@
 	cygwin)
 		# cygwin needs only ldlibpth
 		;;
+	msys)
+		# cygwin needs only ldlibpth
+		;;
 	*)
 		tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
 		;;
@@ -23043,7 +23056,7 @@
 BSDCOMPAT bsdi BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES bull
 byteorder byte_order
 c cadmus clang clipper CMU COFF COMPILER_VERSION concurrent
-convex cpu CRAY cray CRAYMPP ctix CX_UX CYGWIN
+convex cpu CRAY cray CRAYMPP ctix CX_UX MSYS CYGWIN
 DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO Dynix DynixPTX
 ELF encore EPI EXTENSIONS
 FAVOR_BSD FILE_OFFSET_BITS FORTIFY_SOURCE FreeBSD
@@ -23677,6 +23690,7 @@
 	Win32*)
 		case "$osname" in
 		cygwin) avail_ext="$avail_ext $xxx" ;;
+		msys) avail_ext="$avail_ext $xxx" ;;
 		esac
 		;;
 	XS/APItest|xs/apitest)
diff -Naur perl-5.32.0-orig/cpan/Archive-Tar/t/02_methods.t perl-5.32.0/cpan/Archive-Tar/t/02_methods.t
--- perl-5.32.0-orig/cpan/Archive-Tar/t/02_methods.t	2020-06-15 02:01:24.000000000 +0300
+++ perl-5.32.0/cpan/Archive-Tar/t/02_methods.t	2020-07-15 08:48:13.288863200 +0300
@@ -60,7 +60,7 @@
 my $LONG_FILE = qq[directory/really-really-really-really-really-really-really-really-really-really-really-really-really-really-really-really-really-really-really-really-really-really-really-really-really-really-really-really-long-directory-name/myfile];
 
 ### wintendo can't deal with too long paths, so we might have to skip tests ###
-my $TOO_LONG    =   ($^O eq 'MSWin32' or $^O eq 'cygwin' or $^O eq 'VMS')
+my $TOO_LONG    =   ($^O eq 'MSWin32' or $^O eq 'cygwin' or $^O eq 'msys' or $^O eq 'VMS')
                     && length( cwd(). $LONG_FILE ) > 247;
 
 if(!$TOO_LONG) {
diff -Naur perl-5.32.0-orig/cpan/Compress-Raw-Zlib/Makefile.PL perl-5.32.0/cpan/Compress-Raw-Zlib/Makefile.PL
--- perl-5.32.0-orig/cpan/Compress-Raw-Zlib/Makefile.PL	2020-06-15 02:01:24.000000000 +0300
+++ perl-5.32.0/cpan/Compress-Raw-Zlib/Makefile.PL	2020-07-15 08:48:13.288863200 +0300
@@ -32,7 +32,7 @@
 # ExtUtils::Install.
 
 # Don't ask if MM_USE_DEFAULT is set -- enables perl core building on cygwin
-if ($^O =~ /cygwin/i and $ExtUtils::Install::VERSION < 1.39 
+if (($^O =~ /cygwin/i or $^O =~ /msys/i) and $ExtUtils::Install::VERSION < 1.39
         and not ($ENV{PERL_MM_USE_DEFAULT} or $ENV{PERL_CORE}))
 {
     print <<EOM ;
diff -Naur perl-5.32.0-orig/cpan/CPAN-Meta/t/data-fail/META-1_4.yml perl-5.32.0/cpan/CPAN-Meta/t/data-fail/META-1_4.yml
--- perl-5.32.0-orig/cpan/CPAN-Meta/t/data-fail/META-1_4.yml	2020-06-15 02:01:24.000000000 +0300
+++ perl-5.32.0/cpan/CPAN-Meta/t/data-fail/META-1_4.yml	2020-07-15 08:48:13.304465000 +0300
@@ -77,6 +77,9 @@
   Module::Build::Platform::cygwin:
     file: lib/Module/Build/Platform/cygwin.pm
     version: 0.36_08
+  Module::Build::Platform::msys:
+    file: lib/Module/Build/Platform/msys.pm
+    version: 0.36_08
   Module::Build::Platform::darwin:
     file: lib/Module/Build/Platform/darwin.pm
     version: 0.36_08
diff -Naur perl-5.32.0-orig/cpan/CPAN-Meta/t/data-fixable/invalid-meta-spec-version.yml perl-5.32.0/cpan/CPAN-Meta/t/data-fixable/invalid-meta-spec-version.yml
--- perl-5.32.0-orig/cpan/CPAN-Meta/t/data-fixable/invalid-meta-spec-version.yml	2020-06-15 02:01:24.000000000 +0300
+++ perl-5.32.0/cpan/CPAN-Meta/t/data-fixable/invalid-meta-spec-version.yml	2020-07-15 08:48:13.304465000 +0300
@@ -77,6 +77,9 @@
   Module::Build::Platform::cygwin:
     file: lib/Module/Build/Platform/cygwin.pm
     version: 0.36_08
+  Module::Build::Platform::msys:
+    file: lib/Module/Build/Platform/msys.pm
+    version: 0.36_08
   Module::Build::Platform::darwin:
     file: lib/Module/Build/Platform/darwin.pm
     version: 0.36_08
diff -Naur perl-5.32.0-orig/cpan/CPAN-Meta/t/data-fixable/META-1_4.yml perl-5.32.0/cpan/CPAN-Meta/t/data-fixable/META-1_4.yml
--- perl-5.32.0-orig/cpan/CPAN-Meta/t/data-fixable/META-1_4.yml	2020-06-15 02:01:24.000000000 +0300
+++ perl-5.32.0/cpan/CPAN-Meta/t/data-fixable/META-1_4.yml	2020-07-15 08:48:13.304465000 +0300
@@ -76,6 +76,9 @@
   Module::Build::Platform::cygwin:
     file: lib/Module/Build/Platform/cygwin.pm
     version: 0.36_08
+  Module::Build::Platform::msys:
+    file: lib/Module/Build/Platform/msys.pm
+    version: 0.36_08
   Module::Build::Platform::darwin:
     file: lib/Module/Build/Platform/darwin.pm
     version: 0.36_08
diff -Naur perl-5.32.0-orig/cpan/CPAN-Meta/t/data-fixable/meta-spec-version-trailing-zeros.yml perl-5.32.0/cpan/CPAN-Meta/t/data-fixable/meta-spec-version-trailing-zeros.yml
--- perl-5.32.0-orig/cpan/CPAN-Meta/t/data-fixable/meta-spec-version-trailing-zeros.yml	2020-06-15 02:01:24.000000000 +0300
+++ perl-5.32.0/cpan/CPAN-Meta/t/data-fixable/meta-spec-version-trailing-zeros.yml	2020-07-15 08:48:13.304465000 +0300
@@ -77,6 +77,9 @@
   Module::Build::Platform::cygwin:
     file: lib/Module/Build/Platform/cygwin.pm
     version: 0.36_08
+  Module::Build::Platform::msys:
+    file: lib/Module/Build/Platform/msys.pm
+    version: 0.36_08
   Module::Build::Platform::darwin:
     file: lib/Module/Build/Platform/darwin.pm
     version: 0.36_08
diff -Naur perl-5.32.0-orig/cpan/CPAN-Meta/t/data-test/META-1_4.yml perl-5.32.0/cpan/CPAN-Meta/t/data-test/META-1_4.yml
--- perl-5.32.0-orig/cpan/CPAN-Meta/t/data-test/META-1_4.yml	2020-06-15 02:01:24.000000000 +0300
+++ perl-5.32.0/cpan/CPAN-Meta/t/data-test/META-1_4.yml	2020-07-15 08:48:13.304465000 +0300
@@ -77,6 +77,9 @@
   Module::Build::Platform::cygwin:
     file: lib/Module/Build/Platform/cygwin.pm
     version: 0.36_08
+  Module::Build::Platform::msys:
+    file: lib/Module/Build/Platform/msys.pm
+    version: 0.36_08
   Module::Build::Platform::darwin:
     file: lib/Module/Build/Platform/darwin.pm
     version: 0.36_08
diff -Naur perl-5.32.0-orig/cpan/CPAN-Meta/t/data-test/restrictive-1_4.yml perl-5.32.0/cpan/CPAN-Meta/t/data-test/restrictive-1_4.yml
--- perl-5.32.0-orig/cpan/CPAN-Meta/t/data-test/restrictive-1_4.yml	2020-06-15 02:01:24.000000000 +0300
+++ perl-5.32.0/cpan/CPAN-Meta/t/data-test/restrictive-1_4.yml	2020-07-15 08:48:13.320081600 +0300
@@ -77,6 +77,9 @@
   Module::Build::Platform::cygwin:
     file: lib/Module/Build/Platform/cygwin.pm
     version: 0.36_08
+  Module::Build::Platform::msys:
+    file: lib/Module/Build/Platform/msys.pm
+    version: 0.36_08
   Module::Build::Platform::darwin:
     file: lib/Module/Build/Platform/darwin.pm
     version: 0.36_08
diff -Naur perl-5.32.0-orig/cpan/CPAN-Meta/t/data-test/unicode.yml perl-5.32.0/cpan/CPAN-Meta/t/data-test/unicode.yml
--- perl-5.32.0-orig/cpan/CPAN-Meta/t/data-test/unicode.yml	2020-06-15 02:01:24.000000000 +0300
+++ perl-5.32.0/cpan/CPAN-Meta/t/data-test/unicode.yml	2020-07-15 08:48:13.320081600 +0300
@@ -77,6 +77,9 @@
   Module::Build::Platform::cygwin:
     file: lib/Module/Build/Platform/cygwin.pm
     version: 0.36_08
+  Module::Build::Platform::msys:
+    file: lib/Module/Build/Platform/msys.pm
+    version: 0.36_08
   Module::Build::Platform::darwin:
     file: lib/Module/Build/Platform/darwin.pm
     version: 0.36_08
diff -Naur perl-5.32.0-orig/cpan/DB_File/t/db-btree.t perl-5.32.0/cpan/DB_File/t/db-btree.t
--- perl-5.32.0-orig/cpan/DB_File/t/db-btree.t	2020-06-15 02:01:24.000000000 +0300
+++ perl-5.32.0/cpan/DB_File/t/db-btree.t	2020-07-15 08:48:13.326584000 +0300
@@ -106,7 +106,7 @@
 {
     my $data = shift ;
     $data =~ s#\r\n#\n#g 
-        if $^O eq 'cygwin' ;
+        if ($^O eq 'cygwin' or $^O eq 'msys') ;
 
     return $data ;
 }
@@ -179,7 +179,7 @@
 my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,
    $blksize,$blocks) = stat($Dfile);
 
-my %noMode = map { $_, 1} qw( amigaos MSWin32 NetWare cygwin ) ;
+my %noMode = map { $_, 1} qw( amigaos MSWin32 NetWare cygwin msys ) ;
 
 ok(18, ($mode & 0777) == (($^O eq 'os2' || $^O eq 'MacOS') ? 0666 : 0640)
    || $noMode{$^O} );
diff -Naur perl-5.32.0-orig/cpan/DB_File/t/db-hash.t perl-5.32.0/cpan/DB_File/t/db-hash.t
--- perl-5.32.0-orig/cpan/DB_File/t/db-hash.t	2020-06-15 02:01:24.000000000 +0300
+++ perl-5.32.0/cpan/DB_File/t/db-hash.t	2020-07-15 08:48:13.326584000 +0300
@@ -70,7 +70,7 @@
 {
     my $data = shift ;
     $data =~ s#\r\n#\n#g 
-        if $^O eq 'cygwin' ;
+        if ($^O eq 'cygwin' or $^O eq 'msys') ;
     return $data ;
 }
 
@@ -140,7 +140,7 @@
 my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,
    $blksize,$blocks) = stat($Dfile);
 
-my %noMode = map { $_, 1} qw( amigaos MSWin32 NetWare cygwin ) ;
+my %noMode = map { $_, 1} qw( amigaos MSWin32 NetWare cygwin msys ) ;
 
 ok(16, ($mode & 0777) == (($^O eq 'os2' || $^O eq 'MacOS') ? 0666 : 0640) ||
    $noMode{$^O} );
diff -Naur perl-5.32.0-orig/cpan/DB_File/t/db-recno.t perl-5.32.0/cpan/DB_File/t/db-recno.t
--- perl-5.32.0-orig/cpan/DB_File/t/db-recno.t	2020-06-15 02:01:24.000000000 +0300
+++ perl-5.32.0/cpan/DB_File/t/db-recno.t	2020-07-15 08:48:13.326584000 +0300
@@ -127,7 +127,7 @@
 
 sub normalise
 {
-    return unless $^O eq 'cygwin' ;
+    return unless ($^O eq 'cygwin' || $^O eq 'msys') ;
     foreach (@_)
       { s#\r\n#\n#g }     
 }
@@ -202,7 +202,7 @@
 my @h ;
 ok(17, $X = tie @h, 'DB_File', $Dfile, O_RDWR|O_CREAT, 0640, $DB_RECNO ) ;
 
-my %noMode = map { $_, 1} qw( amigaos MSWin32 NetWare cygwin ) ;
+my %noMode = map { $_, 1} qw( amigaos MSWin32 NetWare cygwin msys ) ;
 
 ok(18, ((stat($Dfile))[2] & 0777) == (($^O eq 'os2' || $^O eq 'MacOS') ? 0666 : 0640)
         ||  $noMode{$^O} );
diff -Naur perl-5.32.0-orig/cpan/Digest-SHA/shasum perl-5.32.0/cpan/Digest-SHA/shasum
--- perl-5.32.0-orig/cpan/Digest-SHA/shasum	2020-06-15 02:01:24.000000000 +0300
+++ perl-5.32.0/cpan/Digest-SHA/shasum	2020-07-15 08:48:13.326584000 +0300
@@ -201,7 +201,7 @@
 	## explicitly overridden by command line "--text" or
 	## "--UNIVERSAL" options.
 
-my $isDOSish = ($^O =~ /^(MSWin\d\d|os2|dos|mint|cygwin)$/);
+my $isDOSish = ($^O =~ /^(MSWin\d\d|os2|dos|mint|cygwin|msys)$/);
 if ($isDOSish) { $binary = 1 unless $text || $UNIVERSAL }
 
 my $modesym = $binary ? '*' : ($UNIVERSAL ? 'U' : ($BITS ? '^' : ' '));
diff -Naur perl-5.32.0-orig/cpan/ExtUtils-Install/lib/ExtUtils/Install.pm perl-5.32.0/cpan/ExtUtils-Install/lib/ExtUtils/Install.pm
--- perl-5.32.0-orig/cpan/ExtUtils-Install/lib/ExtUtils/Install.pm	2020-06-15 02:01:24.000000000 +0300
+++ perl-5.32.0/cpan/ExtUtils-Install/lib/ExtUtils/Install.pm	2020-07-15 08:48:13.342749500 +0300
@@ -92,8 +92,8 @@
 BEGIN {
     *Is_VMS        = $^O eq 'VMS'     ? sub(){1} : sub(){0};
     *Is_Win32      = $^O eq 'MSWin32' ? sub(){1} : sub(){0};
-    *Is_cygwin     = $^O eq 'cygwin'  ? sub(){1} : sub(){0};
-    *CanMoveAtBoot = ($^O eq 'MSWin32' || $^O eq 'cygwin') ? sub(){1} : sub(){0};
+    *Is_cygwin     = ($^O eq 'cygwin' || $^O eq 'msys')  ? sub(){1} : sub(){0};
+    *CanMoveAtBoot = ($^O eq 'MSWin32' || $^O eq 'cygwin' || $^O eq 'msys') ? sub(){1} : sub(){0};
 }
 
 my $Inc_uninstall_warn_handler;
diff -Naur perl-5.32.0-orig/cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist/Kid.pm perl-5.32.0/cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist/Kid.pm
--- perl-5.32.0-orig/cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist/Kid.pm	2020-06-15 02:01:24.000000000 +0300
+++ perl-5.32.0/cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist/Kid.pm	2020-07-15 08:48:13.342749500 +0300
@@ -180,6 +180,8 @@
             }
             elsif ( $^O eq 'cygwin' && -f ( $fullname = "$thispth/$thislib.dll" ) ) {
             }
+            elsif ( $^O eq 'msys' && -f ( $fullname = "$thispth/$thislib.dll" ) ) {
+            }
             elsif ( -f ( $fullname = "$thispth/Slib$thislib$Config_libext" ) ) {
             }
             elsif ($^O eq 'dgux'
diff -Naur perl-5.32.0-orig/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM.pm perl-5.32.0/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM.pm
--- perl-5.32.0-orig/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM.pm	2020-06-15 02:01:24.000000000 +0300
+++ perl-5.32.0/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM.pm	2020-07-15 08:48:13.342749500 +0300
@@ -58,7 +58,7 @@
     _is_win95() ? $Is{Win95} = 1 : $Is{Win32} = 1;
 }
 $Is{UWIN}   = $^O =~ /^uwin(-nt)?$/;
-$Is{Cygwin} = $^O eq 'cygwin';
+$Is{Cygwin} = ($^O eq 'cygwin' or $^O eq 'msys');
 $Is{NW5}    = $Config{osname} eq 'NetWare';  # intentional
 $Is{BeOS}   = ($^O =~ /beos/i or $^O eq 'haiku');
 $Is{DOS}    = $^O eq 'dos';
diff -Naur perl-5.32.0-orig/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Cygwin.pm perl-5.32.0/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Cygwin.pm
--- perl-5.32.0-orig/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Cygwin.pm	2020-06-15 02:01:24.000000000 +0300
+++ perl-5.32.0/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Cygwin.pm	2020-07-15 08:48:13.342749500 +0300
@@ -34,7 +34,7 @@
 =cut
 
 sub os_flavor {
-    return('Unix', 'Cygwin');
+    return('Unix', 'Msys');
 }
 
 =item cflags
@@ -134,7 +134,7 @@
     return $s unless %{$self->{XS}};
 
     # do an ephemeral rebase so the new DLL fits to the current rebase map
-    $s .= "\t/bin/find \$\(INST_ARCHLIB\)/auto -xdev -name \\*.$self->{DLEXT} | /bin/rebase -sOT -" if (( $Config{myarchname} eq 'i686-cygwin' ) and not ( exists $ENV{CYGPORT_PACKAGE_VERSION} ));
+    $s .= "\t/bin/find \$\(INST_ARCHLIB\)/auto -xdev -name \\*.$self->{DLEXT} | /bin/rebase -sOT -" if (( $Config{myarchname} eq 'i686-msys' ) and not ( exists $ENV{CYGPORT_PACKAGE_VERSION} ));
     $s;
 }
 
@@ -154,7 +154,7 @@
     my $INSTALLLIB = $self->{"INSTALL". ($INSTALLDIRS eq 'perl' ? 'ARCHLIB' : uc($INSTALLDIRS)."ARCH")};
     my $dop = "\$\(DESTDIR\)$INSTALLLIB/auto/";
     my $dll = "$dop/$self->{FULLEXT}/$self->{BASEEXT}.$self->{DLEXT}";
-    $s =~ s|^(pure_install :: pure_\$\(INSTALLDIRS\)_install\n\t)\$\(NOECHO\) \$\(NOOP\)\n|$1\$(CHMOD) \$(PERM_RWX) $dll\n\t/bin/find $dop -xdev -name \\*.$self->{DLEXT} \| /bin/rebase -sOT -\n|m if (( $Config{myarchname} eq 'i686-cygwin') and not ( exists $ENV{CYGPORT_PACKAGE_VERSION} ));
+    $s =~ s|^(pure_install :: pure_\$\(INSTALLDIRS\)_install\n\t)\$\(NOECHO\) \$\(NOOP\)\n|$1\$(CHMOD) \$(PERM_RWX) $dll\n\t/bin/find $dop -xdev -name \\*.$self->{DLEXT} \| /bin/rebase -sOT -\n|m if (( $Config{myarchname} eq 'i686-msys') and not ( exists $ENV{CYGPORT_PACKAGE_VERSION} ));
     $s;
 }
 
diff -Naur perl-5.32.0-orig/cpan/ExtUtils-MakeMaker/t/03-xsstatic.t perl-5.32.0/cpan/ExtUtils-MakeMaker/t/03-xsstatic.t
--- perl-5.32.0-orig/cpan/ExtUtils-MakeMaker/t/03-xsstatic.t	2020-06-15 02:01:24.000000000 +0300
+++ perl-5.32.0/cpan/ExtUtils-MakeMaker/t/03-xsstatic.t	2020-07-15 08:52:09.902958900 +0300
@@ -19,7 +19,7 @@
 plan skip_all => "ExtUtils::CBuilder not installed or couldn't find a compiler"
   unless have_compiler();
 plan skip_all => 'Shared perl library' if $Config{useshrplib} eq 'true';
-plan skip_all => $^O if $^O =~ m!^(MSWin32|cygwin|haiku|darwin)$!;
+plan skip_all => $^O if $^O =~ m!^(MSWin32|cygwin|msys|haiku|darwin)$!;
 plan skip_all => 'Skipped when not PERL_CORE nor in git repo' unless $ENV{PERL_CORE} or $release;
 my @tests = list_static();
 plan skip_all => "No tests" unless @tests;
diff -Naur perl-5.32.0-orig/cpan/ExtUtils-MakeMaker/t/eu_command.t perl-5.32.0/cpan/ExtUtils-MakeMaker/t/eu_command.t
--- perl-5.32.0-orig/cpan/ExtUtils-MakeMaker/t/eu_command.t	2020-06-15 02:01:24.000000000 +0300
+++ perl-5.32.0/cpan/ExtUtils-MakeMaker/t/eu_command.t	2020-07-15 08:48:13.358398200 +0300
@@ -95,7 +95,7 @@
     SKIP: {
         if ($^O eq 'amigaos' || $^O eq 'os2' || $^O eq 'MSWin32' ||
             $^O eq 'NetWare' || $^O eq 'dos' || $^O eq 'cygwin'  ||
-            $^O eq 'MacOS'
+            $^O eq 'msys'    || $^O eq 'MacOS'
            ) {
             skip( "different file permission semantics on $^O", 3);
         }
@@ -135,7 +135,7 @@
     SKIP: {
         if ($^O eq 'amigaos' || $^O eq 'os2' || $^O eq 'MSWin32' ||
             $^O eq 'NetWare' || $^O eq 'dos' || $^O eq 'cygwin'  ||
-            $^O eq 'MacOS'   || $^O eq 'haiku'
+            $^O eq 'msys'    || $^O eq 'MacOS'   || $^O eq 'haiku'
            ) {
             skip( "different file permission semantics on $^O", 5);
         }
diff -Naur perl-5.32.0-orig/cpan/ExtUtils-MakeMaker/t/Mkbootstrap.t perl-5.32.0/cpan/ExtUtils-MakeMaker/t/Mkbootstrap.t
--- perl-5.32.0-orig/cpan/ExtUtils-MakeMaker/t/Mkbootstrap.t	2020-06-15 02:01:24.000000000 +0300
+++ perl-5.32.0/cpan/ExtUtils-MakeMaker/t/Mkbootstrap.t	2020-07-15 08:48:13.358398200 +0300
@@ -75,7 +75,7 @@
 	chmod 0444, 'dasboot.bs';
 
 	SKIP: {
-	    skip("cannot write readonly files", 1) if -w 'dasboot.bs' || $^O eq 'cygwin';
+	    skip("cannot write readonly files", 1) if -w 'dasboot.bs' || $^O eq 'cygwin' ||  $^O eq 'msys';
 
 	    eval{ Mkbootstrap('dasboot', 1) };
 	    like( $@, qr/Unable to open dasboot\.bs/, 'should die given bad filename' );
diff -Naur perl-5.32.0-orig/cpan/ExtUtils-MakeMaker/t/MM_Cygwin.t perl-5.32.0/cpan/ExtUtils-MakeMaker/t/MM_Cygwin.t
--- perl-5.32.0-orig/cpan/ExtUtils-MakeMaker/t/MM_Cygwin.t	2020-06-15 02:01:24.000000000 +0300
+++ perl-5.32.0/cpan/ExtUtils-MakeMaker/t/MM_Cygwin.t	2020-07-15 08:48:13.358398200 +0300
@@ -9,7 +9,7 @@
 use Test::More;
 
 BEGIN {
-	if ($^O =~ /cygwin/i) {
+	if ($^O =~ /cygwin|msys/i) {
 		plan tests => 14;
 	} else {
 		plan skip_all => "This is not cygwin";
diff -Naur perl-5.32.0-orig/cpan/ExtUtils-MakeMaker/t/MM_Unix.t perl-5.32.0/cpan/ExtUtils-MakeMaker/t/MM_Unix.t
--- perl-5.32.0-orig/cpan/ExtUtils-MakeMaker/t/MM_Unix.t	2020-06-15 02:01:24.000000000 +0300
+++ perl-5.32.0/cpan/ExtUtils-MakeMaker/t/MM_Unix.t	2020-07-15 08:48:13.358398200 +0300
@@ -8,7 +8,7 @@
 BEGIN {
     use Test::More;
 
-    if( $^O =~ /^VMS|os2|MacOS|MSWin32|cygwin|beos|netware$/i ) {
+    if( $^O =~ /^VMS|os2|MacOS|MSWin32|cygwin|msys|beos|netware$/i ) {
         plan skip_all => 'Non-Unix platform';
     }
     else {
diff -Naur perl-5.32.0-orig/cpan/ExtUtils-Manifest/t/Manifest.t perl-5.32.0/cpan/ExtUtils-Manifest/t/Manifest.t
--- perl-5.32.0-orig/cpan/ExtUtils-Manifest/t/Manifest.t	2020-06-15 02:01:24.000000000 +0300
+++ perl-5.32.0/cpan/ExtUtils-Manifest/t/Manifest.t	2020-07-15 08:48:13.358398200 +0300
@@ -455,7 +455,7 @@
 
 SKIP: {
     chmod( 0400, 'MANIFEST' );
-    skip "Can't make MANIFEST read-only", 2 if -w 'MANIFEST' or $Config{osname} eq 'cygwin';
+    skip "Can't make MANIFEST read-only", 2 if -w 'MANIFEST' or $Config{osname} eq 'cygwin' or $Config{osname} eq 'msys';
 
     eval {
         maniadd({ 'foo' => 'bar' });
diff -Naur perl-5.32.0-orig/cpan/File-Path/t/Path.t perl-5.32.0/cpan/File-Path/t/Path.t
--- perl-5.32.0-orig/cpan/File-Path/t/Path.t	2020-06-15 02:01:24.000000000 +0300
+++ perl-5.32.0/cpan/File-Path/t/Path.t	2020-07-15 08:48:13.373985200 +0300
@@ -499,7 +499,7 @@
         $octal_input = sprintf "%04o", S_IMODE($input);
         SKIP: {
 	    skip "permissions are not fully supported by the filesystem", 1
-                if (($^O eq 'MSWin32' || $^O eq 'cygwin') && ((Win32::FsType())[1] & 8) == 0);
+                if (($^O eq 'MSWin32' || $^O eq 'cygwin' || $^O eq 'msys') && ((Win32::FsType())[1] & 8) == 0);
             is($octal_mode,$input, "create a new directory with chmod $input ($octal_input)");
 	    }
         rmtree( $dir );
diff -Naur perl-5.32.0-orig/cpan/File-Temp/lib/File/Temp.pm perl-5.32.0/cpan/File-Temp/lib/File/Temp.pm
--- perl-5.32.0-orig/cpan/File-Temp/lib/File/Temp.pm	2020-06-15 02:01:24.000000000 +0300
+++ perl-5.32.0/cpan/File-Temp/lib/File/Temp.pm	2020-07-15 08:48:13.373985200 +0300
@@ -823,7 +823,7 @@
   return 1 if $level == STANDARD;
 
   # Currently, the systems that can do HIGH or MEDIUM are identical
-  if ( $^O eq 'MSWin32' || $^O eq 'os2' || $^O eq 'cygwin' || $^O eq 'dos' || $^O eq 'MacOS' || $^O eq 'mpeix') {
+  if ( $^O eq 'MSWin32' || $^O eq 'os2' || $^O eq 'cygwin' || $^O eq 'msys' || $^O eq 'dos' || $^O eq 'MacOS' || $^O eq 'mpeix') {
     return 0;
   } else {
     return 1;
@@ -2142,7 +2142,7 @@
     # On NFS the link count may still be 1 but we can't know that
     # we are on NFS.  Since we can't be sure, we'll defer it
 
-    return 1 if $fh[3] == 0 || $^O eq 'cygwin';
+    return 1 if $fh[3] == 0 || $^O eq 'cygwin' || $^O eq 'msys';
   }
   # fall-through if we can't unlink now
   _deferred_unlink($fh, $path, 0);
diff -Naur perl-5.32.0-orig/cpan/IO-Compress/t/cz-14gzopen.t perl-5.32.0/cpan/IO-Compress/t/cz-14gzopen.t
--- perl-5.32.0-orig/cpan/IO-Compress/t/cz-14gzopen.t	2020-06-15 02:01:25.000000000 +0300
+++ perl-5.32.0/cpan/IO-Compress/t/cz-14gzopen.t	2020-07-15 08:48:13.373985200 +0300
@@ -490,7 +490,7 @@
     SKIP:
     {
         skip "Cannot create non-writable file", 3 
-            if $^O eq 'cygwin';
+            if ($^O eq 'cygwin' or $^O eq 'msys');
 
         my $lex = new LexFile my $name ;
         writeFile($name, "abc");
@@ -514,7 +514,7 @@
     {
         my $lex = new LexFile my $name ;
         skip "Cannot create non-readable file", 3 
-            if $^O eq 'cygwin';
+            if ($^O eq 'cygwin' or $^O eq 'msys');
 
         writeFile($name, "abc");
         chmod 0222, $name ;
diff -Naur perl-5.32.0-orig/cpan/IO-Socket-IP/t/11sockopts.t perl-5.32.0/cpan/IO-Socket-IP/t/11sockopts.t
--- perl-5.32.0-orig/cpan/IO-Socket-IP/t/11sockopts.t	2020-06-15 02:01:25.000000000 +0300
+++ perl-5.32.0/cpan/IO-Socket-IP/t/11sockopts.t	2020-07-15 08:48:13.373985200 +0300
@@ -11,7 +11,7 @@
 use Socket qw( SOL_SOCKET SO_REUSEADDR SO_REUSEPORT SO_BROADCAST );
 
 TODO: {
-   local $TODO = "SO_REUSEADDR doesn't appear to work on cygwin smokers" if $^O eq "cygwin";
+   local $TODO = "SO_REUSEADDR doesn't appear to work on cygwin smokers" if ($^O eq "cygwin" || $^O eq 'msys');
    # I honestly have no idea why this fails, and people don't seem to be able
    # to reproduce it on a development box. I'll mark it TODO for now until we
    # can gain any more insight into it.
diff -Naur perl-5.32.0-orig/cpan/IPC-Cmd/t/03_run-forked.t perl-5.32.0/cpan/IPC-Cmd/t/03_run-forked.t
--- perl-5.32.0-orig/cpan/IPC-Cmd/t/03_run-forked.t	2020-06-15 02:01:25.000000000 +0300
+++ perl-5.32.0/cpan/IPC-Cmd/t/03_run-forked.t	2020-07-15 08:48:13.389611200 +0300
@@ -44,7 +44,7 @@
 ok($r->{'timeout'}, "[$sleep 5] runs longer than 2 seconds");
 
 SKIP: {
-  skip "Exhibits problems on Cygwin", 4 if $^O eq 'cygwin';
+  skip "Exhibits problems on Cygwin", 4 if ($^O eq 'cygwin' || $^O eq 'msys');
   # https://rt.cpan.org/Ticket/Display.html?id=85912
   sub runSub {
        my $blah = "blahblah";
diff -Naur perl-5.32.0-orig/cpan/IPC-SysV/t/ipcsysv.t perl-5.32.0/cpan/IPC-SysV/t/ipcsysv.t
--- perl-5.32.0-orig/cpan/IPC-SysV/t/ipcsysv.t	2020-06-15 02:01:25.000000000 +0300
+++ perl-5.32.0/cpan/IPC-SysV/t/ipcsysv.t	2020-07-15 08:48:13.389611200 +0300
@@ -39,18 +39,18 @@
   {
     return if $did_diag++;
 
-    if ($^O eq 'cygwin') {
+    if ($^O eq 'cygwin' or $^O eq 'msys') {
       diag(<<EOM);
 
 It may be that the cygserver service isn't running.
 
 EOM
 
-      diag(<<EOM) unless exists $ENV{CYGWIN} && $ENV{CYGWIN} eq 'server';
+      diag(<<EOM) unless exists $ENV{MSYS} && $ENV{MSYS} eq 'server';
 You also may have to set the CYGWIN environment variable
 to 'server' before running the test suite:
 
-  export CYGWIN=server
+  export MSYS=server
 
 EOM
     }
diff -Naur perl-5.32.0-orig/cpan/libnet/lib/Net/Domain.pm perl-5.32.0/cpan/libnet/lib/Net/Domain.pm
--- perl-5.32.0-orig/cpan/libnet/lib/Net/Domain.pm	2020-06-15 02:01:25.000000000 +0300
+++ perl-5.32.0/cpan/libnet/lib/Net/Domain.pm	2020-07-15 08:48:13.389611200 +0300
@@ -171,7 +171,7 @@
     }
 
     chop($dom = `domainname 2>/dev/null`)
-      unless (defined $dom || $^O =~ /^(?:cygwin|MSWin32|android)/);
+      unless (defined $dom || $^O =~ /^(?:cygwin|msys|MSWin32|android)/);
 
     if (defined $dom) {
       my @h = ();
diff -Naur perl-5.32.0-orig/cpan/libnet/lib/Net/Netrc.pm perl-5.32.0/cpan/libnet/lib/Net/Netrc.pm
--- perl-5.32.0-orig/cpan/libnet/lib/Net/Netrc.pm	2020-06-15 02:01:25.000000000 +0300
+++ perl-5.32.0/cpan/libnet/lib/Net/Netrc.pm	2020-07-15 08:48:13.389611200 +0300
@@ -57,6 +57,7 @@
   unless ($^O eq 'os2'
     || $^O eq 'MSWin32'
     || $^O eq 'MacOS'
+    || $^O =~ /^msys/
     || $^O =~ /^cygwin/)
   {
     my @stat = stat($file);
diff -Naur perl-5.32.0-orig/cpan/libnet/t/netrc.t perl-5.32.0/cpan/libnet/t/netrc.t
--- perl-5.32.0-orig/cpan/libnet/t/netrc.t	2020-06-15 02:01:25.000000000 +0300
+++ perl-5.32.0/cpan/libnet/t/netrc.t	2020-07-15 08:48:13.389611200 +0300
@@ -47,7 +47,7 @@
 
 SKIP: {
         skip('incompatible stat() handling for OS', 4), next SKIP 
-                if $^O =~ /os2|win32|macos|cygwin/i;
+                if $^O =~ /os2|win32|macos|cygwin|msys/i;
 
         my $warn;
         local $SIG{__WARN__} = sub {
diff -Naur perl-5.32.0-orig/cpan/Pod-Perldoc/lib/Pod/Perldoc/BaseTo.pm perl-5.32.0/cpan/Pod-Perldoc/lib/Pod/Perldoc/BaseTo.pm
--- perl-5.32.0-orig/cpan/Pod-Perldoc/lib/Pod/Perldoc/BaseTo.pm	2020-06-15 02:01:25.000000000 +0300
+++ perl-5.32.0/cpan/Pod-Perldoc/lib/Pod/Perldoc/BaseTo.pm	2020-07-15 08:48:31.929286100 +0300
@@ -29,7 +29,7 @@
  *is_mswin32 = $^O eq 'MSWin32'  ? \&TRUE : \&FALSE unless defined &is_mswin32;
  *is_dos     = $^O eq 'dos'      ? \&TRUE : \&FALSE unless defined &is_dos;
  *is_os2     = $^O eq 'os2'      ? \&TRUE : \&FALSE unless defined &is_os2;
- *is_cygwin  = $^O eq 'cygwin'   ? \&TRUE : \&FALSE unless defined &is_cygwin;
+ *is_cygwin  = ($^O eq 'cygwin' || $^O eq 'msys')   ? \&TRUE : \&FALSE unless defined &is_cygwin;
  *is_linux   = $^O eq 'linux'    ? \&TRUE : \&FALSE unless defined &is_linux;
  *is_hpux    = $^O =~ m/hpux/    ? \&TRUE : \&FALSE unless defined &is_hpux;
  *is_openbsd = $^O =~ m/openbsd/ ? \&TRUE : \&FALSE unless defined &is_openbsd;
diff -Naur perl-5.32.0-orig/cpan/Pod-Perldoc/lib/Pod/Perldoc.pm perl-5.32.0/cpan/Pod-Perldoc/lib/Pod/Perldoc.pm
--- perl-5.32.0-orig/cpan/Pod-Perldoc/lib/Pod/Perldoc.pm	2020-06-15 02:01:25.000000000 +0300
+++ perl-5.32.0/cpan/Pod-Perldoc/lib/Pod/Perldoc.pm	2020-07-15 08:48:31.929286100 +0300
@@ -66,7 +66,7 @@
  *is_mswin32 = $^O eq 'MSWin32' ? \&TRUE : \&FALSE unless defined &is_mswin32;
  *is_dos     = $^O eq 'dos'     ? \&TRUE : \&FALSE unless defined &is_dos;
  *is_os2     = $^O eq 'os2'     ? \&TRUE : \&FALSE unless defined &is_os2;
- *is_cygwin  = $^O eq 'cygwin'  ? \&TRUE : \&FALSE unless defined &is_cygwin;
+ *is_cygwin  = ($^O eq 'cygwin' || $^O eq 'msys')  ? \&TRUE : \&FALSE unless defined &is_cygwin;
  *is_linux   = $^O eq 'linux'   ? \&TRUE : \&FALSE unless defined &is_linux;
  *is_hpux    = $^O =~ m/hpux/   ? \&TRUE : \&FALSE unless defined &is_hpux;
  *is_amigaos = $^O eq 'amigaos' ? \&TRUE : \&FALSE unless defined &is_amigaos;
diff -Naur perl-5.32.0-orig/cpan/Socket/t/socketpair.t perl-5.32.0/cpan/Socket/t/socketpair.t
--- perl-5.32.0-orig/cpan/Socket/t/socketpair.t	2020-06-15 02:01:25.000000000 +0300
+++ perl-5.32.0/cpan/Socket/t/socketpair.t	2020-07-15 08:48:31.929286100 +0300
@@ -35,7 +35,7 @@
 	    }
 	    warn "Something unexpectedly hung during testing";
 	    kill "INT", $parent or die "Kill failed: $!";
-	    if( $^O eq "cygwin" ) {
+	    if( $^O eq "cygwin" || $^O eq "msys" ) {
 		# sometimes the above isn't enough on cygwin
 		sleep 1; # wait a little, it might have worked after all
 		system( "/bin/kill -f $parent; echo die $parent" );
diff -Naur perl-5.32.0-orig/cpan/Sys-Syslog/t/syslog.t perl-5.32.0/cpan/Sys-Syslog/t/syslog.t
--- perl-5.32.0-orig/cpan/Sys-Syslog/t/syslog.t	2020-06-15 02:01:25.000000000 +0300
+++ perl-5.32.0/cpan/Sys-Syslog/t/syslog.t	2020-07-15 08:48:31.929286100 +0300
@@ -18,7 +18,7 @@
 $^W = 0 if $] < 5.006;
 
 my $is_Win32  = $^O =~ /win32/i;
-my $is_Cygwin = $^O =~ /cygwin/i;
+my $is_Cygwin = $^O =~ /cygwin|msys/i;
 
 # if testing in core, check that the module is at least available
 if ($ENV{PERL_CORE}) {
diff -Naur perl-5.32.0-orig/cpan/Sys-Syslog/t/syslog-inet-udp.t perl-5.32.0/cpan/Sys-Syslog/t/syslog-inet-udp.t
--- perl-5.32.0-orig/cpan/Sys-Syslog/t/syslog-inet-udp.t	2020-06-15 02:01:25.000000000 +0300
+++ perl-5.32.0/cpan/Sys-Syslog/t/syslog-inet-udp.t	2020-07-15 08:58:17.061401000 +0300
@@ -18,7 +18,7 @@
 $^W = 0 if $] < 5.006;
 
 my $is_Win32  = $^O =~ /win32/i;
-my $is_Cygwin = $^O =~ /cygwin/i;
+my $is_Cygwin = $^O =~ /cygwin|msys/i;
 
 # if testing in core, check that the module is at least available
 if ($ENV{PERL_CORE}) {
diff -Naur perl-5.32.0-orig/cpan/Sys-Syslog/win32/compile.pl perl-5.32.0/cpan/Sys-Syslog/win32/compile.pl
--- perl-5.32.0-orig/cpan/Sys-Syslog/win32/compile.pl	2020-06-15 02:01:25.000000000 +0300
+++ perl-5.32.0/cpan/Sys-Syslog/win32/compile.pl	2020-07-15 08:48:31.944898600 +0300
@@ -127,7 +127,7 @@
     ),
 );    
 
-my $is_Cygwin = $^O =~ /Cygwin/i;
+my $is_Cygwin = $^O =~ /Cygwin|Msys/i;
 my $is_Win32  = $^O =~ /Win32/i;
 
 my %const = (
diff -Naur perl-5.32.0-orig/cpan/Sys-Syslog/win32/Win32.pm perl-5.32.0/cpan/Sys-Syslog/win32/Win32.pm
--- perl-5.32.0-orig/cpan/Sys-Syslog/win32/Win32.pm	2020-06-15 02:01:25.000000000 +0300
+++ perl-5.32.0/cpan/Sys-Syslog/win32/Win32.pm	2020-07-15 08:48:31.944898600 +0300
@@ -39,7 +39,7 @@
     ),
 );    
 
-my $is_Cygwin = $^O =~ /Cygwin/i;
+my $is_Cygwin = $^O =~ /Cygwin|Msys/i;
 my $is_Win32  = $^O =~ /Win32/i;
 
 my %const = (
diff -Naur perl-5.32.0-orig/cpan/Win32/Makefile.PL perl-5.32.0/cpan/Win32/Makefile.PL
--- perl-5.32.0-orig/cpan/Win32/Makefile.PL	2020-06-15 02:01:25.000000000 +0300
+++ perl-5.32.0/cpan/Win32/Makefile.PL	2020-07-15 08:48:31.952121800 +0300
@@ -3,7 +3,7 @@
 use warnings;
 use ExtUtils::MakeMaker;
 
-unless ($^O eq "MSWin32" || $^O eq "cygwin") {
+unless ($^O eq "MSWin32" || $^O eq "cygwin" || $^O eq "msys") {
     die "OS unsupported\n";
 }
 
@@ -13,6 +13,6 @@
     INSTALLDIRS   => ($] >= 5.008004 && $] < 5.012 ? 'perl' : 'site'),
 );
 $param{NO_META} = 1 if eval "$ExtUtils::MakeMaker::VERSION" >= 6.10_03;
-$param{LIBS} = ['-L/lib/w32api -lole32 -lversion'] if $^O eq "cygwin";
+$param{LIBS} = ['-L/usr/lib/w32api -lole32 -lversion'] if ($^O eq "cygwin" or $^O eq "msys");
 
 WriteMakefile(%param);
diff -Naur perl-5.32.0-orig/cpan/Win32/t/GetCurrentThreadId.t perl-5.32.0/cpan/Win32/t/GetCurrentThreadId.t
--- perl-5.32.0-orig/cpan/Win32/t/GetCurrentThreadId.t	2020-06-15 02:01:25.000000000 +0300
+++ perl-5.32.0/cpan/Win32/t/GetCurrentThreadId.t	2020-07-15 08:48:31.952121800 +0300
@@ -10,7 +10,7 @@
 
 my $pid = $$+0; # make sure we don't copy any magic to $pid
 
-if ($^O eq "cygwin") {
+if ($^O eq "cygwin" or $^O eq "msys") {
     skip(!defined &Cygwin::pid_to_winpid,
 	 Cygwin::pid_to_winpid($pid),
 	 Win32::GetCurrentProcessId());
diff -Naur perl-5.32.0-orig/cpan/Win32/t/Unicode.t perl-5.32.0/cpan/Win32/t/Unicode.t
--- perl-5.32.0-orig/cpan/Win32/t/Unicode.t	2020-07-15 08:44:24.762669200 +0300
+++ perl-5.32.0/cpan/Win32/t/Unicode.t	2020-07-15 08:48:31.952121800 +0300
@@ -80,7 +80,7 @@
 
 # cwd() on Cygwin returns a mapped path that we need to translate
 # back to a Windows path. Invoking `cygpath` on $subdir doesn't work.
-if ($^O eq "cygwin") {
+if ($^O eq "cygwin" or $^O eq "msys") {
     $subdir = decode "UTF-8", Cygwin::posix_to_win_path($subdir, 1);
 }
 $subdir =~ s,/,\\,g;
diff -Naur perl-5.32.0-orig/cpan/Win32API-File/File.pm perl-5.32.0/cpan/Win32API-File/File.pm
--- perl-5.32.0-orig/cpan/Win32API-File/File.pm	2020-06-15 02:01:25.000000000 +0300
+++ perl-5.32.0/cpan/Win32API-File/File.pm	2020-07-15 08:48:31.952121800 +0300
@@ -738,7 +738,7 @@
 
 	return $self->_fileno() if defined $self->_fileno();
 
-	return -1 if $^O eq 'cygwin';
+	return -1 if ($^O eq 'cygwin' or $^O eq 'msys');
 
 # FIXME: We don't always open the handle, better to query the handle or to set
 # the right access info at TIEHANDLE time.
diff -Naur perl-5.32.0-orig/cpan/Win32API-File/Makefile.PL perl-5.32.0/cpan/Win32API-File/Makefile.PL
--- perl-5.32.0-orig/cpan/Win32API-File/Makefile.PL	2020-06-15 02:01:25.000000000 +0300
+++ perl-5.32.0/cpan/Win32API-File/Makefile.PL	2020-07-15 10:11:22.346912500 +0300
@@ -5,7 +5,7 @@
 use strict;
 # See lib/ExtUtils/MakeMaker.pm for details of how to influence
 # the contents of the Makefile that is written.
-unless ($^O eq "MSWin32" || $^O eq "cygwin" || $^O eq "interix") { #not tested on Interix
+unless ($^O eq "MSWin32" || $^O eq "cygwin" || $^O eq "msys" || $^O eq "interix") { #not tested on Interix
     die "OS unsupported\n";
 }
 
diff -Naur perl-5.32.0-orig/cpan/Win32API-File/t/file.t perl-5.32.0/cpan/Win32API-File/t/file.t
--- perl-5.32.0-orig/cpan/Win32API-File/t/file.t	2020-06-15 02:01:25.000000000 +0300
+++ perl-5.32.0/cpan/Win32API-File/t/file.t	2020-07-15 10:12:12.718399300 +0300
@@ -151,7 +151,7 @@
 $ok or print "# ",fileLastError(),"\n";
 print $ok ? "" : "not ", "ok ", ++$test, "\n";	# ok 19
 
-SetFilePointer($h1, 0, [], FILE_BEGIN) if $^O eq 'cygwin';
+SetFilePointer($h1, 0, [], FILE_BEGIN) if ($^O eq 'cygwin' or $^O eq 'msys');
 
 $ok= ReadFile( $h1, $text, 0, [], [] );
 $ok or print "# ",fileLastError(),"\n";
@@ -166,7 +166,7 @@
 print $ok ? "" : "not ", "ok ", ++$test, "\n";	# ok 21
 
 $skip = "";
-if ($^O eq 'cygwin') {
+if ($^O eq 'cygwin' or $^O eq 'msys') {
     $ok = 1;
     $skip = " # skip cygwin can delete open files";
 }
@@ -247,7 +247,7 @@
 $ok or print "# ",fileLastError(),"\n";
 print $ok ? "" : "not ", "ok ", ++$test, "\n";	# ok 35
 
-if ($^O eq 'cygwin') {
+if ($^O eq 'cygwin' or $^O eq 'msys') {
     chmod( 0200 | 07777 & (stat("Moved.cp"))[2], "Moved.cp" );
 }
 else {
@@ -343,7 +343,7 @@
 print $ok ? "" : "not ", "ok ", ++$test, "\n";	# ok 49
 
 my $path = $ENV{WINDIR};
-$ok= -f $let.substr($path,$^O eq 'cygwin'?2:3)."/win.ini";
+$ok= -f $let.substr($path,($^O eq 'cygwin' || $^O eq 'msys')?2:3)."/win.ini";
 $ok or print "# ",$let.substr($path,3)."/win.ini ",fileLastError(),"\n";
 print $ok ? "" : "not ", "ok ", ++$test, "\n";	# ok 50
 
diff -Naur perl-5.32.0-orig/Cross/Makefile-cross-SH perl-5.32.0/Cross/Makefile-cross-SH
--- perl-5.32.0-orig/Cross/Makefile-cross-SH	2020-06-15 02:01:24.000000000 +0300
+++ perl-5.32.0/Cross/Makefile-cross-SH	2020-07-15 08:48:31.967853200 +0300
@@ -61,8 +61,8 @@
 				${revision}.${patchlevel}.${subversion} \
 			     -install_name \$(shrpdir)/\$@"
 		;;
-	cygwin*)
-		linklibperl="-lperl"
+	cygwin* | msys*)
+		linklibperl="-L. -lperl"
 		;;
 	sunos*)
 		linklibperl="-lperl"
@@ -467,7 +467,7 @@
 
 !NO!SUBS!
 case "$osname" in
-cygwin)
+cygwin | msys)
 	;; # Let cygwin/Makefile.SHs do its work.
 *)
 	$spitshell >>$Makefile <<'!NO!SUBS!'
@@ -954,7 +954,7 @@
 	-rm -f perl.third lib*.so.perl.third perl.3log t/perl.third t/perl.3log
 	-rm -f perl.pixie lib*.so.perl.pixie lib*.so.Addrs
 	-rm -f perl.Addrs perl.Counts t/perl.Addrs t/perl.Counts *perl.xok
-	-rm -f cygwin.c libperl*.def libperl*.dll cygperl*.dll *.exe.stackdump
+	-rm -f cygwin.c libperl*.def libperl*.dll msys-perl*.dll *.exe.stackdump
 	-rm -f perl$(EXE_EXT) miniperl$(EXE_EXT) $(LIBPERL) libperl.* microperl
 	-rm -f config.over
 
diff -Naur perl-5.32.0-orig/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/msys.pm perl-5.32.0/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/msys.pm
--- perl-5.32.0-orig/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/msys.pm	1970-01-01 03:00:00.000000000 +0300
+++ perl-5.32.0/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/msys.pm	2020-07-15 08:48:31.967853200 +0300
@@ -0,0 +1,33 @@
+package ExtUtils::CBuilder::Platform::msys;
+
+use warnings;
+use strict;
+use File::Spec;
+use ExtUtils::CBuilder::Platform::Unix;
+
+our $VERSION = '0.280234'; # VERSION
+our @ISA = qw(ExtUtils::CBuilder::Platform::Unix);
+
+# TODO: If a specific exe_file name is requested, if the exe created
+# doesn't have that name, we might want to rename it.  Apparently asking
+# for an exe of "foo" might result in "foo.exe".  Alternatively, we should
+# make sure the return value is correctly "foo.exe".
+# C.f http://rt.cpan.org/Public/Bug/Display.html?id=41003
+sub link_executable {
+  my $self = shift;
+  return $self->SUPER::link_executable(@_);
+}
+
+sub link {
+  my ($self, %args) = @_;
+
+  my $lib = $self->{config}{useshrplib} ? 'libperl.dll.a' : 'libperl.a';
+  $args{extra_linker_flags} = [
+    File::Spec->catfile($self->perl_inc(), $lib),
+    $self->split_like_shell($args{extra_linker_flags})
+  ];
+
+  return $self->SUPER::link(%args);
+}
+
+1;
diff -Naur perl-5.32.0-orig/dist/IO/t/cachepropagate-unix.t perl-5.32.0/dist/IO/t/cachepropagate-unix.t
--- perl-5.32.0-orig/dist/IO/t/cachepropagate-unix.t	2020-06-15 02:01:25.000000000 +0300
+++ perl-5.32.0/dist/IO/t/cachepropagate-unix.t	2020-07-15 08:59:40.418370300 +0300
@@ -50,7 +50,7 @@
     # This is a TODO instead of a skip so if these ever implement SO_PROTOCOL
     # we'll be notified about the passing TODO so the test can be updated.
     local $TODO = "$^O doesn't support SO_PROTOCOL on AF_UNIX"
-        if $^O =~ /^(netbsd|darwin|cygwin|hpux|solaris|dragonfly|os390)$/;
+        if $^O =~ /^(netbsd|darwin|cygwin|msys|hpux|solaris|dragonfly|os390)$/;
     ok(defined($p), 'protocol defined');
 }
 my $d = $listener->sockdomain();
@@ -105,7 +105,7 @@
     {
         # see comment above
         local $TODO = "$^O doesn't support SO_PROTOCOL on AF_UNIX"
-            if $^O =~ /^(netbsd|darwin|cygwin|hpux|solaris|dragonfly|os390)$/;
+            if $^O =~ /^(netbsd|darwin|cygwin|msys|hpux|solaris|dragonfly|os390)$/;
         ok(defined($p), 'protocol defined');
     }
     $d = $listener->sockdomain();
diff -Naur perl-5.32.0-orig/dist/IO/t/io_xs.t perl-5.32.0/dist/IO/t/io_xs.t
--- perl-5.32.0-orig/dist/IO/t/io_xs.t	2020-06-15 02:01:25.000000000 +0300
+++ perl-5.32.0/dist/IO/t/io_xs.t	2020-07-15 08:48:31.967853200 +0300
@@ -43,6 +43,8 @@
       and skip "fsync() documented to fail on non-writable handles on $^O", 1;
     $^O eq 'cygwin'
       and skip "fsync() on cygwin uses FlushFileBuffers which requires a writable handle", 1;
+    $^O eq 'msys'
+      and skip "fsync() on msys uses FlushFileBuffers which requires a writable handle", 1;
     $^O eq 'VMS'
       and skip "fsync() not allowed on a read-only handle on $^O", 1;
     open my $fh, "<", "t/io_xs.t"
diff -Naur perl-5.32.0-orig/dist/Net-Ping/lib/Net/Ping.pm perl-5.32.0/dist/Net-Ping/lib/Net/Ping.pm
--- perl-5.32.0-orig/dist/Net-Ping/lib/Net/Ping.pm	2020-06-15 02:01:25.000000000 +0300
+++ perl-5.32.0/dist/Net-Ping/lib/Net/Ping.pm	2020-07-15 08:48:31.967853200 +0300
@@ -410,15 +410,15 @@
 }
 
 sub _IsAdminUser {
-  return unless $^O eq 'MSWin32' or $^O eq "cygwin";
+  return unless $^O eq 'MSWin32' or $^O eq "cygwin" or $^O eq "msys";
   return unless eval { require Win32 };
   return unless defined &Win32::IsAdminUser;
   return Win32::IsAdminUser();
 }
 
 sub _isroot {
-  if (($> and $^O ne 'VMS' and $^O ne 'cygwin')
-    or (($^O eq 'MSWin32' or $^O eq 'cygwin')
+  if (($> and $^O ne 'VMS' and $^O ne 'cygwin' and $^O ne 'msys')
+    or (($^O eq 'MSWin32' or $^O eq 'cygwin' or $^O eq 'msys')
         and !_IsAdminUser())
     or ($^O eq 'VMS'
         and (`write sys\$output f\$privilege("SYSPRV")` =~ m/FALSE/))) {
@@ -967,7 +967,7 @@
             # This should set $! to the correct error.
             my $char;
             sysread($self->{fh},$char,1);
-            $! = ECONNREFUSED if ($! == EAGAIN && $^O =~ /cygwin/i);
+            $! = ECONNREFUSED if ($! == EAGAIN && $^O =~ /cygwin|msys/i);
 
             $ret = 1 if (!$self->{econnrefused}
                          && $! == ECONNREFUSED);
@@ -1609,7 +1609,7 @@
             $self->{bad}->{$entry->[0]} = $!;
             if (!$self->{econnrefused} &&
                 (($! == ECONNREFUSED) ||
-                 ($! == EAGAIN && $^O =~ /cygwin/i))) {
+                 ($! == EAGAIN && $^O =~ /cygwin|msys/i))) {
               # "Connection refused" means reachable
               # Good, continue
             } else {
diff -Naur perl-5.32.0-orig/dist/Net-Ping/t/001_new.t perl-5.32.0/dist/Net-Ping/t/001_new.t
--- perl-5.32.0-orig/dist/Net-Ping/t/001_new.t	2020-06-15 02:01:25.000000000 +0300
+++ perl-5.32.0/dist/Net-Ping/t/001_new.t	2020-07-15 08:48:31.984537300 +0300
@@ -60,7 +60,7 @@
     eval { $p = Net::Ping->new('icmp'); };
     skip "icmp ping requires root privileges.", 3
       if !Net::Ping::_isroot() or $^O eq 'MSWin32';
-    if($> and $^O ne 'VMS' and $^O ne 'cygwin') {
+    if($> and $^O ne 'VMS' and $^O ne 'cygwin' and $^O ne 'msys') {
         like($@, qr/icmp ping requires root privilege/, "Need root for icmp");
         skip "icmp tests require root", 2;
     } else {
diff -Naur perl-5.32.0-orig/dist/Net-Ping/t/510_ping_udp.t perl-5.32.0/dist/Net-Ping/t/510_ping_udp.t
--- perl-5.32.0-orig/dist/Net-Ping/t/510_ping_udp.t	2020-06-15 02:01:25.000000000 +0300
+++ perl-5.32.0/dist/Net-Ping/t/510_ping_udp.t	2020-07-15 08:48:31.986600500 +0300
@@ -4,7 +4,7 @@
 use Config;
 
 sub isWindowsVista {
-   return unless $^O eq 'MSWin32' or $^O eq "cygwin";
+   return unless $^O eq 'MSWin32' or $^O eq "cygwin" or $^O eq "msys";
    return unless eval { require Win32 };
    return unless defined &Win32::GetOSVersion();
 
diff -Naur perl-5.32.0-orig/dist/PathTools/Cwd.pm perl-5.32.0/dist/PathTools/Cwd.pm
--- perl-5.32.0-orig/dist/PathTools/Cwd.pm	2020-06-15 02:01:25.000000000 +0300
+++ perl-5.32.0/dist/PathTools/Cwd.pm	2020-07-15 08:48:31.986600500 +0300
@@ -135,6 +135,15 @@
     realpath		=> 'fast_abs_path',
    },
 
+   msys =>
+   {
+    getcwd		=> 'cwd',
+    fastgetcwd		=> 'cwd',
+    fastcwd		=> 'cwd',
+    abs_path		=> 'fast_abs_path',
+    realpath		=> 'fast_abs_path',
+   },
+
    amigaos =>
    {
     getcwd              => '_backtick_pwd',
@@ -236,7 +245,7 @@
     }
 }
 
-if ($^O eq 'cygwin') {
+if ($^O eq 'cygwin' || $^O eq 'msys') {
   # We need to make sure cwd() is called with no args, because it's
   # got an arg-less prototype and will die if args are present.
   local $^W = 0;
@@ -337,7 +346,7 @@
 
 sub chdir {
     my $newdir = @_ ? shift : '';	# allow for no arg (chdir to HOME dir)
-    if ($^O eq "cygwin") {
+    if ($^O eq "cygwin" || $^O eq "msys") {
       $newdir =~ s|\A///+|//|;
       $newdir =~ s|(?<=[^/])//+|/|g;
     }
diff -Naur perl-5.32.0-orig/dist/PathTools/lib/File/Spec/Cygwin.pm perl-5.32.0/dist/PathTools/lib/File/Spec/Cygwin.pm
--- perl-5.32.0-orig/dist/PathTools/lib/File/Spec/Cygwin.pm	2020-06-15 02:01:25.000000000 +0300
+++ perl-5.32.0/dist/PathTools/lib/File/Spec/Cygwin.pm	2020-07-15 08:48:31.986600500 +0300
@@ -117,12 +117,12 @@
 =cut
 
 sub case_tolerant {
-  return 1 unless $^O eq 'cygwin'
+  return 1 unless ($^O eq 'cygwin' || $^O eq 'msys')
     and defined &Cygwin::mount_flags;
 
   my $drive = shift;
   if (! $drive) {
-      my @flags = split(/,/, Cygwin::mount_flags('/cygwin'));
+      my @flags = split(/,/, Cygwin::mount_flags('/msys'));
       my $prefix = pop(@flags);
       if (! $prefix || $prefix eq 'cygdrive') {
           $drive = '/cygdrive/c';
diff -Naur perl-5.32.0-orig/dist/PathTools/lib/File/Spec/Unix.pm perl-5.32.0/dist/PathTools/lib/File/Spec/Unix.pm
--- perl-5.32.0-orig/dist/PathTools/lib/File/Spec/Unix.pm	2020-06-15 02:01:25.000000000 +0300
+++ perl-5.32.0/dist/PathTools/lib/File/Spec/Unix.pm	2020-07-15 08:48:31.986600500 +0300
@@ -57,7 +57,7 @@
       $node = $1;
     }
     # This used to be
-    # $path =~ s|/+|/|g unless ($^O eq 'cygwin');
+    # $path =~ s|/+|/|g unless ($^O eq 'cygwin' || $^O eq 'msys');
     # but that made tests 29, 30, 35, 46, and 213 (as of #13272) to fail
     # (Mainly because trailing "" directories didn't get stripped).
     # Why would cygwin avoid collapsing multiple slashes into one? --jhi
diff -Naur perl-5.32.0-orig/dist/PathTools/lib/File/Spec.pm perl-5.32.0/dist/PathTools/lib/File/Spec.pm
--- perl-5.32.0-orig/dist/PathTools/lib/File/Spec.pm	2020-06-15 02:01:25.000000000 +0300
+++ perl-5.32.0/dist/PathTools/lib/File/Spec.pm	2020-07-15 08:48:31.986600500 +0300
@@ -13,6 +13,7 @@
 	      symbian => 'Win32', # Yes, File::Spec::Win32 works on symbian.
 	      dos     => 'OS2',   # Yes, File::Spec::OS2 works on DJGPP.
 	      cygwin  => 'Cygwin',
+	      msys    => 'Cygwin',
 	      amigaos => 'AmigaOS');
 
 
diff -Naur perl-5.32.0-orig/dist/PathTools/t/crossplatform.t perl-5.32.0/dist/PathTools/t/crossplatform.t
--- perl-5.32.0-orig/dist/PathTools/t/crossplatform.t	2020-06-15 02:01:25.000000000 +0300
+++ perl-5.32.0/dist/PathTools/t/crossplatform.t	2020-07-15 08:48:32.002247500 +0300
@@ -6,7 +6,7 @@
 use Test::More;
 local $|=1;
 
-my @platforms = qw(Cygwin Epoc Mac OS2 Unix VMS Win32);
+my @platforms = qw(Cygwin Msys Epoc Mac OS2 Unix VMS Win32);
 my $tests_per_platform = 10;
 
 my $vms_unix_rpt = 0;
diff -Naur perl-5.32.0-orig/dist/PathTools/t/cwd.t perl-5.32.0/dist/PathTools/t/cwd.t
--- perl-5.32.0-orig/dist/PathTools/t/cwd.t	2020-06-15 02:01:25.000000000 +0300
+++ perl-5.32.0/dist/PathTools/t/cwd.t	2020-07-15 08:48:32.002247500 +0300
@@ -41,7 +41,7 @@
 my $tests = 31;
 # _perl_abs_path() currently only works when the directory separator
 # is '/', so don't test it when it won't work.
-my $EXTRA_ABSPATH_TESTS = ($Config{prefix} =~ m/\//) && $^O ne 'cygwin';
+my $EXTRA_ABSPATH_TESTS = ($Config{prefix} =~ m/\//) && $^O ne 'cygwin' && $^O ne 'msys';
 $tests += 4 if $EXTRA_ABSPATH_TESTS;
 plan tests => $tests;
 
diff -Naur perl-5.32.0-orig/dist/PathTools/t/cwd_enoent.t perl-5.32.0/dist/PathTools/t/cwd_enoent.t
--- perl-5.32.0-orig/dist/PathTools/t/cwd_enoent.t	2020-06-15 02:01:25.000000000 +0300
+++ perl-5.32.0/dist/PathTools/t/cwd_enoent.t	2020-07-15 08:48:32.002247500 +0300
@@ -6,7 +6,7 @@
 use File::Temp qw(tempdir);
 use Test::More;
 
-if($^O eq "cygwin") {
+if($^O eq "cygwin" || $^O eq "msys") {
     # This test skipping should be removed when the Cygwin bug is fixed.
     plan skip_all => "getcwd() fails to fail on Cygwin [perl #132733]";
 }
@@ -24,7 +24,7 @@
     SKIP: {
 	skip "_perl_abs_path() not expected to work", 4
 	    if $type eq "perl" &&
-		!(($Config{prefix} =~ m/\//) && $^O ne "cygwin");
+		!(($Config{prefix} =~ m/\//) && $^O ne "cygwin" && $^O ne "msys");
 
 	skip "getcwd() doesn't fail on non-existent directories on this platform", 4
 	    if $type eq 'regular' && $^O eq 'dragonfly';
diff -Naur perl-5.32.0-orig/dist/Storable/stacksize perl-5.32.0/dist/Storable/stacksize
--- perl-5.32.0-orig/dist/Storable/stacksize	2020-06-15 02:01:25.000000000 +0300
+++ perl-5.32.0/dist/Storable/stacksize	2020-07-15 08:48:32.013860900 +0300
@@ -168,7 +168,7 @@
 $max_depth_hash = int(0.6 * $max_depth_hash);
 
 my $stack_reserve = $^O eq "MSWin32" ? 32 : 16;
-if ($] ge "5.016" && !($^O eq "cygwin" && $ptrsize == 8)) {
+if ($] ge "5.016" && !(($^O eq "cygwin" || $^O eq "msys") && $ptrsize == 8)) {
     $max_depth -= $stack_reserve;
     $max_depth_hash -= $stack_reserve;
 }
diff -Naur perl-5.32.0-orig/dist/Time-HiRes/Makefile.PL perl-5.32.0/dist/Time-HiRes/Makefile.PL
--- perl-5.32.0-orig/dist/Time-HiRes/Makefile.PL	2020-06-15 02:01:25.000000000 +0300
+++ perl-5.32.0/dist/Time-HiRes/Makefile.PL	2020-07-15 08:48:32.013860900 +0300
@@ -23,7 +23,7 @@
 
 # TBD: Can we just use $Config(exe_ext) here instead of this complex
 #      expression?
-my $ld_exeext = ($^O eq 'cygwin' ||
+my $ld_exeext = ($^O eq 'cygwin' || $^O eq 'msys' ||
                  $^O eq 'os2' && $Config{ldflags} =~ /-Zexe\b/) ? '.exe' :
                 (($^O eq 'vos') ? $Config{exe_ext} : '');
 
@@ -817,7 +817,7 @@
 
     my $has_w32api_windows_h;
 
-    if ($^O eq 'cygwin') {
+    if ($^O eq 'cygwin' or $^O eq 'msys') {
         print "Looking for <w32api/windows.h>... ";
         if (has_include('w32api/windows.h')) {
             $has_w32api_windows_h++;
diff -Naur perl-5.32.0-orig/dist/Time-HiRes/t/stat.t perl-5.32.0/dist/Time-HiRes/t/stat.t
--- perl-5.32.0-orig/dist/Time-HiRes/t/stat.t	2020-06-15 02:01:25.000000000 +0300
+++ perl-5.32.0/dist/Time-HiRes/t/stat.t	2020-07-15 08:51:17.091807200 +0300
@@ -6,7 +6,7 @@
         require Test::More;
         Test::More::plan(skip_all => "no hi-res stat");
     }
-    if($^O =~ /\A(?:cygwin|MSWin)/) {
+    if($^O =~ /\A(?:cygwin|msys|MSWin)/) {
         require Test::More;
         Test::More::plan(skip_all =>
                 "$^O file timestamps not reliable enough for stat test");
diff -Naur perl-5.32.0-orig/dist/Time-HiRes/t/utime.t perl-5.32.0/dist/Time-HiRes/t/utime.t
--- perl-5.32.0-orig/dist/Time-HiRes/t/utime.t	2020-06-15 02:01:25.000000000 +0300
+++ perl-5.32.0/dist/Time-HiRes/t/utime.t	2020-07-15 08:51:44.272313100 +0300
@@ -127,7 +127,7 @@
 my $atime = 1.111111111;
 my $mtime = 2.222222222;
 
-if ($^O eq 'cygwin') {
+if ($^O eq 'cygwin' || $^O eq 'msys') {
     # Cygwin timestamps have less precision.
     $atime = 1.1111111;
     $mtime = 2.2222222;
diff -Naur perl-5.32.0-orig/dist/XSLoader/XSLoader_pm.PL perl-5.32.0/dist/XSLoader/XSLoader_pm.PL
--- perl-5.32.0-orig/dist/XSLoader/XSLoader_pm.PL	2020-06-15 02:01:25.000000000 +0300
+++ perl-5.32.0/dist/XSLoader/XSLoader_pm.PL	2020-07-15 08:48:32.029507900 +0300
@@ -100,7 +100,7 @@
 EOT
 
 $to_print =~ s~regexp~
-    $^O eq 'MSWin32' || $^O eq 'os2' || $^O eq 'cygwin' || $^O eq 'amigaos'
+    $^O eq 'MSWin32' || $^O eq 'os2' || $^O eq 'cygwin' || $^O eq 'msys' || $^O eq 'amigaos'
         ? '^(?:[A-Za-z]:)?[\\\/]' # Optional drive letter
         : '^/'
 ~e;
diff -Naur perl-5.32.0-orig/ext/DynaLoader/DynaLoader_pm.PL perl-5.32.0/ext/DynaLoader/DynaLoader_pm.PL
--- perl-5.32.0-orig/ext/DynaLoader/DynaLoader_pm.PL	2020-06-15 02:01:25.000000000 +0300
+++ perl-5.32.0/ext/DynaLoader/DynaLoader_pm.PL	2020-07-15 08:48:32.035639200 +0300
@@ -482,6 +482,9 @@
 	    <<$^O-eq-cygwin>>
             push(@names,"cyg$_.$dl_so")  unless m:/:;
 	    <</$^O-eq-cygwin>>
+	    <<$^O-eq-msys>>
+            push(@names,"msys-$_.$dl_so")  unless m:/:;
+	    <</$^O-eq-msys>>
             push(@names,"lib$_.$dl_so")  unless m:/:;
             push(@names, $_);
         }
diff -Naur perl-5.32.0-orig/ext/DynaLoader/t/DynaLoader.t perl-5.32.0/ext/DynaLoader/t/DynaLoader.t
--- perl-5.32.0-orig/ext/DynaLoader/t/DynaLoader.t	2020-06-15 02:01:25.000000000 +0300
+++ perl-5.32.0/ext/DynaLoader/t/DynaLoader.t	2020-07-15 08:48:32.035639200 +0300
@@ -117,7 +117,7 @@
     # (not at least by that name) that the dl_findfile()
     # could find.
     skip( "dl_findfile test not appropriate on $^O", 1 )
-	if $^O =~ /(win32|vms|openbsd|bitrig|cygwin|vos|os390)/i;
+	if $^O =~ /(win32|vms|openbsd|bitrig|cygwin|msys|vos|os390)/i;
     # Play safe and only try this test if this system
     # looks pretty much Unix-like.
     skip( "dl_findfile test not appropriate on $^O", 1 )
diff -Naur perl-5.32.0-orig/ext/File-Find/t/find.t perl-5.32.0/ext/File-Find/t/find.t
--- perl-5.32.0-orig/ext/File-Find/t/find.t	2020-06-15 02:01:25.000000000 +0300
+++ perl-5.32.0/ext/File-Find/t/find.t	2020-07-15 08:48:32.035639200 +0300
@@ -12,7 +12,7 @@
     }
     $SIG{'__WARN__'} = sub { $warn_msg = $_[0]; warn "# $_[0]"; };
 
-    if ($^O eq 'MSWin32' || $^O eq 'cygwin' || $^O eq 'VMS') {
+    if ($^O eq 'MSWin32' || $^O eq 'cygwin' || $^O eq 'msys' || $^O eq 'VMS') {
         # This is a hack - at present File::Find does not produce native names
         # on Win32 or VMS, so force File::Spec to use Unix names.
         # must be set *before* importing File::Find
diff -Naur perl-5.32.0-orig/ext/File-Glob/t/basic.t perl-5.32.0/ext/File-Glob/t/basic.t
--- perl-5.32.0-orig/ext/File-Glob/t/basic.t	2020-06-15 02:01:25.000000000 +0300
+++ perl-5.32.0/ext/File-Glob/t/basic.t	2020-07-15 08:48:32.035639200 +0300
@@ -141,7 +141,7 @@
 # should return an empty list, and set ERROR
 SKIP: {
     skip $^O, 2 if $^O eq 'MSWin32' or $^O eq 'NetWare'
-        or $^O eq 'os2' or $^O eq 'VMS' or $^O eq 'cygwin';
+        or $^O eq 'os2' or $^O eq 'VMS' or $^O eq 'cygwin' or $^O eq 'msys';
     skip "AFS", 2 if Cwd::cwd() =~ m#^$Config{'afsroot'}#s;
     skip "running as root", 2 if not $>;
 
diff -Naur perl-5.32.0-orig/ext/NDBM_File/Makefile.PL perl-5.32.0/ext/NDBM_File/Makefile.PL
--- perl-5.32.0-orig/ext/NDBM_File/Makefile.PL	2020-06-15 02:01:25.000000000 +0300
+++ perl-5.32.0/ext/NDBM_File/Makefile.PL	2020-07-15 08:48:32.051288100 +0300
@@ -1,7 +1,7 @@
 use ExtUtils::MakeMaker;
 WriteMakefile(
     NAME	=> 'NDBM_File',
-    LIBS => ["-L/usr/local/lib -lndbm", "-ldbm -lucb"],
+    LIBS => ["-lgdbm -lgdbm_compat"],
     XSPROTOARG => '-noprototypes', 		# XXX remove later?
     VERSION_FROM => 'NDBM_File.pm',
 );
diff -Naur perl-5.32.0-orig/ext/ODBM_File/Makefile.PL perl-5.32.0/ext/ODBM_File/Makefile.PL
--- perl-5.32.0-orig/ext/ODBM_File/Makefile.PL	2020-06-15 02:01:25.000000000 +0300
+++ perl-5.32.0/ext/ODBM_File/Makefile.PL	2020-07-15 08:48:32.051288100 +0300
@@ -1,7 +1,7 @@
 use ExtUtils::MakeMaker;
 WriteMakefile(
     NAME	=> 'ODBM_File',
-    LIBS => ["-ldbm -lucb"],
+    LIBS => ["-lgdbm -lgdbm_compat"],
     XSPROTOARG => '-noprototypes', 		# XXX remove later?
     VERSION_FROM => 'ODBM_File.pm', 
 );
diff -Naur perl-5.32.0-orig/ext/POSIX/Makefile.PL perl-5.32.0/ext/POSIX/Makefile.PL
--- perl-5.32.0-orig/ext/POSIX/Makefile.PL	2020-06-15 02:01:25.000000000 +0300
+++ perl-5.32.0/ext/POSIX/Makefile.PL	2020-07-15 08:48:32.051288100 +0300
@@ -20,7 +20,7 @@
 if ($^O eq 'aix' && $Config{uselongdouble}) {
     push @libs, qw(c128);
 }
-if ($^O eq 'cygwin' && $Config{usequadmath}) {
+if (($^O eq 'cygwin' || $^O eq 'msys') && $Config{usequadmath}) {
     push @libs, qw(quadmath);
 }
 WriteMakefile(
diff -Naur perl-5.32.0-orig/ext/POSIX/t/sysconf.t perl-5.32.0/ext/POSIX/t/sysconf.t
--- perl-5.32.0-orig/ext/POSIX/t/sysconf.t	2020-06-15 02:01:25.000000000 +0300
+++ perl-5.32.0/ext/POSIX/t/sysconf.t	2020-07-15 08:48:32.051288100 +0300
@@ -161,7 +161,7 @@
 }
 
 SKIP: {
-    if($^O eq 'cygwin') {
+    if($^O eq 'cygwin' or $^O eq 'msys') {
         pop @sys_consts;
         skip("No _SC_TZNAME_MAX on Cygwin", 1);
     }
diff -Naur perl-5.32.0-orig/ext/POSIX/t/time.t perl-5.32.0/ext/POSIX/t/time.t
--- perl-5.32.0-orig/ext/POSIX/t/time.t	2020-06-15 02:01:25.000000000 +0300
+++ perl-5.32.0/ext/POSIX/t/time.t	2020-07-15 08:48:32.066902800 +0300
@@ -22,7 +22,7 @@
     # actually do anything.  Cygwin works in some places, but not others.  The
     # other Win32's below are guesses.
     skip "No tzset()", 2
-       if $^O eq "VMS" || $^O eq "cygwin" || $^O eq "djgpp" ||
+       if $^O eq "VMS" || $^O eq "cygwin" || $^O eq "msys" || $^O eq "djgpp" ||
           $^O eq "MSWin32" || $^O eq "dos" || $^O eq "interix";
     tzset();
     my @tzname = tzname();
diff -Naur perl-5.32.0-orig/ext/Win32CORE/t/win32core.t perl-5.32.0/ext/Win32CORE/t/win32core.t
--- perl-5.32.0-orig/ext/Win32CORE/t/win32core.t	2020-06-15 02:01:25.000000000 +0300
+++ perl-5.32.0/ext/Win32CORE/t/win32core.t	2020-07-15 08:48:32.066902800 +0300
@@ -24,8 +24,8 @@
 my $errno = 0 + $!;
 my $sys_errno = 0 + $^E;
 SKIP: {
-    $^O eq "cygwin"
-        and skip q($^E isn't useful on cygwin), 1;
+    $^O eq "cygwin" || $^O eq 'msys'
+        and skip q($^E isn't useful on cygwin/msys), 1;
     # [perl #42925] - Loading Win32::GetLastError() via the forwarder function
     # should not affect the last error being retrieved
     is($sys_errno, 42, '$^E is preserved across Win32 autoload');
diff -Naur perl-5.32.0-orig/ext/XS-APItest/t/call_checker.t perl-5.32.0/ext/XS-APItest/t/call_checker.t
--- perl-5.32.0-orig/ext/XS-APItest/t/call_checker.t	2020-06-15 02:01:25.000000000 +0300
+++ perl-5.32.0/ext/XS-APItest/t/call_checker.t	2020-07-15 08:48:32.066902800 +0300
@@ -6,7 +6,7 @@
 
 {
     local $TODO = "[perl #78502] function pointers don't match on cygwin"
-        if $^O eq "cygwin";
+        if ($^O eq "cygwin" || $^O eq "msys");
     ok( eval { XS::APItest::test_cv_getset_call_checker(); 1 },
         "test_cv_getset_call_checker() works as expected")
         or diag $@;
diff -Naur perl-5.32.0-orig/haiku/Haiku/Makefile.PL perl-5.32.0/haiku/Haiku/Makefile.PL
--- perl-5.32.0-orig/haiku/Haiku/Makefile.PL	2020-06-15 02:01:25.000000000 +0300
+++ perl-5.32.0/haiku/Haiku/Makefile.PL	2020-07-15 08:48:32.066902800 +0300
@@ -6,7 +6,7 @@
 }
 
 #my @libs;
-#push @libs, '-L/lib/w32api -lole32 -lversion' if $^O eq "cygwin";
+#push @libs, '-L/lib/w32api -lole32 -lversion' if ($^O eq "cygwin" or $^O eq "msys");
 
 WriteMakefile(
     NAME          => 'Haiku',
diff -Naur perl-5.32.0-orig/hints/msys.sh perl-5.32.0/hints/msys.sh
--- perl-5.32.0-orig/hints/msys.sh	1970-01-01 03:00:00.000000000 +0300
+++ perl-5.32.0/hints/msys.sh	2020-07-15 10:03:08.752180800 +0300
@@ -0,0 +1,98 @@
+#! /bin/sh
+# msys.sh - hints for building perl using the MSYS environment for Win32
+#
+
+# not otherwise settable
+exe_ext='.exe'
+firstmakefile='GNUmakefile'
+case "$ldlibpthname" in
+'') ldlibpthname=PATH ;;
+esac
+archobjs='cygwin.o'
+
+# mandatory (overrides incorrect defaults)
+test -z "$cc" && cc='gcc'
+if test -z "$plibpth"
+then
+    plibpth=`gcc -print-file-name=libc.a`
+    plibpth=`dirname $plibpth`
+    plibpth=`cd $plibpth && pwd`
+fi
+so='dll'
+# - eliminate -lc, implied by gcc and a symlink to libmsys-2.0.a
+libswanted=`echo " $libswanted " | sed -e 's/ c / /g'`
+# - eliminate -lm, symlink to libmsys-2.0.a
+libswanted=`echo " $libswanted " | sed -e 's/ m / /g'`
+# - eliminate -lutil, symbols are all in libmsys-2.0.a
+libswanted=`echo " $libswanted " | sed -e 's/ util / /g'`
+ignore_versioned_solibs='y'
+usenm='no'
+libc='/usr/lib/libmsys-2.0.a'
+loclibpth=' '
+glibpth=' '
+plibpth=' '
+libpth=' '
+PATH='.:/usr/bin/'
+# - add libgdbm_compat $libswanted
+libswanted="$libswanted gdbm_compat"
+test -z "$optimize" && optimize='-O3'
+man3ext='3pm'
+test -z "$use64bitint" && use64bitint='define'
+test -z "$useithreads" && useithreads='define'
+test -z "$usemymalloc" && usemymalloc='undef'
+ccflags="$ccflags -DPERL_USE_SAFE_PUTENV -U__STRICT_ANSI__ -D_GNU_SOURCE"
+# - otherwise i686-msys
+archname='msys'
+
+# dynamic loading
+# - otherwise -fpic
+cccdlflags=' '
+lddlflags=' --shared'
+test -z "$ld" && ld='g++'
+
+case "$osvers" in
+    # Configure gets these wrong if the IPC server isn't yet running:
+    # only use for 1.5.7 and onwards
+    [2-9]*|1.[6-9]*|1.[1-5][0-9]*|1.5.[7-9]*|1.5.[1-6][0-9]*)
+        d_semctl_semid_ds='define'
+        d_semctl_semun='define'
+        ;;
+esac
+
+case "$osvers" in
+    [2-9]*|1.[6-9]*)
+        # IPv6 only since 1.7
+        d_inetntop='define'
+        d_inetpton='define'
+        ;;
+    *)
+        # IPv6 not implemented before cygwin-1.7
+        d_inetntop='undef'
+        d_inetpton='undef'
+esac
+
+case "$osvers" in
+    2.[0-4].*|1.*)
+        # newlib finitel is buggy before cygwin-2.5.0
+        d_finitel='undef'
+        ;;
+esac
+
+# compile Win32CORE "module" as static. try to avoid the space.
+if test -z "$static_ext"; then
+  static_ext="Win32CORE"
+else
+  static_ext="$static_ext Win32CORE"
+fi
+
+# Win9x problem with non-blocking read from a closed pipe
+d_eofnblk='define'
+
+# suppress auto-import warnings
+ldflags="$ldflags -Wl,--enable-auto-import -Wl,--export-all-symbols -Wl,--enable-auto-image-base"
+lddlflags="$lddlflags $ldflags"
+
+# strip exe's and dll's, better do it afterwards
+#ldflags="$ldflags -s"
+#ccdlflags="$ccdlflags -s"
+#lddlflags="$lddlflags -s"
diff -Naur perl-5.32.0-orig/install_lib.pl perl-5.32.0/install_lib.pl
--- perl-5.32.0-orig/install_lib.pl	2020-06-15 02:01:25.000000000 +0300
+++ perl-5.32.0/install_lib.pl	2020-07-15 08:48:32.082521400 +0300
@@ -46,7 +46,7 @@
 $Is_VMS = $^O eq 'VMS';
 $Is_W32 = $^O eq 'MSWin32';
 $Is_OS2 = $^O eq 'os2';
-$Is_Cygwin = $^O eq 'cygwin';
+$Is_Cygwin = ($^O eq 'cygwin' || $^O eq 'msys');
 $Is_Darwin = $^O eq 'darwin';
 $Is_NetWare = $Config{osname} eq 'NetWare';
 $Is_AmigaOS = $^O eq 'amigaos';
diff -Naur perl-5.32.0-orig/installman perl-5.32.0/installman
--- perl-5.32.0-orig/installman	2020-06-15 02:01:25.000000000 +0300
+++ perl-5.32.0/installman	2020-07-15 08:48:32.082521400 +0300
@@ -154,7 +154,7 @@
 	    next;
 	}
 
-	if ($^O eq 'os2' || $^O eq 'amigaos' || $^O eq 'uwin' || $^O eq 'cygwin') {
+	if ($^O eq 'os2' || $^O eq 'amigaos' || $^O eq 'uwin' || $^O eq 'cygwin' || $^O eq 'msys') {
             $manpage =~ s#::#.#g;
 	}
         my $tmp = "${mandir}/${manpage}.tmp";
diff -Naur perl-5.32.0-orig/lib/AnyDBM_File.t perl-5.32.0/lib/AnyDBM_File.t
--- perl-5.32.0-orig/lib/AnyDBM_File.t	2020-06-15 02:01:25.000000000 +0300
+++ perl-5.32.0/lib/AnyDBM_File.t	2020-07-15 08:48:32.082521400 +0300
@@ -15,7 +15,8 @@
 $Is_Dosish = ($^O eq 'amigaos' || $^O eq 'MSWin32' ||
 	      $^O eq 'NetWare' || $^O eq 'dos' ||
 	      $^O eq 'os2' ||
-	      $^O eq 'cygwin');
+	      $^O eq 'cygwin' ||
+	      $^O eq 'msys');
 
 my $filename = "Any_dbmx$$";
 unlink <"$filename*">;
diff -Naur perl-5.32.0-orig/lib/ExtUtils/t/Embed.t perl-5.32.0/lib/ExtUtils/t/Embed.t
--- perl-5.32.0-orig/lib/ExtUtils/t/Embed.t	2020-06-15 02:01:25.000000000 +0300
+++ perl-5.32.0/lib/ExtUtils/t/Embed.t	2020-07-15 08:48:32.098134600 +0300
@@ -117,7 +117,7 @@
         s!-bE:(\S+)!-bE:$perl_exp!;
     }
    }
-   elsif ($^O eq 'cygwin') { # Cygwin needs no special treatment like below
+   elsif ($^O eq 'cygwin' or $^O eq 'msys') { # Cygwin needs no special treatment like below
        ;
    }
    elsif ($Config{'libperl'} !~ /\Alibperl\./) {
@@ -160,7 +160,7 @@
 unlink("$exe.manifest") if $cl and $Config{'ccversion'} =~ /^(\d+)/ and $1 >= 14;
 unlink("$exe$Config{exe_ext}") if $skip_exe;
 unlink("embed_test.map","embed_test.lis") if $^O eq 'VMS';
-unlink(glob("./*.dll")) if $^O eq 'cygwin';
+unlink(glob("./*.dll")) if ($^O eq 'cygwin' or $^O eq 'msys');
 unlink($testlib)	       if $libperl_copied;
 
 # gcc -g -I.. -L../ -o perl_test perl_test.c -lperl `../perl -I../lib -MExtUtils::Embed -I../ -e ccflags -e ldopts`
diff -Naur perl-5.32.0-orig/lib/File/Compare.t perl-5.32.0/lib/File/Compare.t
--- perl-5.32.0-orig/lib/File/Compare.t	2020-06-15 02:01:25.000000000 +0300
+++ perl-5.32.0/lib/File/Compare.t	2020-07-15 08:48:32.098134600 +0300
@@ -105,7 +105,7 @@
     TODO: {
         my $why = "spaces after filename silently truncated";
         my $how_many = 1;
-        my $condition = ($^O eq "cygwin") or ($^O eq "vos");
+        my $condition = ($^O eq "cygwin") or ($^O eq "msys") or ($^O eq "vos");
         todo_skip $why, $how_many if $condition;
         is($donetests[2], 0, "file/fileCR [$donetests[2]]");
     }
diff -Naur perl-5.32.0-orig/lib/File/Copy.t perl-5.32.0/lib/File/Copy.t
--- perl-5.32.0-orig/lib/File/Copy.t	2020-06-15 02:01:25.000000000 +0300
+++ perl-5.32.0/lib/File/Copy.t	2020-07-15 08:48:32.098134600 +0300
@@ -180,7 +180,7 @@
 
   SKIP: {
     skip "Testing hard links", 3 
-         if !$Config{d_link} or $^O eq 'MSWin32' or $^O eq 'cygwin';
+         if !$Config{d_link} or $^O eq 'MSWin32' or $^O eq 'cygwin' or $^O eq 'msys';
 
     open(F, ">", "file-$$") or die $!;
     print F "dummy content\n";
diff -Naur perl-5.32.0-orig/lib/locale.t perl-5.32.0/lib/locale.t
--- perl-5.32.0-orig/lib/locale.t	2020-06-15 02:01:25.000000000 +0300
+++ perl-5.32.0/lib/locale.t	2020-07-15 08:48:32.113758200 +0300
@@ -87,7 +87,7 @@
 
 # cygwin isn't returning proper radix length in this locale, but supposedly to
 # be fixed in later versions.
-if ($os eq 'cygwin' && version->new(($Config{osvers} =~ /^(\d+(?:\.\d+)+)/)[0]) le v2.4.1) {
+if (($^O eq 'cygwin' or $^O eq 'msys') && version->new(($Config{osvers} =~ /^(\d+(?:\.\d+)+)/)[0]) le v2.4.1) {
     $known_bad_locales{'cygwin'} = qr/ ^ ps_AF /ix;
 }
 
diff -Naur perl-5.32.0-orig/lib/Net/hostent.t perl-5.32.0/lib/Net/hostent.t
--- perl-5.32.0-orig/lib/Net/hostent.t	2020-06-15 02:01:25.000000000 +0300
+++ perl-5.32.0/lib/Net/hostent.t	2020-07-15 08:48:32.113758200 +0300
@@ -57,7 +57,7 @@
 
 SKIP: {
     skip "Windows will return the machine name instead of 'localhost'", 2
-      if $^O eq 'MSWin32' or $^O eq 'NetWare' or $^O eq 'cygwin';
+      if $^O eq 'MSWin32' or $^O eq 'NetWare' or $^O eq 'cygwin' or $^O eq 'msys';
 
     print "# name = " . $h->name . ", aliases = " . join (",", @{$h->aliases}) . "\n";
 
diff -Naur perl-5.32.0-orig/lib/perl5db.pl perl-5.32.0/lib/perl5db.pl
--- perl-5.32.0-orig/lib/perl5db.pl	2020-06-15 02:01:25.000000000 +0300
+++ perl-5.32.0/lib/perl5db.pl	2020-07-15 08:48:32.127273300 +0300
@@ -1527,7 +1527,7 @@
 
 =cut
 
-    if ( $^O eq 'cygwin' ) {
+    if ( $^O eq 'cygwin' or $^O eq 'msys' ) {
 
         # /dev/tty is binary. use stdin for textmode
         undef $console;
diff -Naur perl-5.32.0-orig/lib/User/grent.t perl-5.32.0/lib/User/grent.t
--- perl-5.32.0-orig/lib/User/grent.t	2020-06-15 02:01:25.000000000 +0300
+++ perl-5.32.0/lib/User/grent.t	2020-07-15 08:48:32.127273300 +0300
@@ -18,7 +18,7 @@
 }
 
 BEGIN {
-    our $gid = $^O ne 'cygwin' ? 0 : 18;
+    our $gid = ($^O ne 'cygwin' || $^O ne 'msys') ? 0 : 18;
     our @grent = getgrgid $gid; # This is the function getgrgid.
     unless (@grent) { plan skip_all => "no gid 0"; }
 }
diff -Naur perl-5.32.0-orig/lib/User/pwent.t perl-5.32.0/lib/User/pwent.t
--- perl-5.32.0-orig/lib/User/pwent.t	2020-06-15 02:01:25.000000000 +0300
+++ perl-5.32.0/lib/User/pwent.t	2020-07-15 08:48:32.127273300 +0300
@@ -21,7 +21,7 @@
     # On VMS getpwuid(0) may return [$gid,0] UIC info (which may not exist).
     # It is better to use the $< uid for testing on VMS instead.
     if ( $^O eq 'VMS' ) { $uid = $< ; }
-    if ( $^O eq 'cygwin' ) { $uid = 500 ; }
+    if ( $^O eq 'cygwin' or $^O eq 'msys' ) { $uid = 500 ; }
     our @pwent = getpwuid $uid; # This is the function getpwuid.
     unless (@pwent) { print "1..0 # Skip: no uid $uid\n"; exit 0 }
 }
@@ -35,7 +35,7 @@
 my $pwent = getpwuid $uid; # This is the OO getpwuid.
 
 my $uid_expect = $uid;
-if ( $^O eq 'cygwin' ) {
+if ( $^O eq 'cygwin' or $^O eq 'msys' ) {
     print "not " unless (   $pwent->uid == $uid_expect
                          || $pwent->uid == 500         );  # go figure
 }
diff -Naur perl-5.32.0-orig/makedepend.SH perl-5.32.0/makedepend.SH
--- perl-5.32.0-orig/makedepend.SH	2020-06-15 02:01:25.000000000 +0300
+++ perl-5.32.0/makedepend.SH	2020-07-15 08:48:32.127273300 +0300
@@ -118,6 +118,7 @@
     uwin)     uwinfix="-e s,\\\\\\\\,/,g -e s,\\([a-zA-Z]\\):/,/\\1/,g" ;;
     os2)      uwinfix="-e s,\\\\\\\\,/,g" ;;
     cygwin)   uwinfix="-e s,\\\\\\\\,/,g" ;;
+    msys)     uwinfix="-e s,\\\\\\\\,/,g" ;;
     posix-bc) uwinfix="-e s/\\*POSIX(\\(.*\\))/\\1/" ;;
     vos)      uwinfix="-e s/\#/\\\#/" ;;
     *)        uwinfix="" ;;
diff -Naur perl-5.32.0-orig/Makefile.SH perl-5.32.0/Makefile.SH
--- perl-5.32.0-orig/Makefile.SH	2020-07-15 08:44:24.430587100 +0300
+++ perl-5.32.0/Makefile.SH	2020-07-15 08:48:32.127273300 +0300
@@ -78,7 +78,7 @@
 			;;
 		esac
 		;;
-	cygwin*)
+	cygwin*|msys*)
 		shrpldflags="$shrpldflags -Wl,--out-implib=libperl.dll.a"
 		linklibperl="-L. -lperl"
 		;;
@@ -861,7 +861,7 @@
 
 !NO!SUBS!
 	;;
-cygwin)
+cygwin|msys)
 	$spitshell >>$Makefile <<'!NO!SUBS!'
 cygwin.c: cygwin/cygwin.c
 	$(LNS) cygwin/cygwin.c
@@ -1382,7 +1382,7 @@
 	-rm -f perl.exp ext.libs $(generated_pods) uni.data opmini.o perlmini.o pod/roffitall
 	-rm -f perl.export perl.dll perl.libexp perl.map perl.def
 	-rm -f *perl.xok
-	-rm -f cygwin.c libperl*.def libperl*.dll cygperl*.dll *.exe.stackdump
+	-rm -f cygwin.c libperl*.def libperl*.dll cygperl*.dll msys-perl*.dll *.exe.stackdump
 	-rm -f $(PERL_EXE) $(MINIPERL_EXE) $(LIBPERL) libperl.* microperl
 	-rm -f config.arch config.over $(DTRACE_H)
 
@@ -1542,7 +1542,7 @@
 '') $spitshell >>$Makefile <<'!NO!SUBS!'
 test_prep test-prep: test_prep_pre $(MINIPERL_EXE) $(unidatafiles) $(PERL_EXE) \
 	$(dynamic_ext) $(TEST_PERL_DLL) runtests $(generated_pods) common_build
-	cd t && (rm -f $(PERL_EXE); $(LNS) ../$(PERL_EXE) $(PERL_EXE))
+	cd t && (rm -f $(PERL_EXE) $(LIBPERL); $(LNS) ../$(PERL_EXE) $(PERL_EXE); $(LNS) ../$(LIBPERL) $(LIBPERL))
 
 !NO!SUBS!
 ;;
diff -Naur perl-5.32.0-orig/regen/regen_lib.pl perl-5.32.0/regen/regen_lib.pl
--- perl-5.32.0-orig/regen/regen_lib.pl	2020-06-15 02:01:25.000000000 +0300
+++ perl-5.32.0/regen/regen_lib.pl	2020-07-15 08:48:32.142921600 +0300
@@ -7,7 +7,7 @@
 
 # Common functions needed by the regen scripts
 
-our $Needs_Write = $^O eq 'cygwin' || $^O eq 'os2' || $^O eq 'MSWin32';
+our $Needs_Write = $^O eq 'cygwin' || $^O eq 'msys' || $^O eq 'os2' || $^O eq 'MSWin32';
 
 our $Verbose = 0;
 @ARGV = grep { not($_ eq '-q' and $Verbose = -1) }
diff -Naur perl-5.32.0-orig/symbian/sanity.pl perl-5.32.0/symbian/sanity.pl
--- perl-5.32.0-orig/symbian/sanity.pl	2020-06-15 02:01:25.000000000 +0300
+++ perl-5.32.0/symbian/sanity.pl	2020-07-15 08:48:32.142921600 +0300
@@ -2,7 +2,7 @@
 
 if (exists $ENV{'!C:'}) {
   print "You are running this under Cygwin, aren't you? (found '!C' in %ENV)\n";
-  print "Are you perhaps using Cygwin Perl? (\$^O is '$^O')\n" if $^O =~ /cygwin/;
+  print "Are you perhaps using Cygwin Perl? (\$^O is '$^O')\n" if $^O =~ /cygwin|msys/;
   print "I'm sorry but only cmd.exe with e.g. the ActivePerl will work.\n";
   exit(1);
 }
diff -Naur perl-5.32.0-orig/t/io/eintr.t perl-5.32.0/t/io/eintr.t
--- perl-5.32.0-orig/t/io/eintr.t	2020-06-15 02:01:25.000000000 +0300
+++ perl-5.32.0/t/io/eintr.t	2020-07-15 08:48:32.142921600 +0300
@@ -50,7 +50,7 @@
 # platforms
 
 my ($osmajmin) = $Config{osvers} =~ /^(\d+\.\d+)/;
-if ($^O eq 'VMS' || $^O eq 'MSWin32' || $^O eq 'cygwin' || $^O =~ /freebsd/ || $^O eq 'midnightbsd' ||
+if ($^O eq 'VMS' || $^O eq 'MSWin32' || $^O eq 'cygwin' || $^O eq 'msys' || $^O =~ /freebsd/ || $^O eq 'midnightbsd' ||
      ($^O eq 'solaris' && $Config{osvers} eq '2.8') || $^O eq 'nto' ||
      ($^O eq 'darwin' && $osmajmin < 9) ||
     ((int($]*1000) & 1) == 0)
diff -Naur perl-5.32.0-orig/t/io/fs.t perl-5.32.0/t/io/fs.t
--- perl-5.32.0-orig/t/io/fs.t	2020-06-15 02:01:25.000000000 +0300
+++ perl-5.32.0/t/io/fs.t	2020-07-15 08:48:32.142921600 +0300
@@ -39,7 +39,7 @@
     !($^O eq 'MSWin32' || $^O eq 'NetWare' ||
       $^O eq 'dos'     || $^O eq 'os2'     ||
       $^O eq 'cygwin'  || $^O eq 'amigaos' ||
-	  $wd =~ m#$Config{afsroot}/#
+      $^O eq 'msys'    || $wd =~ m#$Config{afsroot}/#
      );
 
 if (defined &Win32::IsWinNT && Win32::IsWinNT()) {
@@ -60,7 +60,7 @@
 $needs_fh_reopen = 1 if (defined &Win32::IsWin95 && Win32::IsWin95());
 
 my $skip_mode_checks =
-    $^O eq 'cygwin' && $ENV{CYGWIN} !~ /ntsec/;
+    $^O eq 'msys' && $ENV{MSYS} !~ /ntsec/;
 
 plan tests => 61;
 
@@ -396,7 +396,7 @@
 # check if rename() can be used to just change case of filename
 SKIP: {
     skip "Works in Cygwin only if check_case is set to relaxed", 1
-      if ($ENV{'CYGWIN'} && ($ENV{'CYGWIN'} =~ /check_case:(?:adjust|strict)/));
+      if ($ENV{'MSYS'} && ($ENV{'MSYS'} =~ /check_case:(?:adjust|strict)/));
 
     chdir "./$tmpdir";
     open(FH,'>x') || die "Can't create x";
diff -Naur perl-5.32.0-orig/t/io/tell.t perl-5.32.0/t/io/tell.t
--- perl-5.32.0-orig/t/io/tell.t	2020-06-15 02:01:25.000000000 +0300
+++ perl-5.32.0/t/io/tell.t	2020-07-15 08:48:32.158538800 +0300
@@ -11,7 +11,7 @@
 $TST = 'TST';
 
 $Is_Dosish = ($^O eq 'MSWin32' or $^O eq 'NetWare' or $^O eq 'dos' or
-              $^O eq 'os2' or $^O eq 'cygwin' or
+              $^O eq 'os2' or $^O eq 'cygwin' or $^O eq 'msys' or
               $^O =~ /^uwin/);
 
 open($TST, 'harness') || (die "Can't open harness");
@@ -160,7 +160,7 @@
   pass("check tell() after writing in mode '>>'");
 }
 else {
-  if (($^O eq "cygwin") && (&PerlIO::get_layers($tst) eq 'stdio')) {
+  if (($^O eq "cygwin" || $^O eq "msys") && (&PerlIO::get_layers($tst) eq 'stdio')) {
     fail "# TODO: file pointer not at eof";
   }
   elsif ($^O eq "vos") {
diff -Naur perl-5.32.0-orig/t/lib/cygwin.t perl-5.32.0/t/lib/cygwin.t
--- perl-5.32.0-orig/t/lib/cygwin.t	2020-06-15 02:01:25.000000000 +0300
+++ perl-5.32.0/t/lib/cygwin.t	2020-07-15 08:48:32.158538800 +0300
@@ -4,7 +4,7 @@
     chdir 't' if -d 't';
     @INC = ('../lib');
     require './test.pl';
-    skip_all('cygwin specific test') unless $^O eq 'cygwin';
+    skip_all('cygwin specific test') unless ($^O eq 'cygwin' || $^O eq 'msys');
 }
 
 plan(tests => 16);
diff -Naur perl-5.32.0-orig/t/lib/dbmt_common.pl perl-5.32.0/t/lib/dbmt_common.pl
--- perl-5.32.0-orig/t/lib/dbmt_common.pl	2020-06-15 02:01:25.000000000 +0300
+++ perl-5.32.0/t/lib/dbmt_common.pl	2020-07-15 08:48:32.158538800 +0300
@@ -43,7 +43,7 @@
 }
 SKIP: {
     skip "different file permission semantics on $^O", 1
-	if $^O eq 'amigaos' || $^O eq 'os2' || $^O eq 'MSWin32' || $^O eq 'NetWare' || $^O eq 'dos' || $^O eq 'cygwin' || $^O eq 'vos';
+	if $^O eq 'amigaos' || $^O eq 'os2' || $^O eq 'MSWin32' || $^O eq 'NetWare' || $^O eq 'dos' || $^O eq 'cygwin' || $^O eq 'msys' || $^O eq 'vos';
     my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,
 	$blksize,$blocks) = stat($Dfile);
     is($mode & 0777, 0640);
diff -Naur perl-5.32.0-orig/t/op/groups.t perl-5.32.0/t/op/groups.t
--- perl-5.32.0-orig/t/op/groups.t	2020-06-15 02:01:25.000000000 +0300
+++ perl-5.32.0/t/op/groups.t	2020-07-15 08:48:32.158538800 +0300
@@ -296,7 +296,7 @@
 
 # Test if this is Cygwin
 sub cygwin_nt {
-    return $Config::Config{myuname} =~ /^cygwin_nt/i;
+    return $Config::Config{myuname} =~ /^msys_nt/i;
 }
 
 # Get perl's supplementary groups and the number of times each gid
diff -Naur perl-5.32.0-orig/t/op/magic.t perl-5.32.0/t/op/magic.t
--- perl-5.32.0-orig/t/op/magic.t	2020-06-15 02:01:25.000000000 +0300
+++ perl-5.32.0/t/op/magic.t	2020-07-15 08:48:32.174154200 +0300
@@ -54,7 +54,7 @@
 $Is_VMS      = $^O eq 'VMS';
 $Is_Dos      = $^O eq 'dos';
 $Is_os2      = $^O eq 'os2';
-$Is_Cygwin   = $^O eq 'cygwin';
+$Is_Cygwin   = ($^O eq 'cygwin' || $^O eq 'msys');
 
 $PERL =
    ($Is_NetWare ? 'perl'   :
diff -Naur perl-5.32.0-orig/t/op/require_errors.t perl-5.32.0/t/op/require_errors.t
--- perl-5.32.0-orig/t/op/require_errors.t	2020-06-15 02:01:25.000000000 +0300
+++ perl-5.32.0/t/op/require_errors.t	2020-07-15 08:48:32.174154200 +0300
@@ -171,7 +171,7 @@
     push @INC, '../lib';
     require Cwd;
     require File::Spec::Functions;
-    if ($^O eq 'cygwin') {
+    if ($^O eq 'cygwin' or $^O eq 'msys') {
         require Win32;
     }
 
@@ -180,7 +180,7 @@
     my $olduid = $>;
     eval { $> = 1; };
     skip "Can't test permissions meaningfully if you're superuser", 2
-        if ($^O eq 'cygwin' ? Win32::IsAdminUser() : $> == 0);
+        if (($^O eq 'cygwin' or $^O eq 'msys') ? Win32::IsAdminUser() : $> == 0);
 
     local @INC = ".";
     eval "use $module";
diff -Naur perl-5.32.0-orig/t/op/sigdispatch.t perl-5.32.0/t/op/sigdispatch.t
--- perl-5.32.0-orig/t/op/sigdispatch.t	2020-06-15 02:01:25.000000000 +0300
+++ perl-5.32.0/t/op/sigdispatch.t	2020-07-15 08:48:32.174154200 +0300
@@ -44,7 +44,7 @@
     skip('We can\'t test blocking without sigprocmask', 17)
 	if is_miniperl() || !$Config{d_sigprocmask};
     skip("This doesn\'t work on $^O threaded builds RT#88814", 17)
-        if ($^O =~ /cygwin/ && $Config{useithreads});
+        if ($^O =~ /cygwin|msys/ && $Config{useithreads});
     skip("This doesn\'t work on $^O version $Config{osvers} RT#88814", 17)
         if ($^O eq "openbsd" && $Config{osvers} < 5.2);
 
@@ -60,7 +60,7 @@
     kill 'SIGUSR1', $$;
     is $gotit, 0, 'Haven\'t received third signal yet';
 
-    diag "2nd sigpending crashes on cygwin" if $^O eq 'cygwin';
+    diag "2nd sigpending crashes on cygwin" if ($^O eq 'cygwin' or $^O eq 'msys');
     is POSIX::sigpending($pending), '0 but true', 'sigpending';
     is $pending->ismember(&POSIX::SIGUSR1), 1, 'SIGUSR1 is pending';
     
@@ -118,7 +118,7 @@
 
 SKIP: {
     skip("alarm cannot interrupt blocking system calls on $^O", 2)
-	if $^O =~ /MSWin32|cygwin|VMS/;
+	if $^O =~ /MSWin32|cygwin|msys|VMS/;
     # RT #88774
     # make sure the signal handler's called in an eval block *before*
     # the eval is popped
diff -Naur perl-5.32.0-orig/t/op/stat.t perl-5.32.0/t/op/stat.t
--- perl-5.32.0-orig/t/op/stat.t	2020-06-15 02:01:25.000000000 +0300
+++ perl-5.32.0/t/op/stat.t	2020-07-15 08:48:32.174154200 +0300
@@ -35,7 +35,7 @@
 $ENV{LANGUAGE} = 'C';		# Ditto in GNU.
 
 my $Is_Amiga   = $^O eq 'amigaos';
-my $Is_Cygwin  = $^O eq 'cygwin';
+my $Is_Cygwin  = ($^O eq 'cygwin' || $^O eq 'msys');
 my $Is_Darwin  = $^O eq 'darwin';
 my $Is_Dos     = $^O eq 'dos';
 my $Is_MSWin32 = $^O eq 'MSWin32';
@@ -127,7 +127,7 @@
     SKIP: {
         skip "No link count", 1 if $Config{dont_use_nlink};
         skip "Cygwin9X fakes hard links by copying", 1
-          if $Config{myuname} =~ /^cygwin_(?:9\d|me)\b/i;
+          if $Config{myuname} =~ /^msys_(?:9\d|me)\b/i;
 
         is($nlink, 2,     'Link count on hard linked file' );
     }
diff -Naur perl-5.32.0-orig/t/op/taint.t perl-5.32.0/t/op/taint.t
--- perl-5.32.0-orig/t/op/taint.t	2020-06-15 02:01:25.000000000 +0300
+++ perl-5.32.0/t/op/taint.t	2020-07-15 08:48:32.189770900 +0300
@@ -46,7 +46,7 @@
 my $Is_MSWin32  = $^O eq 'MSWin32';
 my $Is_NetWare  = $^O eq 'NetWare';
 my $Is_Dos      = $^O eq 'dos';
-my $Is_Cygwin   = $^O eq 'cygwin';
+my $Is_Cygwin   = ($^O eq 'cygwin' || $^O eq 'msys');
 my $Is_OpenBSD  = $^O eq 'openbsd';
 my $Is_MirBSD   = $^O eq 'mirbsd';
 my $Invoke_Perl = $Is_VMS      ? 'MCR Sys$Disk:[]Perl.exe' :
diff -Naur perl-5.32.0-orig/t/op/time.t perl-5.32.0/t/op/time.t
--- perl-5.32.0-orig/t/op/time.t	2020-06-15 02:01:25.000000000 +0300
+++ perl-5.32.0/t/op/time.t	2020-07-15 08:48:32.189770900 +0300
@@ -50,7 +50,7 @@
 SKIP: {
     # This conditional of "No tzset()" is stolen from ext/POSIX/t/time.t
     skip "No tzset()", 1
-        if $^O eq "VMS" || $^O eq "cygwin" ||
+        if $^O eq "VMS" || $^O eq "cygwin" || $^O eq "msys" ||
            $^O eq "djgpp" || $^O eq "MSWin32" || $^O eq "dos" ||
            $^O eq "interix";
 
diff -Naur perl-5.32.0-orig/t/porting/extrefs.t perl-5.32.0/t/porting/extrefs.t
--- perl-5.32.0-orig/t/porting/extrefs.t	2020-06-15 02:01:25.000000000 +0300
+++ perl-5.32.0/t/porting/extrefs.t	2020-07-15 08:48:32.189770900 +0300
@@ -48,7 +48,7 @@
 sub try_compile_and_link {
     my ($c, %args) = @_;
 
-    my $ld_exeext = ($^O eq 'cygwin' || $^O eq 'MSWin32' ||
+    my $ld_exeext = ($^O eq 'cygwin' || $^O eq 'msys' || $^O eq 'MSWin32' ||
                  $^O eq 'os2' && $Config{ldflags} =~ /-Zexe\b/) ? '.exe' :
                 (($^O eq 'vos') ? $Config{exe_ext} : '');
 
diff -Naur perl-5.32.0-orig/t/run/locale.t perl-5.32.0/t/run/locale.t
--- perl-5.32.0-orig/t/run/locale.t	2020-06-15 02:01:25.000000000 +0300
+++ perl-5.32.0/t/run/locale.t	2020-07-15 08:48:32.189770900 +0300
@@ -84,7 +84,7 @@
 
     # Skip this locale on these cygwin versions as the returned radix character
     # length is wrong
-    if (   $^O eq 'cygwin'
+    if (($^O eq 'cygwin' || $^O eq 'msys')
         && version->new(($Config{'osvers'} =~ /^(\d+(?:\.\d+)+)/)[0]) le v2.4.1)
     {
         @test_numeric_locales = grep { $_ !~ m/ps_AF/i } @test_numeric_locales;
diff -Naur perl-5.32.0-orig/t/test.pl perl-5.32.0/t/test.pl
--- perl-5.32.0-orig/t/test.pl	2020-06-15 02:01:25.000000000 +0300
+++ perl-5.32.0/t/test.pl	2020-07-15 08:48:32.189770900 +0300
@@ -629,7 +629,7 @@
 my $is_mswin    = $^O eq 'MSWin32';
 my $is_netware  = $^O eq 'NetWare';
 my $is_vms      = $^O eq 'VMS';
-my $is_cygwin   = $^O eq 'cygwin';
+my $is_cygwin   = ($^O eq 'cygwin' || $^O eq 'msys');
 
 sub _quote_args {
     my ($runperl, $args) = @_;
diff -Naur perl-5.32.0-orig/utils/perlbug.PL perl-5.32.0/utils/perlbug.PL
--- perl-5.32.0-orig/utils/perlbug.PL	2020-06-15 02:01:25.000000000 +0300
+++ perl-5.32.0/utils/perlbug.PL	2020-07-15 08:48:32.205387200 +0300
@@ -727,7 +727,7 @@
     my @env =
         qw(PATH LD_LIBRARY_PATH LANG PERL_BADLANG SHELL HOME LOGDIR LANGUAGE);
     push @env, $Config{ldlibpthname} if $Config{ldlibpthname} ne '';
-    push @env, grep /^(?:PERL|LC_|LANG|CYGWIN)/, keys %ENV;
+    push @env, grep /^(?:PERL|LC_|LANG|MSYS)/, keys %ENV;
     my %env;
     @env{@env} = @env;
     for my $env (sort keys %env) {
diff -Naur perl-5.32.0-orig/win32/FindExt.pm perl-5.32.0/win32/FindExt.pm
--- perl-5.32.0-orig/win32/FindExt.pm	2020-06-15 02:01:25.000000000 +0300
+++ perl-5.32.0/win32/FindExt.pm	2020-07-15 08:48:32.205387200 +0300
@@ -24,7 +24,7 @@
       unless ($config->{i_dbm} || $config->{i_rpcsvcdbm}) && !$config->{d_cplusplus};
     push @no, "Amiga.*" unless $^O eq "amigaos";
     push @no, "VMS.*" unless $^O eq "VMS";
-    push @no, "Win32.*" unless $^O eq "MSWin32" || $^O eq "cygwin";
+    push @no, "Win32.*" unless $^O eq "MSWin32" || $^O eq "cygwin" || $^O eq "msys";
 
     $no = join('|', @no);
     $no = qr/^(?:$no)$/i;
