msys2-runtime-3.6: upgrade to v3.6.1

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
Johannes Schindelin 2025-04-09 20:55:37 +02:00 committed by Christoph Reiter
parent 12d83d0a29
commit b1ce0b5348
47 changed files with 109 additions and 605 deletions

View File

@ -1,4 +1,4 @@
From 90f0b2f7fb7f45e4cb7a9f68d0363238255d8b60 Mon Sep 17 00:00:00 2001
From be88bf581b370c45c96bf14f8286e02c61a4cf45 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B8=CC=86=20=D0=9F?=
=?UTF-8?q?=D0=B0=D0=B2=D0=BB=D0=BE=D0=B2?= <alexey.pawlow@gmail.com>
Date: Sun, 14 Apr 2019 20:40:45 +0300

View File

@ -1,4 +1,4 @@
From 3949c156122acec609e9b14a06081f096d40682a Mon Sep 17 00:00:00 2001
From b00015672a4c3b7054c8d497bd5dfd5c20af97b6 Mon Sep 17 00:00:00 2001
From: Kaleb Barrett <dev.ktbarrett@gmail.com>
Date: Sun, 14 Mar 2021 18:58:55 -0500
Subject: [PATCH 02/N] Fix msys library name in import libraries

View File

@ -1,4 +1,4 @@
From ae1dc7cd646de0e1e258cef787eac0797fb108c8 Mon Sep 17 00:00:00 2001
From c6ac7c6b6e57836b47e1e563660567d0f702de41 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B8=CC=86=20=D0=9F?=
=?UTF-8?q?=D0=B0=D0=B2=D0=BB=D0=BE=D0=B2?= <alexey.pawlow@gmail.com>
Date: Sun, 14 Apr 2019 21:09:17 +0300
@ -223,7 +223,7 @@ index f4c09be..e19b7d3 100644
static int _fmode;
diff --git a/winsup/cygwin/dlfcn.cc b/winsup/cygwin/dlfcn.cc
index fb70524..7367d29 100644
index 10bd0ac..f9c9fe2 100644
--- a/winsup/cygwin/dlfcn.cc
+++ b/winsup/cygwin/dlfcn.cc
@@ -147,8 +147,13 @@ collect_basenames (pathfinder::basenamelist & basenames,
@ -241,10 +241,10 @@ index fb70524..7367d29 100644
/* ... using original basename with new suffix. */
basenames.appendv (basename, baselen, ext, extlen, NULL);
diff --git a/winsup/cygwin/dll_init.cc b/winsup/cygwin/dll_init.cc
index 1a04751..7c5f8cc 100644
index b8f38b5..a62f65a 100644
--- a/winsup/cygwin/dll_init.cc
+++ b/winsup/cygwin/dll_init.cc
@@ -874,7 +874,11 @@ dll_dllcrt0_1 (VOID *x)
@@ -903,7 +903,11 @@ dll_dllcrt0_1 (VOID *x)
}
extern "C" void
@ -277,7 +277,7 @@ index 7303f7e..6ccc19a 100644
w32len = cygheap->installation_key.Length / sizeof (WCHAR);
if (w32len
diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc
index 2e25aa2..dfbb935 100644
index 49fc166..a2a589e 100644
--- a/winsup/cygwin/exceptions.cc
+++ b/winsup/cygwin/exceptions.cc
@@ -526,14 +526,14 @@ int exec_prepared_command (PWCHAR command)
@ -298,10 +298,10 @@ index 2e25aa2..dfbb935 100644
break;
}
diff --git a/winsup/cygwin/fhandler/pipe.cc b/winsup/cygwin/fhandler/pipe.cc
index ac8bbe7..3537180 100644
index e35d523..506dd09 100644
--- a/winsup/cygwin/fhandler/pipe.cc
+++ b/winsup/cygwin/fhandler/pipe.cc
@@ -785,7 +785,11 @@ fhandler_pipe::close (int flag)
@@ -790,7 +790,11 @@ fhandler_pipe::close (int flag)
return ret;
}
@ -314,7 +314,7 @@ index ac8bbe7..3537180 100644
/* Create a pipe, and return handles to the read and write ends,
just like CreatePipe, but ensure that the write end permits
diff --git a/winsup/cygwin/fhandler/pty.cc b/winsup/cygwin/fhandler/pty.cc
index e61a1c8..ebb9dbc 100644
index 3128b92..0969b2f 100644
--- a/winsup/cygwin/fhandler/pty.cc
+++ b/winsup/cygwin/fhandler/pty.cc
@@ -875,7 +875,11 @@ fhandler_pty_slave::open (int flags, mode_t)
@ -341,7 +341,7 @@ index e61a1c8..ebb9dbc 100644
&cygheap->installation_key, get_minor ());
pipe_request req = { GetCurrentProcessId () };
pipe_reply repl;
@@ -2021,7 +2029,11 @@ fhandler_pty_master::close (int flag)
@@ -2024,7 +2032,11 @@ fhandler_pty_master::close (int flag)
pipe_reply repl;
DWORD len;
@ -353,7 +353,7 @@ index e61a1c8..ebb9dbc 100644
&cygheap->installation_key, get_minor ());
acquire_output_mutex (mutex_timeout);
if (master_ctl)
@@ -2927,7 +2939,11 @@ fhandler_pty_master::setup ()
@@ -2930,7 +2942,11 @@ fhandler_pty_master::setup ()
/* Create master control pipe which allows the master to duplicate
the pty pipe handles to processes which deserve it. */
@ -365,7 +365,7 @@ index e61a1c8..ebb9dbc 100644
&cygheap->installation_key, unit);
master_ctl = CreateNamedPipe (buf, PIPE_ACCESS_DUPLEX
| FILE_FLAG_FIRST_PIPE_INSTANCE,
@@ -3816,7 +3832,11 @@ fhandler_pty_slave::transfer_input (tty::xfer_dir dir, HANDLE from, tty *ttyp,
@@ -3819,7 +3835,11 @@ fhandler_pty_slave::transfer_input (tty::xfer_dir dir, HANDLE from, tty *ttyp,
{
char pipe[MAX_PATH];
__small_sprintf (pipe,
@ -436,7 +436,7 @@ index 1e4cf98..b77598b 100644
} \
} \
diff --git a/winsup/cygwin/include/cygwin/version.h b/winsup/cygwin/include/cygwin/version.h
index 0228074..0bd0256 100644
index f4f908f..37122d4 100644
--- a/winsup/cygwin/include/cygwin/version.h
+++ b/winsup/cygwin/include/cygwin/version.h
@@ -510,7 +510,11 @@ details. */

View File

@ -1,4 +1,4 @@
From 894b05ef767c95400be2406c28988e4d06f3e0a8 Mon Sep 17 00:00:00 2001
From 4bb3f5dcfa50bcf955df54d1975cfd3388306946 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B8=CC=86=20=D0=9F?=
=?UTF-8?q?=D0=B0=D0=B2=D0=BB=D0=BE=D0=B2?= <alexey.pawlow@gmail.com>
Date: Sun, 14 Apr 2019 21:17:46 +0300

View File

@ -1,4 +1,4 @@
From 70c8b732241944068aea4a958c42a39337476a0b Mon Sep 17 00:00:00 2001
From 2a7153d171a579324b2fc0c83e491952ed7764b2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B8=CC=86=20=D0=9F?=
=?UTF-8?q?=D0=B0=D0=B2=D0=BB=D0=BE=D0=B2?= <alexey.pawlow@gmail.com>
Date: Sun, 14 Apr 2019 21:29:01 +0300

View File

@ -1,4 +1,4 @@
From 83c84acd7c46696e4ddd5df8ce3f097de85a61d3 Mon Sep 17 00:00:00 2001
From 25add3b86d2346d019e810a732bd05675c12cf19 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B8=CC=86=20=D0=9F?=
=?UTF-8?q?=D0=B0=D0=B2=D0=BB=D0=BE=D0=B2?= <alexey.pawlow@gmail.com>
Date: Sun, 14 Apr 2019 21:45:06 +0300

View File

@ -1,4 +1,4 @@
From aebb0471f35665f3fab4c574c273ac7769cd757a Mon Sep 17 00:00:00 2001
From b127b7469e05d0d974ae0f89626522e01a138443 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B8=CC=86=20=D0=9F?=
=?UTF-8?q?=D0=B0=D0=B2=D0=BB=D0=BE=D0=B2?= <alexey.pawlow@gmail.com>
Date: Sun, 14 Apr 2019 21:47:21 +0300
@ -22,8 +22,8 @@ Co-authored-by: Jeremy Drake <github@jdrake.com>
---
winsup/cygwin/environ.cc | 4 +
winsup/cygwin/globals.cc | 3 +-
winsup/cygwin/path.cc | 268 +++++++++++++++++++++++++++++++++++++++
3 files changed, 274 insertions(+), 1 deletion(-)
winsup/cygwin/path.cc | 250 +++++++++++++++++++++++++++++++++++++++
3 files changed, 256 insertions(+), 1 deletion(-)
diff --git a/winsup/cygwin/environ.cc b/winsup/cygwin/environ.cc
index b9f7e05..5fb3f53 100644
@ -62,7 +62,7 @@ index d8e058f..b7e0e21 100644
bool winjitdebug = false;
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index 0e7ebdf..251c6a6 100644
index 0e7ebdf..d8e456a 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -1722,6 +1722,171 @@ conv_path_list (const char *src, char *dst, size_t size,
@ -237,7 +237,7 @@ index 0e7ebdf..251c6a6 100644
/* Create a symlink from FROMPATH to TOPATH. */
extern "C" int
@@ -2034,6 +2199,102 @@ symlink_wsl (const char *oldpath, path_conv &win32_newpath)
@@ -2034,6 +2199,84 @@ symlink_wsl (const char *oldpath, path_conv &win32_newpath)
return 0;
}
@ -247,25 +247,7 @@ index 0e7ebdf..251c6a6 100644
+ tmp_pathbuf tp;
+ path_conv win32_oldpath;
+
+ /* **BEGIN** replace this with
+ resolve_symlink_target (oldpath, win32_newpath. win32_oldpath);
+ when rebasing over 5a706ff0fceb83fd1fe7f072fc28a741fdde65f2
+ (probably Cygwin 3.6) */
+ /* The symlink target is relative to the directory in which the
+ symlink gets created, not relative to the cwd. Therefore we
+ have to mangle the path quite a bit before calling path_conv.*/
+ if (isabspath (oldpath))
+ win32_oldpath.check (oldpath, PC_SYM_NOFOLLOW, stat_suffixes);
+ else
+ {
+ size_t len = strrchr (win32_newpath.get_posix (), '/')
+ - win32_newpath.get_posix () + 1;
+ char *absoldpath = tp.t_get ();
+ stpcpy (stpncpy (absoldpath, win32_newpath.get_posix (), len),
+ oldpath);
+ win32_oldpath.check (absoldpath, PC_SYM_NOFOLLOW, stat_suffixes);
+ }
+ /* **END** */
+ resolve_symlink_target (oldpath, win32_newpath, win32_oldpath);
+ if (win32_oldpath.error)
+ {
+ set_errno (win32_oldpath.error);
@ -340,7 +322,7 @@ index 0e7ebdf..251c6a6 100644
int
symlink_worker (const char *oldpath, path_conv &win32_newpath, bool isdevice)
{
@@ -2101,6 +2362,13 @@ symlink_worker (const char *oldpath, path_conv &win32_newpath, bool isdevice)
@@ -2101,6 +2344,13 @@ symlink_worker (const char *oldpath, path_conv &win32_newpath, bool isdevice)
case WSYM_nfs:
res = symlink_nfs (oldpath, win32_newpath);
__leave;

View File

@ -1,4 +1,4 @@
From b7e7e107a5c443d11ac51e9a15f40f6a4305feb8 Mon Sep 17 00:00:00 2001
From 07e2ec8f36d080e1f7443b2658d0b17d871a9307 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B8=CC=86=20=D0=9F?=
=?UTF-8?q?=D0=B0=D0=B2=D0=BB=D0=BE=D0=B2?= <alexey.pawlow@gmail.com>
Date: Sun, 14 Apr 2019 21:48:54 +0300

View File

@ -1,4 +1,4 @@
From 511ebb14dc75bf6df92c01633c4b3f5cbf805436 Mon Sep 17 00:00:00 2001
From ccb8cb97309edd55bb8753073a6030bf20a9b643 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B8=CC=86=20=D0=9F?=
=?UTF-8?q?=D0=B0=D0=B2=D0=BB=D0=BE=D0=B2?= <alexey.pawlow@gmail.com>
Date: Sun, 14 Apr 2019 21:50:55 +0300

View File

@ -1,4 +1,4 @@
From 89f33bd736e7403e0be6fd5b8cf66588119bb280 Mon Sep 17 00:00:00 2001
From 712d8de47182b4c4239051a288e0ffbb50a94cfe Mon Sep 17 00:00:00 2001
From: Ray Donnelly <mingw.android@gmail.com>
Date: Sun, 23 Aug 2015 20:47:30 +0100
Subject: [PATCH 10/N] strace.cc: Don't set MSYS=noglob

View File

@ -1,4 +1,4 @@
From 1d4657bed422395ca7eca97e085bb83240fd6fdb Mon Sep 17 00:00:00 2001
From 7d8e6ff67affa66acecb23c58f9b2dc59ac04465 Mon Sep 17 00:00:00 2001
From: Ray Donnelly <mingw.android@gmail.com>
Date: Fri, 21 Aug 2015 09:52:47 +0100
Subject: [PATCH 11/N] Add debugging for strace make_command_line

View File

@ -1,4 +1,4 @@
From 6734616b7bd58c61781c4ff49552c382450fd66f Mon Sep 17 00:00:00 2001
From d1562b1f32ceed1a394b85db238e3644ffcb0af3 Mon Sep 17 00:00:00 2001
From: Johannes Schindelin <johannes.schindelin@gmx.de>
Date: Wed, 17 May 2017 18:13:32 +0200
Subject: [PATCH 12/N] strace --quiet: be *really* quiet

View File

@ -1,4 +1,4 @@
From 307136aa78558218c916a5885058b3843902375a Mon Sep 17 00:00:00 2001
From 5f8a7772a55bc6dc88a09fae49061c7e016a1072 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B8=CC=86=20=D0=9F?=
=?UTF-8?q?=D0=B0=D0=B2=D0=BB=D0=BE=D0=B2?= <alexey.pawlow@gmail.com>
Date: Sun, 14 Apr 2019 22:13:51 +0300
@ -31,7 +31,7 @@ Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 file changed, 7 insertions(+)
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index 251c6a6..7c774ac 100644
index d8e456a..2a578da 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -742,6 +742,12 @@ path_conv::check (const char *src, unsigned opt,

View File

@ -1,4 +1,4 @@
From 17fa933578f78d4dbd8fcfa0fb40e0be058dbe90 Mon Sep 17 00:00:00 2001
From 2da574cb6c2dbb433fb8b85ca1de832c44125b0e Mon Sep 17 00:00:00 2001
From: Johannes Schindelin <johannes.schindelin@gmx.de>
Date: Tue, 8 Nov 2022 16:24:20 +0100
Subject: [PATCH 14/N] When converting to a Unix path, avoid double trailing

View File

@ -1,4 +1,4 @@
From 0bdafc5ae1e26ac45a58313fbc8d3d550a9b3d3d Mon Sep 17 00:00:00 2001
From 7597c2d8d1290a8cb0f581a00c3398ab501a76ac Mon Sep 17 00:00:00 2001
From: Christoph Reiter <reiter.christoph@gmail.com>
Date: Sun, 20 Nov 2022 13:57:36 +0100
Subject: [PATCH 15/N] msys2_path_conv: pass PC_NOFULL to path_conv

View File

@ -1,4 +1,4 @@
From 0de297ae682eff88eb7261d148e9dec0fc265a39 Mon Sep 17 00:00:00 2001
From 3a163addd17bd1bf104ad93b776ea91f994e940d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=EB=A7=88=EB=88=84=EC=97=98?= <nalla@hamal.uberspace.de>
Date: Wed, 17 Jun 2015 09:30:41 +0200
Subject: [PATCH 16/N] path-conversion: Introduce ability to switch off

View File

@ -1,4 +1,4 @@
From b39f7809fb41b50159a717978478e74d96c01819 Mon Sep 17 00:00:00 2001
From fcadb14aa9d5572f926f84ab30d3924aab308265 Mon Sep 17 00:00:00 2001
From: Ray Donnelly <mingw.android@gmail.com>
Date: Fri, 21 Aug 2015 12:52:09 +0100
Subject: [PATCH 17/N] dcrt0.cc: Untangle allow_glob from winshell

View File

@ -1,4 +1,4 @@
From 3f862cd235eaf6b0ee6ae57d078e10851903d29f Mon Sep 17 00:00:00 2001
From bfce9f9c91cf51b921eebae8afa9d3d5f0ce969a Mon Sep 17 00:00:00 2001
From: Ray Donnelly <mingw.android@gmail.com>
Date: Mon, 24 Aug 2015 00:48:06 +0100
Subject: [PATCH 18/N] dcrt0.cc (globify): Don't quote literal strings

View File

@ -1,4 +1,4 @@
From a20605bfeb24937adf52a408ba28b1ef12c81940 Mon Sep 17 00:00:00 2001
From 00b5a1728581028dba41cd8c28bd074ce6c02fa4 Mon Sep 17 00:00:00 2001
From: Ray Donnelly <mingw.android@gmail.com>
Date: Fri, 21 Aug 2015 12:18:52 +0100
Subject: [PATCH 19/N] Add debugging for build_argv

View File

@ -1,4 +1,4 @@
From 36f2f7b8248ba372ab2403ec63d136b7a8b010ed Mon Sep 17 00:00:00 2001
From a92a746c8e7e97b90c87541a0230658814ea45c1 Mon Sep 17 00:00:00 2001
From: Ray Donnelly <mingw.android@gmail.com>
Date: Sun, 10 Apr 2016 21:47:41 +0100
Subject: [PATCH 20/N] environ.cc: New facility/environment variable
@ -129,10 +129,10 @@ index 31080d0..f3bfba0 100644
(See "How to: Set a Thread Name in Native Code"
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index 7c774ac..4f37146 100644
index 2a578da..4a80496 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -4179,7 +4179,6 @@ arg_heuristic_with_exclusions (char const * const arg, char const * exclusions,
@@ -4161,7 +4161,6 @@ arg_heuristic_with_exclusions (char const * const arg, char const * exclusions,
return arg_result;
}

View File

@ -1,4 +1,4 @@
From 2683e34cbf53f18fbe059812586104b82fe2e864 Mon Sep 17 00:00:00 2001
From 20498b634f6adb1e2c969f328c0db97bceb6d577 Mon Sep 17 00:00:00 2001
From: Johannes Schindelin <johannes.schindelin@gmx.de>
Date: Tue, 19 May 2020 13:49:37 +0200
Subject: [PATCH 21/N] Introduce the `enable_pcon` value for `MSYS`

View File

@ -1,4 +1,4 @@
From d3d5d40793839b62faa0bf7e6c9867028ee341a6 Mon Sep 17 00:00:00 2001
From 7abae1df03645827a28007f146d6c7622cc31b2c Mon Sep 17 00:00:00 2001
From: Christoph Reiter <reiter.christoph@gmail.com>
Date: Fri, 5 Jun 2020 20:09:11 +0200
Subject: [PATCH 22/N] popen: call /usr/bin/sh instead of /bin/sh

View File

@ -1,4 +1,4 @@
From 54d547e06db952f37f225eff820950c017f8c5d8 Mon Sep 17 00:00:00 2001
From 438abeec95d9bd63d384d7097379a2d54326ad6e Mon Sep 17 00:00:00 2001
From: Johannes Schindelin <johannes.schindelin@gmx.de>
Date: Wed, 12 Aug 2020 12:22:38 +0200
Subject: [PATCH 23/N] Expose full command-lines to other Win32 processes by

View File

@ -1,4 +1,4 @@
From b57f22d8180e9ae283dafce96436f0c1281dbcc7 Mon Sep 17 00:00:00 2001
From feff0f074eeb2c886fdfcf80b40c655e231af599 Mon Sep 17 00:00:00 2001
From: Johannes Schindelin <johannes.schindelin@gmx.de>
Date: Mon, 16 Apr 2018 14:59:39 +0200
Subject: [PATCH 24/N] Add a helper to obtain a function's address in

View File

@ -1,4 +1,4 @@
From 0a2973f80ac9a82fa84aa92679c90f53d9189257 Mon Sep 17 00:00:00 2001
From c28861b52ac561cedf2df05f903be2833a71b8a3 Mon Sep 17 00:00:00 2001
From: Johannes Schindelin <johannes.schindelin@gmx.de>
Date: Fri, 20 Mar 2015 09:56:28 +0000
Subject: [PATCH 25/N] Emulate GenerateConsoleCtrlEvent() upon Ctrl+C
@ -93,7 +93,7 @@ Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
create mode 100644 winsup/cygwin/include/cygwin/exit_process.h
diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc
index dfbb935..493b32c 100644
index a2a589e..f7c6188 100644
--- a/winsup/cygwin/exceptions.cc
+++ b/winsup/cygwin/exceptions.cc
@@ -29,6 +29,7 @@ details. */

View File

@ -1,4 +1,4 @@
From ff9481f0011b19c07f2ec2196c7c61b1087405ca Mon Sep 17 00:00:00 2001
From e6b56515f3bb24497be033225e118497fb2e65a7 Mon Sep 17 00:00:00 2001
From: Johannes Schindelin <johannes.schindelin@gmx.de>
Date: Fri, 20 Mar 2015 10:01:50 +0000
Subject: [PATCH 26/N] kill: kill Win32 processes more gently

View File

@ -1,4 +1,4 @@
From 420c77320b59faa88150743ac127fe14c32e2c89 Mon Sep 17 00:00:00 2001
From 8efa86c46c02b0b56c0e9f217cf2c3ff611af5e5 Mon Sep 17 00:00:00 2001
From: Jeremy Drake <github@jdrake.com>
Date: Thu, 22 Jul 2021 11:59:16 -0700
Subject: [PATCH 27/N] Cygwin: make option for native inner link handling.
@ -37,10 +37,10 @@ index 79f9476..30a2da1 100644
/* Taken from BSD libc:
This variable is zero until a process has created a pthread. It is used
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index 4f37146..56ac7d7 100644
index 4a80496..b5408e9 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -3850,8 +3850,9 @@ restart:
@@ -3832,8 +3832,9 @@ restart:
differ, return the final path as symlink content and set symlen
to a negative value. This forces path_conv::check to restart
symlink evaluation with the new path. */

View File

@ -1,4 +1,4 @@
From 3138f4fe773bcfea69c63072e059552bc8edc6a8 Mon Sep 17 00:00:00 2001
From 4e9b4bc884003fd5d7500b016c8729c4aa7e7cdd Mon Sep 17 00:00:00 2001
From: Johannes Schindelin <johannes.schindelin@gmx.de>
Date: Mon, 8 Nov 2021 14:20:07 +0100
Subject: [PATCH 28/N] docs: skip building texinfo and PDF files

View File

@ -1,4 +1,4 @@
From b77f8e106576c9ea48e7e894c3b8d060bf5c0a0c Mon Sep 17 00:00:00 2001
From 6b4aeb4cb51b433dfa759b4cef533ce81d2db9b8 Mon Sep 17 00:00:00 2001
From: Johannes Schindelin <johannes.schindelin@gmx.de>
Date: Mon, 8 Nov 2021 16:22:57 +0100
Subject: [PATCH 29/N] install-libs: depend on the "toollibs"

View File

@ -1,4 +1,4 @@
From a2fdc961b5750527f19eaf00d44393f152353281 Mon Sep 17 00:00:00 2001
From be8dc8973b50c6212191d85e1c66a2a2b393694f Mon Sep 17 00:00:00 2001
From: Johannes Schindelin <johannes.schindelin@gmx.de>
Date: Mon, 23 Nov 2015 20:03:11 +0100
Subject: [PATCH 30/N] POSIX-ify the SHELL variable

View File

@ -1,4 +1,4 @@
From 752e8d1be346b98b621e4ad0897ac4147c1864bb Mon Sep 17 00:00:00 2001
From e3f9d90c4f7bfd587075cc1ad05b1e2ebfaaff2b Mon Sep 17 00:00:00 2001
From: Johannes Schindelin <johannes.schindelin@gmx.de>
Date: Tue, 21 Mar 2017 13:18:38 +0100
Subject: [PATCH 31/N] Handle ORIGINAL_PATH just like PATH

View File

@ -1,4 +1,4 @@
From 2dcb6b50d5e258f317f7a6fefc078e1b5cac82bc Mon Sep 17 00:00:00 2001
From 204680f5f394f892c87136e1e578be68321b0231 Mon Sep 17 00:00:00 2001
From: Christoph Reiter <reiter.christoph@gmail.com>
Date: Sun, 3 Jul 2022 22:39:32 +0200
Subject: [PATCH 32/N] uname: allow setting the system name to CYGWIN

View File

@ -1,4 +1,4 @@
From 63978038683fea97e18e44ed395864700a93ba5c Mon Sep 17 00:00:00 2001
From 781d347b6eeedd24a7b25c5c1d9dc1e63537e2c7 Mon Sep 17 00:00:00 2001
From: Johannes Schindelin <johannes.schindelin@gmx.de>
Date: Wed, 18 Feb 2015 12:32:17 +0000
Subject: [PATCH 33/N] Pass environment variables with empty values

View File

@ -1,4 +1,4 @@
From 59b636bcf05839fc2bfd05b0ef3a2911e15b8336 Mon Sep 17 00:00:00 2001
From 6ec7eb50cda818f3685ec07aa12c4331a956f84a Mon Sep 17 00:00:00 2001
From: Johannes Schindelin <johannes.schindelin@gmx.de>
Date: Tue, 6 Sep 2022 10:40:58 +0200
Subject: [PATCH 34/N] Optionally disallow empty environment values again

View File

@ -1,4 +1,4 @@
From b49fbaa49bf0b2aa18288a217b1a1dc282d61b0a Mon Sep 17 00:00:00 2001
From 83048adb495e12db4b25b1b2e0c50a911bec4539 Mon Sep 17 00:00:00 2001
From: Johannes Schindelin <johannes.schindelin@gmx.de>
Date: Tue, 6 Sep 2022 12:18:18 +0200
Subject: [PATCH 35/N] build_env(): respect the `MSYS` environment variable

View File

@ -1,4 +1,4 @@
From 3780b76e2e91f9204ce5d86b161ec7edb1cbfbee Mon Sep 17 00:00:00 2001
From deda40b45c6b487de427105ba1189b38aee15d78 Mon Sep 17 00:00:00 2001
From: Christoph Reiter <reiter.christoph@gmail.com>
Date: Sat, 17 Dec 2022 20:14:49 +0100
Subject: [PATCH 36/N] Revert "Cygwin: Enable dynamicbase on the Cygwin DLL by

View File

@ -1,4 +1,4 @@
From 436cc3c7464fe7816256d751c17a5eade2c0dc10 Mon Sep 17 00:00:00 2001
From 475686c94f04447b8c68557959f020a60b9c85b8 Mon Sep 17 00:00:00 2001
From: Johannes Schindelin <johannes.schindelin@gmx.de>
Date: Mon, 30 Jan 2023 23:22:22 +0100
Subject: [PATCH 37/N] Avoid sharing cygheaps across Cygwin versions

View File

@ -1,4 +1,4 @@
From a69861d558e69e1baf3e9595fdb6c5c62f3ede15 Mon Sep 17 00:00:00 2001
From d9aed4866c311df830a8548517ec3840c745a9e0 Mon Sep 17 00:00:00 2001
From: Johannes Schindelin <johannes.schindelin@gmx.de>
Date: Tue, 21 Feb 2023 16:36:36 +0100
Subject: [PATCH 38/N] uname: report msys2-runtime commit hash, too

View File

@ -1,7 +1,7 @@
From a93713138e516888cbb2cb012e186a4607fc33c5 Mon Sep 17 00:00:00 2001
From b8fee45a4610af697beb1a0f7c27ab81d28ef2c6 Mon Sep 17 00:00:00 2001
From: Johannes Schindelin <johannes.schindelin@gmx.de>
Date: Mon, 22 May 2023 13:36:27 +0200
Subject: [PATCH 40/N] Cygwin: Adjust CWD magic to accommodate for the latest
Subject: [PATCH 39/N] Cygwin: Adjust CWD magic to accommodate for the latest
Windows previews
Reportedly a very recent internal build of Windows 11 once again changed

View File

@ -1,42 +0,0 @@
From d81c67a3f389371f89324bbe903310a59135cbdf Mon Sep 17 00:00:00 2001
From: Jeremy Drake <github@jdrake.com>
Date: Fri, 21 Feb 2025 13:08:50 -0800
Subject: [PATCH 39/N] fixup! Instead of creating Cygwin symlinks, use deep
copy by default
Signed-off-by: Jeremy Drake <github@jdrake.com>
---
winsup/cygwin/path.cc | 20 +-------------------
1 file changed, 1 insertion(+), 19 deletions(-)
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index 56ac7d7..b5408e9 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -2212,25 +2212,7 @@ symlink_deepcopy (const char *oldpath, path_conv &win32_newpath)
tmp_pathbuf tp;
path_conv win32_oldpath;
- /* **BEGIN** replace this with
- resolve_symlink_target (oldpath, win32_newpath. win32_oldpath);
- when rebasing over 5a706ff0fceb83fd1fe7f072fc28a741fdde65f2
- (probably Cygwin 3.6) */
- /* The symlink target is relative to the directory in which the
- symlink gets created, not relative to the cwd. Therefore we
- have to mangle the path quite a bit before calling path_conv.*/
- if (isabspath (oldpath))
- win32_oldpath.check (oldpath, PC_SYM_NOFOLLOW, stat_suffixes);
- else
- {
- size_t len = strrchr (win32_newpath.get_posix (), '/')
- - win32_newpath.get_posix () + 1;
- char *absoldpath = tp.t_get ();
- stpcpy (stpncpy (absoldpath, win32_newpath.get_posix (), len),
- oldpath);
- win32_oldpath.check (absoldpath, PC_SYM_NOFOLLOW, stat_suffixes);
- }
- /* **END** */
+ resolve_symlink_target (oldpath, win32_newpath, win32_oldpath);
if (win32_oldpath.error)
{
set_errno (win32_oldpath.error);

View File

@ -1,180 +0,0 @@
From c1770e171505eb674626c2b7abf3403e6b4b7b79 Mon Sep 17 00:00:00 2001
From: Takashi Yano <takashi.yano@nifty.ne.jp>
Date: Fri, 21 Mar 2025 13:58:23 +0900
Subject: [PATCH 41/N] Cygwin: console: tty::restore really restores the
previous mode
Previously, tty::restore sets the console mode to a predetermined
console mode that is widely common for many non-cygwin console apps.
So, if a non-cygwin app that is started from cygwin process changes
the console mode and executes cygwin sub-process, the console mode
is changed to the predetermined mode rather than being restored the
original mode that is set by the non-cygwin app.
With this patch, the console mode is stored when a cygwin process is
started from non-cygwin app, then tty::restore restores the previous
console mode that is used by the previous non-cygwin app when the
cygwin app exits.
Addresses: https://github.com/msys2/msys2-runtime/issues/268
Fixes: 3312f2d21f13 ("Cygwin: console: Redesign mode set strategy on close().")
Reported-by: Eu Pin Tien, Jeremy Drake <cygwin@jdrake.com>
Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
Signed-off-by: Eu-Pin Tien <eu-pin.tien@diamond.ac.uk>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
winsup/cygwin/fhandler/console.cc | 49 ++++++++++++-------------
winsup/cygwin/local_includes/fhandler.h | 4 +-
winsup/cygwin/release/3.6.1 | 5 +++
3 files changed, 32 insertions(+), 26 deletions(-)
create mode 100644 winsup/cygwin/release/3.6.1
diff --git a/winsup/cygwin/fhandler/console.cc b/winsup/cygwin/fhandler/console.cc
index da335b3..f162698 100644
--- a/winsup/cygwin/fhandler/console.cc
+++ b/winsup/cygwin/fhandler/console.cc
@@ -804,6 +804,9 @@ fhandler_console::rabuflen ()
return con_ra.rabuflen;
}
+static DWORD prev_input_mode_backup;
+static DWORD prev_output_mode_backup;
+
/* The function set_{in,out}put_mode() should be static so that they
can be called even after the fhandler_console instance is deleted. */
void
@@ -818,11 +821,11 @@ fhandler_console::set_input_mode (tty::cons_mode m, const termios *t,
GetConsoleMode (p->input_handle, &oflags);
DWORD flags = oflags
& (ENABLE_EXTENDED_FLAGS | ENABLE_INSERT_MODE | ENABLE_QUICK_EDIT_MODE);
- con.curr_input_mode = m;
switch (m)
{
case tty::restore:
- flags |= ENABLE_ECHO_INPUT | ENABLE_LINE_INPUT | ENABLE_PROCESSED_INPUT;
+ flags = con.prev_input_mode;
+ con.prev_input_mode = prev_input_mode_backup;
break;
case tty::cygwin:
flags |= ENABLE_WINDOW_INPUT;
@@ -846,6 +849,12 @@ fhandler_console::set_input_mode (tty::cons_mode m, const termios *t,
flags |= ENABLE_PROCESSED_INPUT;
break;
}
+ if (con.curr_input_mode != tty::cygwin && m == tty::cygwin)
+ {
+ prev_input_mode_backup = con.prev_input_mode;
+ con.prev_input_mode = oflags;
+ }
+ con.curr_input_mode = m;
SetConsoleMode (p->input_handle, flags);
if (!(oflags & ENABLE_VIRTUAL_TERMINAL_INPUT)
&& (flags & ENABLE_VIRTUAL_TERMINAL_INPUT)
@@ -868,10 +877,11 @@ fhandler_console::set_output_mode (tty::cons_mode m, const termios *t,
if (con.orig_virtual_terminal_processing_mode)
flags |= ENABLE_VIRTUAL_TERMINAL_PROCESSING;
WaitForSingleObject (p->output_mutex, mutex_timeout);
- con.curr_output_mode = m;
switch (m)
{
case tty::restore:
+ flags = con.prev_output_mode;
+ con.prev_output_mode = prev_output_mode_backup;
break;
case tty::cygwin:
if (wincap.has_con_24bit_colors () && !con_is_legacy)
@@ -883,6 +893,12 @@ fhandler_console::set_output_mode (tty::cons_mode m, const termios *t,
flags |= DISABLE_NEWLINE_AUTO_RETURN;
break;
}
+ if (con.curr_output_mode != tty::cygwin && m == tty::cygwin)
+ {
+ prev_output_mode_backup = con.prev_output_mode;
+ GetConsoleMode (p->output_handle, &con.prev_output_mode);
+ }
+ con.curr_output_mode = m;
acquire_attach_mutex (mutex_timeout);
DWORD resume_pid = attach_console (con.owner);
SetConsoleMode (p->output_handle, flags);
@@ -916,7 +932,7 @@ fhandler_console::cleanup_for_non_cygwin_app (handle_set_t *p)
/* Cleaning-up console mode for non-cygwin app. */
/* conmode can be tty::restore when non-cygwin app is
exec'ed from login shell. */
- tty::cons_mode conmode = cons_mode_on_close (p);
+ tty::cons_mode conmode = cons_mode_on_close ();
set_output_mode (conmode, ti, p);
set_input_mode (conmode, ti, p);
set_disable_master_thread (con.owner == GetCurrentProcessId ());
@@ -1978,9 +1994,8 @@ fhandler_console::close (int flag)
if (shared_console_info[unit] && myself->ppid == 1
&& (dev_t) myself->ctty == get_device ())
{
- tty::cons_mode conmode = cons_mode_on_close (&handle_set);
- set_output_mode (conmode, &get_ttyp ()->ti, &handle_set);
- set_input_mode (conmode, &get_ttyp ()->ti, &handle_set);
+ set_output_mode (tty::restore, &get_ttyp ()->ti, &handle_set);
+ set_input_mode (tty::restore, &get_ttyp ()->ti, &handle_set);
set_disable_master_thread (true, this);
}
@@ -4687,26 +4702,10 @@ fhandler_console::fstat (struct stat *st)
}
tty::cons_mode
-fhandler_console::cons_mode_on_close (handle_set_t *p)
+fhandler_console::cons_mode_on_close ()
{
- const _minor_t unit = p->unit;
-
if (myself->ppid != 1) /* Execed from normal cygwin process. */
return tty::cygwin;
- if (!process_alive (con.owner)) /* The Master process already died. */
- return tty::restore;
- if (con.owner == GetCurrentProcessId ()) /* Master process */
- return tty::restore;
-
- PROCESS_BASIC_INFORMATION pbi;
- NTSTATUS status =
- NtQueryInformationProcess (GetCurrentProcess (), ProcessBasicInformation,
- &pbi, sizeof (pbi), NULL);
- if (NT_SUCCESS (status)
- && con.owner == (DWORD) pbi.InheritedFromUniqueProcessId)
- /* The parent is the stub process. */
- return tty::restore;
-
- return tty::native; /* Otherwise */
+ return tty::restore; /* otherwise, restore */
}
diff --git a/winsup/cygwin/local_includes/fhandler.h b/winsup/cygwin/local_includes/fhandler.h
index b00a1a1..8c71d84 100644
--- a/winsup/cygwin/local_includes/fhandler.h
+++ b/winsup/cygwin/local_includes/fhandler.h
@@ -2146,6 +2146,8 @@ class dev_console
bool disable_master_thread;
tty::cons_mode curr_input_mode;
tty::cons_mode curr_output_mode;
+ DWORD prev_input_mode;
+ DWORD prev_output_mode;
bool master_thread_suspended;
int num_processed; /* Number of input events in the current input buffer
already processed by cons_master_thread(). */
@@ -2366,7 +2368,7 @@ private:
void setup_pcon_hand_over ();
static void pcon_hand_over_proc ();
- static tty::cons_mode cons_mode_on_close (handle_set_t *);
+ static tty::cons_mode cons_mode_on_close ();
friend tty_min * tty_list::get_cttyp ();
};
diff --git a/winsup/cygwin/release/3.6.1 b/winsup/cygwin/release/3.6.1
new file mode 100644
index 0000000..0b54b5f
--- /dev/null
+++ b/winsup/cygwin/release/3.6.1
@@ -0,0 +1,5 @@
+Fixes:
+------
+
+- Console mode is really restored to the previous mode.
+ Addresses: https://github.com/msys2/msys2-runtime/issues/268

View File

@ -1,45 +0,0 @@
From 40a66dcf272eff407794bb94616d5b8ba833fafa Mon Sep 17 00:00:00 2001
From: Johannes Schindelin <johannes.schindelin@gmx.de>
Date: Thu, 27 Mar 2025 12:18:45 +0100
Subject: [PATCH 42/N] Cygwin: pipe: Fix hang due to inadvertent 0-length
raw_write()
It is possible for `NtQueryInformationFile()` to report a 0-length
`InboundQuota` when obtaining `FilePipeLocalInformation`. This seems to
be the case e.g. when a pipe was created on the other side and its quota
information is not available on the client side.
This can lead to a situation where the `avail` variable is set to 0, and
since that is used to cap the number of bytes to send, a 0-length write.
Which hangs forever.
This was observed in the MSYS2 project when building GIMP, and reduced
to a simple test case where a MINGW `ninja.exe` tries to call an MSYS
`bison.exe` and the error message (saying that `bison` wants to have
some input) is not even shown.
Since the minimal pipe buffer size is 4k, let's ensure that it is at
least that, even when `InboundQuota` reports 0.
This fixes https://github.com/msys2/msys2-runtime/issues/270
Fixes: cbfaeba4f7 (Cygwin: pipe: Fix incorrect write length in raw_write())
Helped-by: Corinna Vinschen <corinna@vinschen.de>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
winsup/cygwin/fhandler/pipe.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/winsup/cygwin/fhandler/pipe.cc b/winsup/cygwin/fhandler/pipe.cc
index 3537180..92fc09d 100644
--- a/winsup/cygwin/fhandler/pipe.cc
+++ b/winsup/cygwin/fhandler/pipe.cc
@@ -1158,7 +1158,7 @@ fhandler_pipe::set_pipe_buf_size ()
status = NtQueryInformationFile (get_handle (), &io, &fpli, sizeof fpli,
FilePipeLocalInformation);
if (NT_SUCCESS (status))
- pipe_buf_size = fpli.InboundQuota;
+ pipe_buf_size = fpli.InboundQuota < PIPE_BUF ? PIPE_BUF : fpli.InboundQuota;
}
int

View File

@ -1,49 +0,0 @@
From b9d1047a76b15fccc7109d095b256e47a5add814 Mon Sep 17 00:00:00 2001
From: Johannes Schindelin <johannes.schindelin@gmx.de>
Date: Mon, 31 Mar 2025 08:30:15 +0200
Subject: [PATCH 43/N] Cygwin: signal: Clear direction flag in sigdeleyed
x86_64 ABI requires the direction flag in CPU flags register cleared.
https://learn.microsoft.com/en-us/cpp/build/x64-software-conventions
However, currently that flag is not maintained in signal handler.
Therefore, if the signal handler is called when that flag is set, it
destroys the data and may crash if rep instruction is used in the
signal handler. With this patch, the direction flag is cleared in
sigdelayed() by adding cld instruction.
Backported-from: d71aeccff4 (Cygwin: signal: Clear direction flag in sigdeleyed, 2025-03-24)
Addresses: https://cygwin.com/pipermail/cygwin/2025-March/257704.html
Fixes: 1fd5e000ace5 ("import winsup-2000-02-17 snapshot")
Reported-by: Christian Franke <Christian.Franke@t-online.de>
Reviewed-by: Corinna Vischen <corinna@vinschen.de>
Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
(cherry picked from commit 9f4cec47df66a913256912c358afe5e597dec25c)
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
winsup/cygwin/release/3.6.1 | 3 +++
winsup/cygwin/scripts/gendef | 1 +
2 files changed, 4 insertions(+)
diff --git a/winsup/cygwin/release/3.6.1 b/winsup/cygwin/release/3.6.1
index 0b54b5f..0b05f45 100644
--- a/winsup/cygwin/release/3.6.1
+++ b/winsup/cygwin/release/3.6.1
@@ -3,3 +3,6 @@ Fixes:
- Console mode is really restored to the previous mode.
Addresses: https://github.com/msys2/msys2-runtime/issues/268
+
+- Clear direction flag in sigdeleyed before calling signal handler.
+ Addresses: https://cygwin.com/pipermail/cygwin/2025-March/257704.html
diff --git a/winsup/cygwin/scripts/gendef b/winsup/cygwin/scripts/gendef
index a2f0392..861a240 100755
--- a/winsup/cygwin/scripts/gendef
+++ b/winsup/cygwin/scripts/gendef
@@ -179,6 +179,7 @@ sigdelayed:
movq %rsp,%rbp
pushf
.seh_pushreg %rax # fake, there's no .seh_pushreg for the flags
+ cld # x86_64 ABI requires direction flag cleared
# stack is aligned or unaligned on entry!
# make sure it is aligned from here on
# We could be called from an interrupted thread which doesn't know

View File

@ -1,64 +0,0 @@
From 2a96713a9fe7327567b86811f414d50b6d10d832 Mon Sep 17 00:00:00 2001
From: Johannes Schindelin <johannes.schindelin@gmx.de>
Date: Mon, 31 Mar 2025 08:31:53 +0200
Subject: [PATCH 44/N] Cygwin: signal: Copy context to alternate stack in the
SA_ONSTACK case
After the commit 0210c77311ae, the context passed to signal handler
cannot be accessed from the signal handler that uses alternate stack.
This is because the context locally copied is on the stack that is
different area from the signal handler uses. With this patch, copy
the context to alternate signal stack area to avoid this situation.
Backported-from: 7f67575711 (Cygwin: signal: Copy context to alternate stack in the SA_ONSTACK case, 2025-03-25)
Addresses: https://cygwin.com/pipermail/cygwin/2025-March/257714.html
Fixes: 0210c77311ae ("Cygwin: signal: Use context locally copied in call_signal_handler()")
Reported-by: Bruno Haible <bruno@clisp.org>
Reviewed-by: Corinna Vischen <corinna@vinschen.de>
Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
(cherry picked from commit 0d0e76b99025704d8ee44a44b19a23af9aafe297)
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
winsup/cygwin/exceptions.cc | 8 ++++++++
winsup/cygwin/release/3.6.1 | 5 +++++
2 files changed, 13 insertions(+)
diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc
index 493b32c..e9bc6d9 100644
--- a/winsup/cygwin/exceptions.cc
+++ b/winsup/cygwin/exceptions.cc
@@ -1807,6 +1807,13 @@ _cygtls::call_signal_handler ()
to 16 byte. */
uintptr_t new_sp = ((uintptr_t) _my_tls.altstack.ss_sp
+ _my_tls.altstack.ss_size) & ~0xf;
+ /* Copy context1 to the alternate signal stack area, because the
+ context1 allocated in the normal stack area is not accessible
+ from the signal handler that uses alternate signal stack. */
+ thiscontext = (ucontext_t *) ((new_sp - sizeof (ucontext_t)) & ~0xf);
+ memcpy (thiscontext, &context1, sizeof (ucontext_t));
+ new_sp = (uintptr_t) thiscontext;
+
/* In assembler: Save regs on new stack, move to alternate stack,
call thisfunc, revert stack regs. */
#ifdef __x86_64__
@@ -1850,6 +1857,7 @@ _cygtls::call_signal_handler ()
#else
#error unimplemented for this target
#endif
+ memcpy (&context1, thiscontext, sizeof (ucontext_t));
}
else
/* No alternate signal stack requested or available, just call
diff --git a/winsup/cygwin/release/3.6.1 b/winsup/cygwin/release/3.6.1
index 0b05f45..50db0b8 100644
--- a/winsup/cygwin/release/3.6.1
+++ b/winsup/cygwin/release/3.6.1
@@ -6,3 +6,8 @@ Fixes:
- Clear direction flag in sigdeleyed before calling signal handler.
Addresses: https://cygwin.com/pipermail/cygwin/2025-March/257704.html
+
+- Copy context to alternate signal stack area in call_signal_handler()
+ in the SA_ONSTACK case, because locally-copied context on the normal
+ stack area is not accessible from the signal handler.
+ Addresses: https://cygwin.com/pipermail/cygwin/2025-March/257714.html

View File

@ -1,80 +0,0 @@
From b021edcbcaa648b7409bedb0faee806eb46f3c81 Mon Sep 17 00:00:00 2001
From: Takashi Yano <takashi.yano@nifty.ne.jp>
Date: Thu, 3 Apr 2025 15:22:29 +0900
Subject: [PATCH 45/N] Cygwin: fork: Call pthread::atforkchild () after other
initializations
Previously, the callback registered by pthread_atfork() was called
in pthread::atforkchild() before _my_tls.fixup_after_fork(). This
caused misbehaviour if the callback used TLS-related functions.
More specifically, cygwait() for a mutex at the beginning of
fhandler_fifo_pipe::raw_write() failed because the event handle
_my_tls.signal_arrived, which is used in cygwait() internally and
designed to be initialized in _cygtls::fixup_after_fork(), was not
yet initialized at that point. Due to this problem, subprocesses
of CMake (versions >= 3.29.x) sometimes failed after the commit
7ed9adb356df ("Cygwin: pipe: Switch pipe mode to blocking mode by
default, 2024-09-05"). This commit triggered the issue because it
introduced cygwait() for the mutex in fhandler_fifo_pipe::raw_write().
This patch moves the pthread::atforkchild() at the end of the fork::
child(), i.e. after all initializations for child process is finished.
The reason why the issue happens not always but sometimes:
The event handle signal_arrived was never properly initialized when
fhandler_fifo_pipe::raw_write() was called from the callback. As a
result, its value was merely copied from the parent process during
a fork() operation. Since the event signal_arrived was not created
as inheritable, the handle value was fundamentally invalid. Despite
this, the issue only occurred occasionally. This inconsistency was
due to the handle value often coinciding with other existing handles
because of its small value, such as 0x1ac. As evidence of this, in
many cases where the issue did not manifest, the signal_arrived
handle was not even an event handle.
Addresses: https://cygwin.com/pipermail/cygwin/2025-March/257800.html
Addresses: https://github.com/msys2/msys2-runtime/issues/272
Fixes: f02b22dcee17 ("* fork.cc (frok::child): Change order of cleanup prior to return.")
Reported-by: Christoph Reiter <reiter.christoph@gmail.com>
Reviewed-by: Jeremy Drake <cygwin@jdrake.com>
Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
(cherry picked from commit 779e46b5b3ee8d0250f084d1cf2d68c0483a521e)
---
winsup/cygwin/fork.cc | 2 +-
winsup/cygwin/release/3.6.1 | 5 +++++
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/winsup/cygwin/fork.cc b/winsup/cygwin/fork.cc
index 783971b..f88acdb 100644
--- a/winsup/cygwin/fork.cc
+++ b/winsup/cygwin/fork.cc
@@ -187,7 +187,6 @@ frok::child (volatile char * volatile here)
ForceCloseHandle1 (fork_info->forker_finished, forker_finished);
- pthread::atforkchild ();
cygbench ("fork-child");
ld_preload ();
fixup_hooks_after_fork ();
@@ -199,6 +198,7 @@ frok::child (volatile char * volatile here)
CloseHandle (hParent);
hParent = NULL;
cygwin_finished_initializing = true;
+ pthread::atforkchild ();
return 0;
}
diff --git a/winsup/cygwin/release/3.6.1 b/winsup/cygwin/release/3.6.1
index 50db0b8..360599d 100644
--- a/winsup/cygwin/release/3.6.1
+++ b/winsup/cygwin/release/3.6.1
@@ -11,3 +11,8 @@ Fixes:
in the SA_ONSTACK case, because locally-copied context on the normal
stack area is not accessible from the signal handler.
Addresses: https://cygwin.com/pipermail/cygwin/2025-March/257714.html
+
+- Move pthread::atforkchild() at the end of fork::child(). This fixes
+ subprocess failure in cmake (>= 3.29.x).
+ Addresses: https://cygwin.com/pipermail/cygwin/2025-March/257800.html
+ Addresses: https://github.com/msys2/msys2-runtime/issues/272

View File

@ -3,8 +3,8 @@
pkgbase=msys2-runtime-3.6
pkgname=('msys2-runtime-3.6' 'msys2-runtime-3.6-devel')
pkgver=3.6.0
pkgrel=6
pkgver=3.6.1
pkgrel=1
pkgdesc="Cygwin POSIX emulation engine"
arch=('x86_64')
url="https://www.cygwin.com/"
@ -68,60 +68,48 @@ source=('msys2-runtime'::git://sourceware.org/git/newlib-cygwin.git#tag=cygwin-$
0036-Revert-Cygwin-Enable-dynamicbase-on-the-Cygwin-DLL-b.patch
0037-Avoid-sharing-cygheaps-across-Cygwin-versions.patch
0038-uname-report-msys2-runtime-commit-hash-too.patch
0039-fixup-Instead-of-creating-Cygwin-symlinks-use-deep-c.patch
0040-Cygwin-Adjust-CWD-magic-to-accommodate-for-the-lates.patch
0041-Cygwin-console-tty-restore-really-restores-the-previ.patch
0042-Cygwin-pipe-Fix-hang-due-to-inadvertent-0-length-raw.patch
0043-Cygwin-signal-Clear-direction-flag-in-sigdeleyed.patch
0044-Cygwin-signal-Copy-context-to-alternate-stack-in-the.patch
0045-Cygwin-fork-Call-pthread-atforkchild-after-other-ini.patch)
sha256sums=('89d856fbf9f8d753a644651f95ccd769a43135d93b1bc322582f6fb87ebf4cea'
'7d9097b654971f178ede10aa436e4419461dc17176787671db27151fe1ad9300'
'5945b95c6b3caf18cc8356802e9af1770746a76c27d0931b897d48d072603fcf'
'8f2def0add5397487e2470fd7219bd80233e4d43e9f78d92d042907fede0570a'
'0cebee2ed462579029512e46e4bd3c7bddd4d92823ef69803a938007c66d2843'
'713adc344ee3c08831c658e27ef137efd65860416621cf6e76a94b2559c9e6c9'
'89ac72ab4dcb0191b998597fb0c06c1f1ccc5b53a1a7b68f963deca6bbfe29bb'
'2d77422697b212c0815927aa5470bf0d7d410e9fc8297890f203563aa448044e'
'ab64b84b9d28322bf1d6cebd54d60fca1b6283024fb43bff9ca623d7d83e3f87'
'90c14ad139f0bdfe9c03fd41460066895bc651e8190502ac33c25803efc8eaf4'
'5f783ecb179e38ae8500bb47972b08dd1658db8aeb71f2b35c85ee0432fed22c'
'67630db2bfb41b823079957c36c8d3f9fdc5456facd89e16790098e8afad59b3'
'dd04c52b0a4b59068e7bef0a5ef9b5bcf7f4c01eff06928ad5d489da69746206'
'b7cc9389e5aa92eefe3877641c604bcfa3cc333d7957cfb3c4d68400ab869927'
'adccafe2e1c5f32c36542a9ad78cb668f330c2e67ddeeef34c7eaf04d01bf06b'
'aec979057d38cb7ef3e0858663583515b7cfa94e7155e6deb6d32bb15d5b86e5'
'f2fe79f9067ea97752a2e7916cbab4830f07be16310d6dbbdaf897cf58dd7d5b'
'14e693ff6b927e629adf601f4d3ce238734f3f0495f1e92ab9ac620b71336aa7'
'612a914ab83b126c4ceaa1855db504a73f2efd2a7b404983b01b0087a1bb279b'
'12dafc8b6181b62853faf99904bf92f20528d645ce6e4134287968a6a6617fd7'
'85bd430a310cfd70e6a0943adacd3931cd82e6efa096c2daaf7c017ed7d09e5f'
'729b0ed836b96f198d8a13a41539a56f53f50b76d47bd65e6424f32bf8815c2f'
'caf2e58994a3c1942d29d44c90be1478d5f1cf712c8d135d135b8dc4c9dccde1'
'f3f6e7a5cfb7673be0042b8135864371a94cbcbfb1d864d7e9d64d027c35b038'
'd6872a21670cac99b9b15987786cef0d374f49a64c9ab875ca62294371a74d28'
'cdf6ebbca528f29cc01986eea0ae36266c1e0e0ce64cd5e74bde3074109dbaa3'
'32c46ae9bc6601bc0da4b20c6392c84195d1da85e1812dc8412d715aaa7f88cc'
'5fdb0e83c650abdb9e614c3bcde0e98aeaa61d883c89abddff6047312db4295a'
'3ad497d3d106f36e118181e6ec9690a2ebf949c37ffc0d24ed73e3500d1bc895'
'987ded6952cdf274a266f42dbc3bd9827155b9de33ec8695e0f3dd8f85396de8'
'0f916eaae8e8bacc31f13123b89bcd74f4785e460ce7fc207d5d94c192273968'
'370d77f666ecb202f79e7704f637a391faaf5aab02e83ca2b8300c9a7f1eed69'
'c96472df3e15d097104e03ec4444b82d7d5e7f28db7042e90b77f5b200d4e8dc'
'a8446d14b31b50a305bfe5f6f130715d2a5b7892b539667713a7cd968cf1b9ab'
'0bc6b43765de0c102cbb855063c6c7b67c1b02b23313803d16b8cdcd8c6caf11'
'a63338650ea90be0bcee179e69b0cd96ed5c24b5aae0401133d6b6bae1cce71d'
'e0fd2926ed9dba1d0768f8b221a9607583296a9044cd14e63b06bc79088ac360'
'65dc12c962d6cf9c637c157396d67a18640853bd0c890087a9a39da6fdbaca52'
'4850fd4c82bc090726f57d1a1c562cb5a5e654172444ee4eba6abe3021880abb'
'eafc8a892ad6cd89b2d0c2ae6e788ede27c42501b82650d569a95671b0046fa3'
'384001ba02f597aad992624aed9d63cc7f1c70af842b09eac6ea628aa24947ad'
'278461f45bf55fa054a7f59feb87bf6a4ed251b03bf91edc12c088c85418f4e3'
'ff3c524f8802b79d268ad94ba7d0c2684741dc047c1ef5781081b02218333252'
'b751b0983191380b1db5491f902683358b4f9fe53b51f1ab948affe6311e8a67'
'462ff2240a2f5d6de5563aa6a0774c744fce4141122c53d326469bb389a08b4d'
'6b7d7be9cda828306993303d27e2ef4ae7e5ce91b78e18b668ef5a6738636891'
'8429d36d85892940a8b3e9c7f98c563e3805721384f4e1aaca1063dcff002893')
0039-Cygwin-Adjust-CWD-magic-to-accommodate-for-the-lates.patch)
sha256sums=('f068c81cd4f72eaa9b3bdb5ba8a834d2d2db93fac3b2b85f49e3783298c9f4fd'
'bff6bbb45165b76543a602560f66d08283b92cb0cd7a892fa285db70e27a8f6b'
'f0fb7e2f29859d57fd61edf2fb5453f975117aa6c53400f79e6d0eecf9dddba2'
'3083f60db3649474270319856e8ecb39b15015ad49df4e1ab8c93a0ad3a71152'
'27c196e05e46f26b86b2154b048aac0727b7303c464263e49016aabf63335dfd'
'5548241b8ae01f13309db7cc0bec5a12edab5d375940fc2a90a3945f0d35d76c'
'a6993e82c9f9a75e312331cf4c1dc73dc4aeb2a603f57c3084e74366feec1abe'
'8af044236a075ce9c79f4562516f8253b8952a136307cf0caa2b6bfe62d0cdd9'
'4c06122c37a141865f79761c9c6c3cef394ceff87a3893efb67e969a4ff3784b'
'a081a5c3df733794916568eb6e76c5c09a557cbcca02c109bf5024d33ed757a2'
'c64e6302ae378fd825277d5e0a84be53a0a117472901fd04b7de32d879fda46e'
'e4673329cd0d2a320af07c9dc4a556bb1e80bc95f1f7b08e5b347b712e989327'
'97d89b17b1ae4265a508ef791f62f1e7a8e5ed1d506f7a3a92a7c1070ce13e69'
'12ddd41a44249bcd1eaa308b88085a483cc9e4dda85e937b872667b4db16ffc7'
'60360e21d495ae5c6094a4f62ac8991e812abbb593c379b57d51a4b5898dd103'
'c2f296009b8a6742e8ed5d193f498a5edb79e86da8d0ba9be5750ca6885699fe'
'abee377cbb28c336afd91988b0fbe7a2fcbe01d3eeabc8d9329ee7451c0b8d1b'
'90e03e00aaa1bf164248d95a10b5220ac12593c43684b682f6343658c9d0941b'
'198001ad0cf59859631bf8b9ddb80b3c2dd7461881c2a0cd3a333e44ffa55ec2'
'2809335b3f9e4b626d911cd2b2fb6e17146c4e961ea1918e0af299d95b4e0846'
'adbab8c180b734a091471efb10a6d02129eb84480da982e21af81960fb1723a7'
'e3773553646c53ed2f05538e7722eb3bf0b5273b920e32a127e92cf12c217de5'
'5a413e8594c878de06d1ca30057ef64722f0cda3a86784b1b613ef4900272cf2'
'7384efe1cd6a4b1750fcc046bf138fab72ca1ba8d5b3c81c7a128f1604999c3b'
'cc77aec5658dbd5f5f1352412b962665e610653a909f18ad888d13bed4d7a827'
'6686fa6cceeb307b9a812c78204cc64f535414d0038f7c7f7da1f8249e44868f'
'31bbf997c2862494bdf6a1872f367e9c91a0a4dbaa64dcfe4ad3057b82634062'
'132f59f6fe82fed2c98e58036f0bd7075f05a96bad45c00d001a73556c19c4ec'
'2e4e1f6618846ca65f00619592ed0dec202403697a8f6f7e3dbbc29b9e731c57'
'7273d8665fc697cc561f82b652bc6fc19124ca3b7f87a777dcd54f2bb2d1018e'
'43a5d31a1fcf4b2406ede6da7533ca8b781db30545a535864252c16adf73858f'
'2feb05bd31d87451f20125904e311f0e2c1ca5c4c6241320595417d1e5f655a9'
'50efe765461b325df58b10897fc7a2bd9efa23ac1f54e23f6cd83a57161af8e6'
'38a25e2c6893130857a51a706394b257a80ff106919a8fc604eb643aaae8be5b'
'4ef1789fd74d7eefb1c0569b7eae1bd7064cd8c30bd2c0f5fb52a337648bd845'
'39fb52de3cf63de438ec1ce881b7cd25ae885139688163c74f87c26e0cfde6c7'
'9ce20fbc2d3ccd4d545984a3b1469a248ab31470b578ae5be491cdc296a5e577'
'538b977611f8b9e7f40816500c6ff3c501e0ce86108a5131cd5e3b930be66a78'
'3e74a42e8108571dc51687c57e9ebd5f877276bd39f9a188f00a7744b112859d'
'a6a0e5629afa0dc0be01016572865311a5cc7b4c467c38fdb19df6fd527decd4'
'6809826dd0f31fc6c064d2d8302b4f116c716341d0d9ec7adf365783fa0d0f81')
# Helper macros to help make tasks easier #
apply_patch_with_msg() {
@ -198,13 +186,7 @@ prepare() {
0036-Revert-Cygwin-Enable-dynamicbase-on-the-Cygwin-DLL-b.patch \
0037-Avoid-sharing-cygheaps-across-Cygwin-versions.patch \
0038-uname-report-msys2-runtime-commit-hash-too.patch \
0039-fixup-Instead-of-creating-Cygwin-symlinks-use-deep-c.patch \
0040-Cygwin-Adjust-CWD-magic-to-accommodate-for-the-lates.patch \
0041-Cygwin-console-tty-restore-really-restores-the-previ.patch \
0042-Cygwin-pipe-Fix-hang-due-to-inadvertent-0-length-raw.patch \
0043-Cygwin-signal-Clear-direction-flag-in-sigdeleyed.patch \
0044-Cygwin-signal-Copy-context-to-alternate-stack-in-the.patch \
0045-Cygwin-fork-Call-pthread-atforkchild-after-other-ini.patch
0039-Cygwin-Adjust-CWD-magic-to-accommodate-for-the-lates.patch
}
build() {

View File

@ -1 +1 @@
b021edcbcaa648b7409bedb0faee806eb46f3c81
b8fee45a4610af697beb1a0f7c27ab81d28ef2c6