Skip to content

Commit e8a8cff

Browse files
committed
build: enforce minimum required Windows version (7)
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 macOS, the binary will now refuse to run on unsupported versions of Windows.
1 parent 04c0955 commit e8a8cff

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

configure.ac

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -595,6 +595,8 @@ case $host in
595595
archive_cmds_CXX="\$CC -shared \$libobjs \$deplibs \$compiler_flags -static -o \$output_objdir/\$soname \${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker \$lib"
596596
postdeps_CXX=
597597

598+
dnl We require Windows 7 (NT 6.1) or later
599+
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]])
598600
;;
599601
*darwin*)
600602
TARGET_OS=darwin

0 commit comments

Comments
 (0)