From 5b245354ae5fa7034a0ad0bf18ca64b42509fd5f Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Wed, 3 Feb 2016 14:02:33 +0100 Subject: [PATCH] fixup! mingw: Compile the Git wrapper This ensures that the Git wrapper is compiled with Adress Space Layout Randomization (ASLR) and Data Execution Prevention (DEP). The Git wrapper is still compiled without the stack protector, because that would require the executables to be linked against libssp, something we definitely do not want for e.g. git-bash.exe). Since the Git wrapper also serves as /bin/git redirector (to keep legacy callers working that expect git.exe to live in the top-level /bin/ directory), this fixes https://github.com/git-for-windows/git/issues/644 partially (which pointed out that /bin/git.exe is compiled without ASLR/DEP). Signed-off-by: Johannes Schindelin --- config.mak.uname | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/config.mak.uname b/config.mak.uname index 989644217b52ef..84ef28014f089c 100644 --- a/config.mak.uname +++ b/config.mak.uname @@ -579,10 +579,12 @@ else BUILT_IN_WRAPPER = git-wrapper$(X) git-wrapper$(X): compat/win32/git-wrapper.o git.res - $(QUIET_LINK)$(CC) -Wall -s -o $@ $^ -lshell32 -lshlwapi + $(QUIET_LINK)$(CC) $(ALL_LDFLAGS) $(COMPAT_CFLAGS) \ + -fno-stack-protector -Wall -s -o $@ $^ -lshell32 -lshlwapi compat/win32/git-wrapper.o: %.o: %.c GIT-PREFIX - $(QUIET_CC)$(CC) -o $*.o -c -Wall -Wwrite-strings $< + $(QUIET_CC)$(CC) $(ALL_CFLAGS) $(COMPAT_CFLAGS) \ + -fno-stack-protector -o $*.o -c -Wall -Wwrite-strings $< endif endif