Skip to content

Commit

Permalink
fixup! mingw: Compile the Git wrapper
Browse files Browse the repository at this point in the history
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 #644
partially (which pointed out that /bin/git.exe is compiled without
ASLR/DEP).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
  • Loading branch information
dscho committed Feb 3, 2016
1 parent ab3a2bd commit 5b24535
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions config.mak.uname
Expand Up @@ -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
Expand Down

0 comments on commit 5b24535

Please sign in to comment.