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 <johannes.schindelin@gmx.de>
This commit is contained in:
Johannes Schindelin
2016-02-03 14:02:33 +01:00
parent ab3a2bd336
commit 5b245354ae

View File

@@ -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