Skip to content

Commit 6f5b35c

Browse files
authored
Merge pull request #238 from git-for-windows/msys2-runtime-d973094841109fda63a3e79742dcd06584227e06
msys2-runtime: update to 3.6.3-2
2 parents 4f31747 + b7f656b commit 6f5b35c

File tree

4 files changed

+160
-6
lines changed

4 files changed

+160
-6
lines changed
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
From 1f8def9f776a7dd0d0381f4bf25e84f805393cc1 Mon Sep 17 00:00:00 2001
2+
From: =?UTF-8?q?Radek=20Barto=C5=88?= <[email protected]>
3+
Date: Mon, 9 Jun 2025 18:14:14 +0200
4+
Subject: [PATCH 48/N] Cygwin: Fix compatibility with w32api headers v13
5+
6+
(cherry picked from commit 2029784e05d9805aa074dcadb99c31311790b7ac)
7+
---
8+
winsup/cygwin/fhandler/socket_inet.cc | 5 +++++
9+
winsup/cygwin/fhandler/socket_local.cc | 5 +++++
10+
winsup/cygwin/local_includes/ntdll.h | 4 ++++
11+
winsup/cygwin/net.cc | 5 +++++
12+
4 files changed, 19 insertions(+)
13+
14+
diff --git a/winsup/cygwin/fhandler/socket_inet.cc b/winsup/cygwin/fhandler/socket_inet.cc
15+
index 22dfed6..5ed0cb0 100644
16+
--- a/winsup/cygwin/fhandler/socket_inet.cc
17+
+++ b/winsup/cygwin/fhandler/socket_inet.cc
18+
@@ -20,7 +20,12 @@
19+
#undef u_long
20+
#define u_long __ms_u_long
21+
#include <w32api/ws2tcpip.h>
22+
+/* 2025-06-09: win32api headers v13 now define a cmsghdr type which clashes with
23+
+ our socket.h. Arrange not to see it here. */
24+
+#undef cmsghdr
25+
+#define cmsghdr __ms_cmsghdr
26+
#include <w32api/mswsock.h>
27+
+#undef cmsghdr
28+
#include <w32api/mstcpip.h>
29+
#include <netinet/tcp.h>
30+
#include <netinet/udp.h>
31+
diff --git a/winsup/cygwin/fhandler/socket_local.cc b/winsup/cygwin/fhandler/socket_local.cc
32+
index ea5ee67..0498edc 100644
33+
--- a/winsup/cygwin/fhandler/socket_local.cc
34+
+++ b/winsup/cygwin/fhandler/socket_local.cc
35+
@@ -21,7 +21,12 @@
36+
#define u_long __ms_u_long
37+
#include "ntsecapi.h"
38+
#include <w32api/ws2tcpip.h>
39+
+/* 2025-06-09: win32api headers v13 now define a cmsghdr type which clashes with
40+
+ our socket.h. Arrange not to see it here. */
41+
+#undef cmsghdr
42+
+#define cmsghdr __ms_cmsghdr
43+
#include <w32api/mswsock.h>
44+
+#undef cmsghdr
45+
#include <unistd.h>
46+
#include <asm/byteorder.h>
47+
#include <sys/socket.h>
48+
diff --git a/winsup/cygwin/local_includes/ntdll.h b/winsup/cygwin/local_includes/ntdll.h
49+
index 4497fe5..2991672 100644
50+
--- a/winsup/cygwin/local_includes/ntdll.h
51+
+++ b/winsup/cygwin/local_includes/ntdll.h
52+
@@ -489,6 +489,8 @@ typedef struct _FILE_DISPOSITION_INFORMATION_EX // 64
53+
ULONG Flags;
54+
} FILE_DISPOSITION_INFORMATION_EX, *PFILE_DISPOSITION_INFORMATION_EX;
55+
56+
+#if __MINGW64_VERSION_MAJOR < 13
57+
+
58+
typedef struct _FILE_STAT_INFORMATION // 68
59+
{
60+
LARGE_INTEGER FileId;
61+
@@ -509,6 +511,8 @@ typedef struct _FILE_CASE_SENSITIVE_INFORMATION // 71
62+
ULONG Flags;
63+
} FILE_CASE_SENSITIVE_INFORMATION, *PFILE_CASE_SENSITIVE_INFORMATION;
64+
65+
+#endif
66+
+
67+
enum {
68+
FILE_LINK_REPLACE_IF_EXISTS = 0x01,
69+
FILE_LINK_POSIX_SEMANTICS = 0x02,
70+
diff --git a/winsup/cygwin/net.cc b/winsup/cygwin/net.cc
71+
index 9d7224a..579b1a7 100644
72+
--- a/winsup/cygwin/net.cc
73+
+++ b/winsup/cygwin/net.cc
74+
@@ -18,7 +18,12 @@ details. */
75+
#undef u_long
76+
#define u_long __ms_u_long
77+
#include <w32api/ws2tcpip.h>
78+
+/* 2025-06-09: win32api headers v13 now define a cmsghdr type which clashes with
79+
+ our socket.h. Arrange not to see it here. */
80+
+#undef cmsghdr
81+
+#define cmsghdr __ms_cmsghdr
82+
#include <w32api/mswsock.h>
83+
+#undef cmsghdr
84+
#include <w32api/iphlpapi.h>
85+
#define gethostname cygwin_gethostname
86+
#include <unistd.h>
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
From 4ee8a03ea37a74f1e31ebb0b3c73124f2ad5f4df Mon Sep 17 00:00:00 2001
2+
From: Johannes Schindelin <[email protected]>
3+
Date: Thu, 19 Jun 2025 20:46:03 +0200
4+
Subject: [PATCH 49/N] symlink_native: allow linking to `..`
5+
6+
When running
7+
8+
CYGWIN=winsymlinks:nativestrict ln -s .. abc
9+
10+
the counter-intuitive result is _not_ a symbolic link to `..`, but
11+
instead to `../../$(basename "$PWD")`.
12+
13+
The reason for this is that the search for the longest common prefix
14+
assumes that the link target is not a strict prefix of the parent
15+
directory of the link itself.
16+
17+
Let's fix that.
18+
19+
Signed-off-by: Johannes Schindelin <[email protected]>
20+
---
21+
winsup/cygwin/path.cc | 21 ++++++++++++++++-----
22+
1 file changed, 16 insertions(+), 5 deletions(-)
23+
24+
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
25+
index 6f04658..ead7d16 100644
26+
--- a/winsup/cygwin/path.cc
27+
+++ b/winsup/cygwin/path.cc
28+
@@ -2030,9 +2030,18 @@ symlink_native (const char *oldpath, path_conv &win32_newpath)
29+
while (towupper (*++c_old) == towupper (*++c_new))
30+
;
31+
/* The last component could share a common prefix, so make sure we end
32+
- up on the first char after the last common backslash. */
33+
- while (c_old[-1] != L'\\')
34+
- --c_old, --c_new;
35+
+ up on the first char after the last common backslash.
36+
+
37+
+ However, if c_old is a strict prefix of c_new (at a component
38+
+ boundary), or vice versa, then do not try to find the last common
39+
+ backslash. */
40+
+ if ((!*c_old || *c_old == L'\\') && (!*c_new || *c_new == L'\\'))
41+
+ c_old += !!*c_old, c_new += !!*c_new;
42+
+ else
43+
+ {
44+
+ while (c_old[-1] != L'\\')
45+
+ --c_old, --c_new;
46+
+ }
47+
48+
/* 2. Check if prefix is long enough. The prefix must at least points to
49+
a complete device: \\?\X:\ or \\?\UNC\server\share\ are the minimum
50+
@@ -2057,8 +2066,10 @@ symlink_native (const char *oldpath, path_conv &win32_newpath)
51+
final_oldpath = &final_oldpath_buf;
52+
final_oldpath->Buffer = tp.w_get ();
53+
PWCHAR e_old = final_oldpath->Buffer;
54+
- while (num-- > 0)
55+
- e_old = wcpcpy (e_old, L"..\\");
56+
+ while (num > 1 || (num == 1 && *c_old))
57+
+ e_old = wcpcpy (e_old, L"..\\"), num--;
58+
+ if (num > 0)
59+
+ e_old = wcpcpy (e_old, L"..");
60+
wcpcpy (e_old, c_old);
61+
}
62+
}

msys2-runtime/PKGBUILD

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
pkgbase=msys2-runtime
55
pkgname=('msys2-runtime' 'msys2-runtime-devel')
66
pkgver=3.6.3
7-
pkgrel=1
7+
pkgrel=2
88
pkgdesc="Cygwin POSIX emulation engine"
99
arch=('x86_64')
1010
url="https://www.cygwin.com/"
@@ -73,9 +73,11 @@ source=('msys2-runtime'::git+https://github.com/cygwin/cygwin#tag=cygwin-${pkgve
7373
0044-Make-paths-WCS-MBS-conversion-explicit.patch
7474
0045-Use-MB_CUR_MAX-6-by-default.patch
7575
0046-Change-the-default-base-address-for-x86_64.patch
76-
0047-msys2-runtime-restore-fast-path-for-current-user-pri.patch)
76+
0047-msys2-runtime-restore-fast-path-for-current-user-pri.patch
77+
0048-Cygwin-Fix-compatibility-with-w32api-headers-v13.patch
78+
0049-symlink_native-allow-linking-to.patch)
7779
sha256sums=('53d2be8a2dcf58e7eae7823ef01a5b8ce0eba704b132d19167396eb162db378c'
78-
'4a13f9eb11bbbdcb436ebb37e11697de3e1a2db86e6adc63969e3d5a130056b8'
80+
'24a6defda6fd286c96e18f8ee8c7f36fd3c010f2df8e3b619e1ebb61bb61b1df'
7981
'5538db757661949423563bab5e4f383dfa4ef0cf3301cf43f23b482392554b3b'
8082
'2fb9b2b297797d20cd901eaee2de735e8cdda1c1e5836e9ff77856c0d1216860'
8183
'780977d71e35bbe4c0dcda5272895267d68d635f311e224f7981858f7192a85e'
@@ -122,7 +124,9 @@ sha256sums=('53d2be8a2dcf58e7eae7823ef01a5b8ce0eba704b132d19167396eb162db378c'
122124
'a41a3bb4ccbe18063bcbf5b0dcd10c251937eb1ca24110f9abaa05bc9804f465'
123125
'2eab02a9cc158d9f5fb33d66ae5e8f8fcfb67494d0387ae63f627f947a3ea957'
124126
'8fbb38dc064d11599b2314311abfa632ec5a8da4786c716299e276abd29d7326'
125-
'6db2e2a7e45125974de355fd685d3a652c1f17e5bd2a94606cbba33520d96624')
127+
'6db2e2a7e45125974de355fd685d3a652c1f17e5bd2a94606cbba33520d96624'
128+
'37f4dcaab659da6f7730a7fdd855c91e51b642bd42820a7f35af514a866db7fd'
129+
'e2b046866637090bd9123fd2fcd00faac5d903e4b322959b9c13ea1161e786a2')
126130

127131
# Helper macros to help make tasks easier #
128132
apply_patch_with_msg() {
@@ -223,7 +227,9 @@ prepare() {
223227
0044-Make-paths-WCS-MBS-conversion-explicit.patch \
224228
0045-Use-MB_CUR_MAX-6-by-default.patch \
225229
0046-Change-the-default-base-address-for-x86_64.patch \
226-
0047-msys2-runtime-restore-fast-path-for-current-user-pri.patch
230+
0047-msys2-runtime-restore-fast-path-for-current-user-pri.patch \
231+
0048-Cygwin-Fix-compatibility-with-w32api-headers-v13.patch \
232+
0049-symlink_native-allow-linking-to.patch
227233
}
228234

229235
build() {

msys2-runtime/msys2-runtime.commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
086201ea001090dfb0d42669e59c122da205ee6b
1+
d973094841109fda63a3e79742dcd06584227e06

0 commit comments

Comments
 (0)