From 952afb719f3c965bae12b5bd5f0f0f7ed0251cb8 Mon Sep 17 00:00:00 2001 From: Blue Swirl Date: Sun, 19 Sep 2010 08:36:34 +0000 Subject: [PATCH] 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 --- configure | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/configure b/configure index 232ba743e..3bfc5e929 100755 --- a/configure +++ b/configure @@ -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= -- 2.39.5