Skip to content

Commit

Permalink
git: link the Git wrapper using ASLR/DEP
Browse files Browse the repository at this point in the history
Address Space Layout Randomization (ASLR) and Data Execution Prevention
(DEP) are two powerful techniques to stave off exploits. Since both
essentially come for free (performance-wise) it is wise to enable them.

Together with Git for Windows' 5b24535 (fixup! mingw: Compile the Git
wrapper, 2016-02-03) this concludes addressing the ticket
git-for-windows/git#644.

Signed-off-by: Johannes Schindelin <[email protected]>
  • Loading branch information
dscho committed Feb 3, 2016
1 parent 89751d3 commit b9857a9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion mingw-w64-git/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,12 @@ build() {
windres -O coff ../$basename.rc -o $basename.res || break
done
) &&
LDOPTS="-s -O2 -Wall compat/win32/git-wrapper.o git.res -lshlwapi" &&
LDOPTS="-Wl,--dynamicbase -Wl,--nxcompat -fstack-protector-strong" &&
case "${MINGW_PACKAGE_PREFIX}" in
*-x86_64) LDOPTS="$LDOPTS -Wl,--pic-executable,-e,mainCRTStartup";;
*-i686) LDOPTS="$LDOPTS -Wl,--pic-executable,-e,_mainCRTStartup";;
esac &&
LDOPTS="$LDOPTS -s -O2 -Wall compat/win32/git-wrapper.o git.res -lshlwapi" &&
gcc -mwindows -o git-bash.exe git-bash.res $LDOPTS &&
gcc -mconsole -o git-cmd.exe git-cmd.res $LDOPTS &&
gcc -mconsole -o compat-bash.exe compat-bash.res $LDOPTS &&
Expand Down

0 comments on commit b9857a9

Please sign in to comment.