diff options
author | fanquake <fanquake@gmail.com> | 2020-05-20 09:49:25 +0800 |
---|---|---|
committer | fanquake <fanquake@gmail.com> | 2020-05-20 10:15:32 +0800 |
commit | 0aa2ff0f660ec7fec532b5f33850219bad5104dd (patch) | |
tree | be93f78956a43d2236380c1882769d89c8f2c664 | |
parent | aa8d76806c74a51ec66e5004394fe9ea8ff0fac4 (diff) | |
parent | e8a8cff07c409c7eecd478d3df36c7ba92c59730 (diff) |
Merge #18956: build: enforce minimum required Windows version (7)
e8a8cff07c409c7eecd478d3df36c7ba92c59730 build: enforce minimum required Windows version (7) (fanquake)
Pull request description:
Instruct the linker to set the major & minor subsystem versions in the PE
header to 6 & 1 (NT 6.1 which corresponds to Windows 7). Similar to
the behaviour on macOS, the binary will now refuse to run on
unsupported versions of Windows, which, for us, is XP & Vista.
![windows_no_run](https://user-images.githubusercontent.com/863730/81654555-38e0fd00-9468-11ea-9cc8-caf37dec5713.png)
ACKs for top commit:
laanwj:
ACK e8a8cff07c409c7eecd478d3df36c7ba92c59730
Tree-SHA512: 2f7c6443b79b1c6b995e337452aa177e95b0a9c48e47bcf1893aad6fd598e45940ab8eaa5ee1c5d994a521239b4e1b55a55bb3e8ffe367e1349db2a46892a6d4
-rw-r--r-- | configure.ac | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index dc7d34e55e..58f464a73a 100644 --- a/configure.ac +++ b/configure.ac @@ -595,6 +595,8 @@ case $host in archive_cmds_CXX="\$CC -shared \$libobjs \$deplibs \$compiler_flags -static -o \$output_objdir/\$soname \${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker \$lib" postdeps_CXX= + dnl We require Windows 7 (NT 6.1) or later + AX_CHECK_LINK_FLAG([[-Wl,--major-subsystem-version -Wl,6 -Wl,--minor-subsystem-version -Wl,1]],[LDFLAGS="$LDFLAGS -Wl,--major-subsystem-version -Wl,6 -Wl,--minor-subsystem-version -Wl,1"],,[[$LDFLAG_WERROR]]) ;; *darwin*) TARGET_OS=darwin |