Skip to content

Commit

Permalink
Merge branch 'id/windows-dep-aslr' into jch
Browse files Browse the repository at this point in the history
Allow DEP and ASLR for Windows build to for security hardening.

* id/windows-dep-aslr:
  mingw: enable DEP and ASLR
  mingw: do not let ld strip relocations
  • Loading branch information
gitster committed May 15, 2019
2 parents a25e146 + ce6a158 commit b56da75
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions config.mak.uname
Original file line number Diff line number Diff line change
Expand Up @@ -576,13 +576,21 @@ else
ifneq ($(shell expr "$(uname_R)" : '1\.'),2)
# MSys2
prefix = /usr/
# Enable DEP
BASIC_LDFLAGS += -Wl,--nxcompat
# Enable ASLR (unless debugging)
ifneq (,$(findstring -O,$(filter-out -O0 -Og,$(CFLAGS))))
BASIC_LDFLAGS += -Wl,--dynamicbase
endif
ifeq (MINGW32,$(MSYSTEM))
prefix = /mingw32
HOST_CPU = i686
BASIC_LDFLAGS += -Wl,--pic-executable,-e,_mainCRTStartup
endif
ifeq (MINGW64,$(MSYSTEM))
prefix = /mingw64
HOST_CPU = x86_64
BASIC_LDFLAGS += -Wl,--pic-executable,-e,mainCRTStartup
else
COMPAT_CFLAGS += -D_USE_32BIT_TIME_T
BASIC_LDFLAGS += -Wl,--large-address-aware
Expand Down

0 comments on commit b56da75

Please sign in to comment.