Skip to content

Commit 6fc6a9d

Browse files
committed
mingw: enable stack smashing protector
As suggested privately to Brendan Forster by some unnamed person (suggestion for the future: use the public mailing list, or even the public GitHub issue tracker, that is a much better place to offer such suggestions), we should make use of gcc's stack smashing protector that helps detect stack buffer overruns early. Rather than using -fstack-protector, we use -fstack-protector-strong because it strikes a better balance between how much code is affected and the performance impact. In a local test (time git log --grep=is -p), best of 5 timings went from 23.009s to 22.997s (i.e. the performance impact was *well* lost in the noise). This fixes #501 Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 16b1ba4 commit 6fc6a9d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

config.mak.uname

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,8 @@ else
555555
BASIC_LDFLAGS += -Wl,--large-address-aware
556556
endif
557557
CC = gcc
558-
COMPAT_CFLAGS += -D__USE_MINGW_ANSI_STDIO=0 -DDETECT_MSYS_TTY
558+
COMPAT_CFLAGS += -D__USE_MINGW_ANSI_STDIO=0 -DDETECT_MSYS_TTY \
559+
-fstack-protector-strong
559560
EXTLIBS += -lntdll
560561
INSTALL = /bin/install
561562
NO_R_TO_GCC_LINKER = YesPlease

0 commit comments

Comments
 (0)