]> git.proxmox.com Git - mirror_qemu.git/commitdiff
mingw: use ASLR, no-SEH and DEP if available
authorBlue Swirl <blauwirbel@gmail.com>
Sun, 19 Sep 2010 08:36:34 +0000 (08:36 +0000)
committerBlue Swirl <blauwirbel@gmail.com>
Sun, 19 Sep 2010 08:36:34 +0000 (08:36 +0000)
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>
configure

index 232ba743ef2269944d4741abccd6a64c92fc8254..3bfc5e929bc28c567aed789659fbbebbbb0dd647 100755 (executable)
--- 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=