Skip to content

Commit 70e20ea

Browse files
committed
Merge bitcoin/bitcoin#31172: build: increase minimum supported Windows to 10.0
ee1128e doc: update stack-clash-protection comment re mingw-w64 (fanquake) bf47448 test: drop check for Windows < 10 (fanquake) 35b898c release: target Windows 10 or later (fanquake) 398754e depends: target Windows 10 when building for mingw-w64 (fanquake) Pull request description: Follows up to bitcoin/bitcoin#31048 (comment). We definitely cannot claim that Bitcoin Core is "supported and extensively tested on" on Windows 7. Note that #30997 is also increasing the minimum required Windows version (for the GUI) to 10. ACKs for top commit: hodlinator: cr-ACK ee1128e davidgumberg: ACK bitcoin/bitcoin@ee1128e achow101: ACK ee1128e hebasto: re-ACK ee1128e, only rebased, a commit message and a comment have been amended since my recent [review](bitcoin/bitcoin#31172 (review)). TheCharlatan: ACK ee1128e Tree-SHA512: 245e0bac3d63414d919a1948661fef4ff79359faaacaf19d64abd91cc62e822797fb1cf3379e340bfdf9a85c0b88fd99a90eda450dd4218b6213ab78aefb1374
2 parents 733317b + ee1128e commit 70e20ea

File tree

8 files changed

+34
-33
lines changed

8 files changed

+34
-33
lines changed

CMakeLists.txt

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,8 @@ if(WIN32)
253253
]=]
254254

255255
target_compile_definitions(core_interface INTERFACE
256-
_WIN32_WINNT=0x0601
257-
_WIN32_IE=0x0501
256+
_WIN32_WINNT=0x0A00
257+
_WIN32_IE=0x0A00
258258
WIN32_LEAN_AND_MEAN
259259
NOMINMAX
260260
)
@@ -292,9 +292,11 @@ if(WIN32)
292292
# See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54412.
293293
try_append_cxx_flags("-Wa,-muse-unaligned-vector-move" TARGET core_interface SKIP_LINK)
294294
try_append_linker_flag("-static" TARGET core_interface)
295-
# We require Windows 7 (NT 6.1) or later.
295+
# We support Windows 10+, however it's not possible to set these values accordingly,
296+
# due to a bug in mingw-w64. See https://sourceforge.net/p/mingw-w64/bugs/968/.
297+
# As a best effort, target Windows 8.
296298
try_append_linker_flag("-Wl,--major-subsystem-version,6" TARGET core_interface)
297-
try_append_linker_flag("-Wl,--minor-subsystem-version,1" TARGET core_interface)
299+
try_append_linker_flag("-Wl,--minor-subsystem-version,2" TARGET core_interface)
298300
endif()
299301
endif()
300302

@@ -478,8 +480,7 @@ if(ENABLE_HARDENING)
478480
try_append_cxx_flags("-fcf-protection=full" TARGET hardening_interface)
479481

480482
if(MINGW)
481-
# stack-clash-protection doesn't compile with GCC 10 and earlier.
482-
# In any case, it is a no-op for Windows.
483+
# stack-clash-protection is a no-op for Windows.
483484
# See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90458 for more details.
484485
else()
485486
try_append_cxx_flags("-fstack-clash-protection" TARGET hardening_interface)

contrib/devtools/symbol-check.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ def check_PE_libraries(binary) -> bool:
260260
def check_PE_subsystem_version(binary) -> bool:
261261
major: int = binary.optional_header.major_subsystem_version
262262
minor: int = binary.optional_header.minor_subsystem_version
263-
if major == 6 and minor == 1:
263+
if major == 6 and minor == 2:
264264
return True
265265
return False
266266

contrib/devtools/test-symbol-check.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ def test_PE(self):
135135
}
136136
''')
137137

138-
self.assertEqual(call_symbol_check(cxx, source, executable, ['-lpdh', '-Wl,--major-subsystem-version', '-Wl,6', '-Wl,--minor-subsystem-version', '-Wl,1']),
138+
self.assertEqual(call_symbol_check(cxx, source, executable, ['-lpdh', '-Wl,--major-subsystem-version', '-Wl,6', '-Wl,--minor-subsystem-version', '-Wl,2']),
139139
(1, 'pdh.dll is not in ALLOWED_LIBRARIES!\n' +
140140
executable + ': failed DYNAMIC_LIBRARIES'))
141141

@@ -166,7 +166,7 @@ def test_PE(self):
166166
}
167167
''')
168168

169-
self.assertEqual(call_symbol_check(cxx, source, executable, ['-lole32', '-Wl,--major-subsystem-version', '-Wl,6', '-Wl,--minor-subsystem-version', '-Wl,1']),
169+
self.assertEqual(call_symbol_check(cxx, source, executable, ['-lole32', '-Wl,--major-subsystem-version', '-Wl,6', '-Wl,--minor-subsystem-version', '-Wl,2']),
170170
(0, ''))
171171

172172

depends/hosts/mingw32.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@ mingw32_debug_CXXFLAGS=$(mingw32_debug_CFLAGS)
2323
mingw32_debug_CPPFLAGS=-D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC
2424

2525
mingw32_cmake_system_name=Windows
26-
# Windows 7 (NT 6.1).
27-
mingw32_cmake_system_version=6.1
26+
# Windows 10
27+
mingw32_cmake_system_version=10.0

depends/packages/libevent.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ $(package)_patches=cmake_fixups.patch
77
$(package)_build_subdir=build
88

99
# When building for Windows, we set _WIN32_WINNT to target the same Windows
10-
# version as we do in configure. Due to quirks in libevents build system, this
10+
# version as we do in releases. Due to quirks in libevents build system, this
1111
# is also required to enable support for ipv6. See #19375.
1212
define $(package)_set_vars
1313
$(package)_config_opts=-DEVENT__DISABLE_BENCHMARK=ON -DEVENT__DISABLE_OPENSSL=ON
1414
$(package)_config_opts+=-DEVENT__DISABLE_SAMPLES=ON -DEVENT__DISABLE_REGRESS=ON
1515
$(package)_config_opts+=-DEVENT__DISABLE_TESTS=ON -DEVENT__LIBRARY_TYPE=STATIC
1616
$(package)_cppflags += -D_GNU_SOURCE
17-
$(package)_cppflags_mingw32=-D_WIN32_WINNT=0x0601
17+
$(package)_cppflags_mingw32=-D_WIN32_WINNT=0x0A00
1818

1919
ifeq ($(NO_HARDEN),)
2020
$(package)_cppflags+=-D_FORTIFY_SOURCE=3

depends/packages/zeromq.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ define $(package)_set_vars
1818
$(package)_config_opts += -DBUILD_SHARED=OFF -DBUILD_TESTS=OFF -DZMQ_BUILD_TESTS=OFF
1919
$(package)_config_opts += -DENABLE_DRAFTS=OFF -DZMQ_BUILD_TESTS=OFF
2020
$(package)_cxxflags += -ffile-prefix-map=$($(package)_extract_dir)=/usr
21-
$(package)_config_opts_mingw32 += -DZMQ_WIN32_WINNT=0x0601 -DZMQ_HAVE_IPC=OFF
21+
$(package)_config_opts_mingw32 += -DZMQ_WIN32_WINNT=0x0A00 -DZMQ_HAVE_IPC=OFF
2222
endef
2323

2424
define $(package)_preprocess_cmds

doc/release-notes-empty-template.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ codesign -s - bitcoin-cli bitcoin-qt bitcoin-tx bitcoin-util bitcoin-wallet bitc
4242
Compatibility
4343
==============
4444

45-
Bitcoin Core is supported and extensively tested on operating systems
46-
using the Linux Kernel 3.17+, macOS 13.0+, and Windows 7 and newer. Bitcoin
45+
Bitcoin Core is supported and tested on operating systems using the
46+
Linux Kernel 3.17+, macOS 13.0+, and Windows 10 and newer. Bitcoin
4747
Core should also work on most other Unix-like systems but is not as
4848
frequently tested on them. It is not recommended to use Bitcoin Core on
4949
unsupported systems.

test/functional/test_runner.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -51,23 +51,23 @@
5151
CROSS = "x "
5252
CIRCLE = "o "
5353

54-
if platform.system() != 'Windows' or sys.getwindowsversion() >= (10, 0, 14393): #type:ignore
55-
if platform.system() == 'Windows':
56-
import ctypes
57-
kernel32 = ctypes.windll.kernel32 # type: ignore
58-
ENABLE_VIRTUAL_TERMINAL_PROCESSING = 4
59-
STD_OUTPUT_HANDLE = -11
60-
STD_ERROR_HANDLE = -12
61-
# Enable ascii color control to stdout
62-
stdout = kernel32.GetStdHandle(STD_OUTPUT_HANDLE)
63-
stdout_mode = ctypes.c_int32()
64-
kernel32.GetConsoleMode(stdout, ctypes.byref(stdout_mode))
65-
kernel32.SetConsoleMode(stdout, stdout_mode.value | ENABLE_VIRTUAL_TERMINAL_PROCESSING)
66-
# Enable ascii color control to stderr
67-
stderr = kernel32.GetStdHandle(STD_ERROR_HANDLE)
68-
stderr_mode = ctypes.c_int32()
69-
kernel32.GetConsoleMode(stderr, ctypes.byref(stderr_mode))
70-
kernel32.SetConsoleMode(stderr, stderr_mode.value | ENABLE_VIRTUAL_TERMINAL_PROCESSING)
54+
if platform.system() == 'Windows':
55+
import ctypes
56+
kernel32 = ctypes.windll.kernel32 # type: ignore
57+
ENABLE_VIRTUAL_TERMINAL_PROCESSING = 4
58+
STD_OUTPUT_HANDLE = -11
59+
STD_ERROR_HANDLE = -12
60+
# Enable ascii color control to stdout
61+
stdout = kernel32.GetStdHandle(STD_OUTPUT_HANDLE)
62+
stdout_mode = ctypes.c_int32()
63+
kernel32.GetConsoleMode(stdout, ctypes.byref(stdout_mode))
64+
kernel32.SetConsoleMode(stdout, stdout_mode.value | ENABLE_VIRTUAL_TERMINAL_PROCESSING)
65+
# Enable ascii color control to stderr
66+
stderr = kernel32.GetStdHandle(STD_ERROR_HANDLE)
67+
stderr_mode = ctypes.c_int32()
68+
kernel32.GetConsoleMode(stderr, ctypes.byref(stderr_mode))
69+
kernel32.SetConsoleMode(stderr, stderr_mode.value | ENABLE_VIRTUAL_TERMINAL_PROCESSING)
70+
else:
7171
# primitive formatting on supported
7272
# terminal via ANSI escape sequences:
7373
DEFAULT = ('\033[0m', '\033[0m')

0 commit comments

Comments
 (0)