From nobody Thu Dec 18 19:31:55 2025 Delivered-To: importer@patchew.org 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; Authentication-Results: mx.zohomail.com; dkim=fail; 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; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1578455323; cv=none; d=zohomail.com; s=zohoarc; b=h5SwMdBCYN9rVyvLOVK7OCLnlF2itsJR6r0TyrzgqNDaFn3ch+rUhXQF3xptSa5mgaF19MbFEh+d9Qkdv4UwiFn1S5dinUIcviSW28XHZeuyseYO7WwSQp7kMqmMFqIiwZ3JfLaBA5k7PrVuBma2XE7qJpfLDW/M1fkC2CV3RW4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578455323; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=QROkLTblnGhCZH9GNWCjPQW6ivwBc2Lh/2EXrbymzQY=; b=Ar1XI9xwXwnogKXp/Pvp9asM/XZj5o9uXJtb0JyIL8HnjPewX1tiJCaOEyMUZdLPG9biLdob/z8FlDeQCyQx29H/NNW3Ca2YQHaIbnfdjBUF0JstWLz0jpaNBdy60pe4D00UBMTMqv4aV8xrSaAdqr/1o7lrZDB8xHWG8WVgWqE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1578455323632459.8317074553287; Tue, 7 Jan 2020 19:48:43 -0800 (PST) Received: from localhost ([::1]:35180 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ip2Ko-0006N2-7l for importer@patchew.org; Tue, 07 Jan 2020 22:48:42 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:48662) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ip2I2-0003FA-ED for qemu-devel@nongnu.org; Tue, 07 Jan 2020 22:45:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ip2I1-0002hS-9V for qemu-devel@nongnu.org; Tue, 07 Jan 2020 22:45:50 -0500 Received: from mail-pg1-x52e.google.com ([2607:f8b0:4864:20::52e]:39481) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ip2I1-0002gT-4B for qemu-devel@nongnu.org; Tue, 07 Jan 2020 22:45:49 -0500 Received: by mail-pg1-x52e.google.com with SMTP id b137so869503pga.6 for ; Tue, 07 Jan 2020 19:45:49 -0800 (PST) Received: from localhost.localdomain (alanje.lnk.telstra.net. [120.151.179.201]) by smtp.gmail.com with ESMTPSA id f23sm1198433pgj.76.2020.01.07.19.45.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jan 2020 19:45:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=QROkLTblnGhCZH9GNWCjPQW6ivwBc2Lh/2EXrbymzQY=; b=P0A9Q5nnAMsJwLdGR1IMrrf3H3W/URNvmLTdIOeQGczlWoBJDn7lPPo7j0DnK6K8f/ VPHjrLbDbaOYlzXod9ZqZclZkxekLr6J7Rffbz4xVl4JCheWl2EMoPW3EZA/T0qH+Py4 Jw4LrV485f/slcCZE7gbNf22790EvG/I3CUbTudBJQHiNUdxDX4YDIO84dbPpckvsufk eYitvQmNLFZ/+RxrZBaYLJBL4KbM4o5P4SCF+up2tNLLJPj4N8vWTyUrrLggTtIOIuUU i1F/Zpptpll4BtuKBuAg0unYtswBKh7kyyYU+jntRCvDbIfaOd7ZXU3tyNo/XVTMAYDO t+GA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=QROkLTblnGhCZH9GNWCjPQW6ivwBc2Lh/2EXrbymzQY=; b=Qno9H+dwqvyinkI1gs+Rlmz0hlUC2PoqnzRr1CjpAy42SjW4BOOwcshXtc/9un/bm7 In8pIzRFpQPJ6rEbZ6IuhqmHdYn1p9O7YZUQ7/bTKOV0sap00r9Mb59A3qgT7Ya5yUFD Js+6j6eYLWRvh6I3UI2OtpEbhbQtTwSADc/dA/CR6hmr0dEojcQHkdDj3RqJwX9Zmx2x doCCPURzSJJcscCEvYdsj3J14n7HfGxsGqXZjdOjgNjyfp9skH2aDwl2hP7gLeQRO5WU XlgGxXc3hltVJdPfVK1J6KhfE7gGUQRE6SxPbaUyYZ4Fq3kllG6+zwvzJP6WuBUctwZn hLyw== X-Gm-Message-State: APjAAAWwA32YUNrw/gyln1pAPHhTH8tVvEawPgGhbupN7fPz72AlQB+r yaqgFWHaYFSKDGvntwyI1jEvLJoIJmne+Q== X-Google-Smtp-Source: APXvYqz8fSsZ9S14GMvC6oWjtDnrdAATaB4uFHjJsgLwm8w/0on7fUfwJJtiPfN9+ygJgVFi7bG/7g== X-Received: by 2002:a63:1f16:: with SMTP id f22mr3017809pgf.2.1578455147870; Tue, 07 Jan 2020 19:45:47 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 06/41] configure: Override the os default with --disable-pie Date: Wed, 8 Jan 2020 14:44:48 +1100 Message-Id: <20200108034523.17349-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200108034523.17349-1-richard.henderson@linaro.org> References: <20200108034523.17349-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::52e 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: , Cc: peter.maydell@linaro.org, Thomas Huth , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Some distributions, e.g. Ubuntu 19.10, enable PIE by default. If for some reason one wishes to build a non-pie binary, we must provide additional options to override. At the same time, reorg the code to an elif chain. Reviewed-by: Alex Benn=C3=A9e Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Thomas Huth Signed-off-by: Richard Henderson --- configure | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/configure b/configure index 1dd12edcc3..de2c4867ad 100755 --- a/configure +++ b/configure @@ -2036,19 +2036,18 @@ if compile_prog "-Werror -fno-pie" "-no-pie"; then LDFLAGS_NOPIE=3D"-no-pie" fi =20 -if test "$pie" !=3D "no" ; then - if compile_prog "-fPIE -DPIE" "-pie"; then - QEMU_CFLAGS=3D"-fPIE -DPIE $QEMU_CFLAGS" - LDFLAGS=3D"-pie $LDFLAGS" - pie=3D"yes" - else - if test "$pie" =3D "yes"; then - error_exit "PIE not available due to missing toolchain support" - else - echo "Disabling PIE due to missing toolchain support" - pie=3D"no" - fi - fi +if test "$pie" =3D "no"; then + QEMU_CFLAGS=3D"$CFLAGS_NOPIE $QEMU_CFLAGS" + LDFLAGS=3D"$LDFLAGS_NOPIE $LDFLAGS" +elif compile_prog "-fPIE -DPIE" "-pie"; then + QEMU_CFLAGS=3D"-fPIE -DPIE $QEMU_CFLAGS" + LDFLAGS=3D"-pie $LDFLAGS" + pie=3D"yes" +elif test "$pie" =3D "yes"; then + error_exit "PIE not available due to missing toolchain support" +else + echo "Disabling PIE due to missing toolchain support" + pie=3D"no" fi =20 # Detect support for PT_GNU_RELRO + DT_BIND_NOW. --=20 2.20.1