From nobody Fri Dec 19 18:47:06 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1601904974; cv=none; d=zohomail.com; s=zohoarc; b=LrGrB0MAJVLIWnh6yEJvmMFZIk/l2RUw1xoJcZf7pd05a2fPP5DsIvIqhtcVAUv9Zwr/raglIMV6Dcu7Brfbk8CJAzHgTZewk/G2BwU6glG8zKufGaVUM31R959xX1PrGGDuSe0j5xdtKJncZuNkdVCg/kn+hhYq36XcQXLUczM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601904974; h=Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=yZJRAS2YX/uLZwrb3ymoseewX6Kb3xXd2JfOuUKv20s=; b=jIIiyeBapq0RrCke28UfWito5+8PtKwO7ZRJ+SUTuog7pPEqXeDosiGRMPp2/GJ2y1dY1GBSxEfsmDHNnxMVS2RsAUGNmz61dCxZfsOr8MKwqmB4iYJiBuIHnuuJ44MNcAqe62Gv4hBaLhMZvxxq25RnaBZSYk/knSDGlOUtno4= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1601904974432495.42665143635827; Mon, 5 Oct 2020 06:36:14 -0700 (PDT) Received: from localhost ([::1]:50616 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kPQez-000235-9G for importer@patchew.org; Mon, 05 Oct 2020 09:36:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49498) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kPQde-0000wY-PL for qemu-devel@nongnu.org; Mon, 05 Oct 2020 09:34:50 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:35408 helo=mail.default.ilande.uk0.bigv.io) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kPQdc-00064Y-MA for qemu-devel@nongnu.org; Mon, 05 Oct 2020 09:34:50 -0400 Received: from host86-184-131-21.range86-184.btcentralplus.com ([86.184.131.21] helo=kentang.home) by mail.default.ilande.uk0.bigv.io with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kPQdV-0001q8-4G; Mon, 05 Oct 2020 14:34:44 +0100 From: Mark Cave-Ayland To: qemu-devel@nongnu.org, pbonzini@redhat.com Date: Mon, 5 Oct 2020 14:34:34 +0100 Message-Id: <20201005133434.12614-1-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 86.184.131.21 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH] configure: don't enable ASLR for --enable-debug Windows builds X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.default.ilande.uk0.bigv.io) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.default.ilande.uk0.bigv.io X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Richard Henderson --- configure | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/configure b/configure index f46f433649..a3de75b9f8 100755 --- a/configure +++ b/configure @@ -6144,7 +6144,14 @@ fi =20 # Use ASLR, no-SEH and DEP if available if test "$mingw32" =3D "yes" ; then - for flag in --dynamicbase --no-seh --nxcompat; do + flags=3D"--no-seh --nxcompat" + + # Disable ASLR for debug builds to allow debugging with gdb + if test "$debug" =3D "no" ; then + flags=3D"--dynamicbase $flags" + fi + + for flag in $flags; do if ld_has $flag ; then QEMU_LDFLAGS=3D"-Wl,$flag $QEMU_LDFLAGS" fi --=20 2.20.1