mingw: use ASLR, no-SEH and DEP if available

If the linker supports the flags --dynamicbase, --no-seh,
or --nxcompat, use them.

Tested on Windows Vista: Process Explorer reports that ASLR and DEP
are in use. No effect seen on Wine or Windows XP.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
This commit is contained in:
Blue Swirl 2010-09-19 08:36:34 +00:00
parent ebab1720f6
commit 952afb719f

9
configure vendored
View file

@ -2141,6 +2141,15 @@ if test "$solaris" = "no" ; then
fi
fi
# Use ASLR, no-SEH and DEP if available
if test "$mingw32" = "yes" ; then
for flag in --dynamicbase --no-seh --nxcompat; do
if $ld --help 2>/dev/null | grep ".$flag" >/dev/null 2>/dev/null ; then
LDFLAGS="-Wl,$flag $LDFLAGS"
fi
done
fi
confdir=$sysconfdir$confsuffix
tools=