summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Cave-Ayland2020-10-05 15:34:34 +0200
committerPaolo Bonzini2020-10-06 08:34:49 +0200
commitcb8baa7720ed38e6e14af27e0039cd593bf3cdc7 (patch)
tree68109c8db9771e2088e811e886922405c9578949
parentconfigure: consistently pass CFLAGS/CXXFLAGS/LDFLAGS to meson (diff)
downloadqemu-cb8baa7720ed38e6e14af27e0039cd593bf3cdc7.tar.gz
qemu-cb8baa7720ed38e6e14af27e0039cd593bf3cdc7.tar.xz
qemu-cb8baa7720ed38e6e14af27e0039cd593bf3cdc7.zip
configure: don't enable ASLR for --enable-debug Windows builds
Unlike other OSs it is not possible for gdb to temporarily disable ASLR when debugging executables on Windows which causes gdb to fail with memory access errors when trying to debug QEMU. Keep ASLR enabled by default on Windows via the --dynamicbase compiler flag except for --enable-debug builds when there is a clear expectation that a functioning gdb is expected at the cost of slightly less security. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Message-Id: <20201005133434.12614-1-mark.cave-ayland@ilande.co.uk> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rwxr-xr-xconfigure9
1 files changed, 8 insertions, 1 deletions
diff --git a/configure b/configure
index 04c8cc017c..28df227db5 100755
--- a/configure
+++ b/configure
@@ -5882,7 +5882,14 @@ fi
# Use ASLR, no-SEH and DEP if available
if test "$mingw32" = "yes" ; then
- for flag in --dynamicbase --no-seh --nxcompat; do
+ flags="--no-seh --nxcompat"
+
+ # Disable ASLR for debug builds to allow debugging with gdb
+ if test "$debug" = "no" ; then
+ flags="--dynamicbase $flags"
+ fi
+
+ for flag in $flags; do
if ld_has $flag ; then
QEMU_LDFLAGS="-Wl,$flag $QEMU_LDFLAGS"
fi