Skip to content

Commit 5b24535

Browse files
committed
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 #644 partially (which pointed out that /bin/git.exe is compiled without ASLR/DEP). Signed-off-by: Johannes Schindelin <[email protected]>
1 parent ab3a2bd commit 5b24535

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

config.mak.uname

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -579,10 +579,12 @@ else
579579
BUILT_IN_WRAPPER = git-wrapper$(X)
580580

581581
git-wrapper$(X): compat/win32/git-wrapper.o git.res
582-
$(QUIET_LINK)$(CC) -Wall -s -o $@ $^ -lshell32 -lshlwapi
582+
$(QUIET_LINK)$(CC) $(ALL_LDFLAGS) $(COMPAT_CFLAGS) \
583+
-fno-stack-protector -Wall -s -o $@ $^ -lshell32 -lshlwapi
583584

584585
compat/win32/git-wrapper.o: %.o: %.c GIT-PREFIX
585-
$(QUIET_CC)$(CC) -o $*.o -c -Wall -Wwrite-strings $<
586+
$(QUIET_CC)$(CC) $(ALL_CFLAGS) $(COMPAT_CFLAGS) \
587+
-fno-stack-protector -o $*.o -c -Wall -Wwrite-strings $<
586588

587589
endif
588590
endif

0 commit comments

Comments
 (0)