[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 23/37] configure: don't enable ASLR for --enable-debug Windows bui
From: |
Paolo Bonzini |
Subject: |
[PULL 23/37] configure: don't enable ASLR for --enable-debug Windows builds |
Date: |
Tue, 6 Oct 2020 09:29:33 +0200 |
From: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
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>
---
configure | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
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
--
2.26.2
- [PULL 12/37] cpus: add handle_interrupt to the CpusAccel interface, (continued)
- [PULL 12/37] cpus: add handle_interrupt to the CpusAccel interface, Paolo Bonzini, 2020/10/06
- [PULL 13/37] hvf: remove hvf specific functions from global includes, Paolo Bonzini, 2020/10/06
- [PULL 15/37] hax: remove hax specific functions from global includes, Paolo Bonzini, 2020/10/06
- [PULL 11/37] cpus: remove checks for non-NULL cpus_accel, Paolo Bonzini, 2020/10/06
- [PULL 14/37] whpx: remove whpx specific functions from global includes, Paolo Bonzini, 2020/10/06
- [PULL 16/37] kvm: remove kvm specific functions from global includes, Paolo Bonzini, 2020/10/06
- [PULL 17/37] kvm: kvm_init_vcpu take Error pointer, Paolo Bonzini, 2020/10/06
- [PULL 18/37] accel/tcg: use current_machine as it is always set for softmmu, Paolo Bonzini, 2020/10/06
- [PULL 19/37] slirp: Convert Makefile bits to meson bits, Paolo Bonzini, 2020/10/06
- [PULL 20/37] dtc: Convert Makefile bits to meson bits, Paolo Bonzini, 2020/10/06
- [PULL 23/37] configure: don't enable ASLR for --enable-debug Windows builds,
Paolo Bonzini <=
- [PULL 22/37] configure: consistently pass CFLAGS/CXXFLAGS/LDFLAGS to meson, Paolo Bonzini, 2020/10/06
- [PULL 25/37] replay: provide an accessor for rr filename, Paolo Bonzini, 2020/10/06
- [PULL 21/37] configure: do not clobber environment CFLAGS/CXXFLAGS/LDFLAGS, Paolo Bonzini, 2020/10/06
- [PULL 24/37] replay: don't record interrupt poll, Paolo Bonzini, 2020/10/06
- [PULL 26/37] qcow2: introduce icount field for snapshots, Paolo Bonzini, 2020/10/06
- [PULL 27/37] migration: introduce icount field for snapshots, Paolo Bonzini, 2020/10/06
- [PULL 28/37] qapi: introduce replay.json for record/replay-related stuff, Paolo Bonzini, 2020/10/06
- [PULL 29/37] replay: introduce info hmp/qmp command, Paolo Bonzini, 2020/10/06
- [PULL 30/37] replay: introduce breakpoint at the specified step, Paolo Bonzini, 2020/10/06