Skip to content

Commit 65d2fa8

Browse files
author
Philip Oakley
committed
config.mak.uname: add MSVC No_SafeExeceptionHandler option
Microsoft flipped the Windows Safe Exception Handling default in VS2013 so that zlib became unacceptable to certain OS versions (Vista and subsequent 32-bit OS's) without the addition of the option -SAFESEH:NO. Provide a switch to disable the Safe Exeption Handler when required. The option ImageHasSafeExceptionHandlers for VS2013 is not available in earlier versions, so use the SAFESEH:NO linker flag. See https://msdn.microsoft.com/en-us/library/9a89h429.aspx for further details. This has only had limited testing due to the lack of a suitable system. Helped-by: Yue Lin Ho <[email protected]> Signed-off-by: Philip Oakley <[email protected]> --- Junio/my discussion on reviews: http://marc.info/?l=git&m=143526063906215&w=2 (2015-06-25) Patch series v1: msysgit#318 Yue Lin Ho: msysgit#318 (comment)
1 parent ce7cd0e commit 65d2fa8

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

config.mak.uname

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Platform specific Makefile tweaks based on uname detection
22

3+
# Define NO_SAFESEH if you need MSVC/Visual Studio to ignore the lack of
4+
# Microsoft's Safe Exception Handling in libraries (such as zlib).
5+
# Typically required for VS2013+/32-bit compilation on Vista+ versions.
6+
37
uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
48
uname_M := $(shell sh -c 'uname -m 2>/dev/null || echo not')
59
uname_O := $(shell sh -c 'uname -o 2>/dev/null || echo not')
@@ -381,6 +385,11 @@ ifeq ($(uname_S),Windows)
381385
PTHREAD_LIBS =
382386
lib =
383387
BASIC_CFLAGS += -DPROTECT_NTFS_DEFAULT=1
388+
389+
ifdef NO_SAFESEH
390+
LDFLAGS += -SAFESEH:NO
391+
endif
392+
384393
ifndef DEBUG
385394
BASIC_CFLAGS += -GL -Os -MD
386395
BASIC_LDFLAGS += -LTCG

0 commit comments

Comments
 (0)