From nobody Thu Dec 18 19:34:41 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=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1578455289; cv=none; d=zohomail.com; s=zohoarc; b=jGAwtvivX3H65sl8mPdzRMxKeSH6XD4pVsjOLg+Qe168BfmnW3SMTB8KfgyCd4kTunll+F8PXs1xpfotUF0aEsFlCP6e0YWj4Jm6wGkRYjZpx1lpCQqOQBCbfZerMLIcHB6YrtA/AZdqIqkhfmX1ZV/GsQ5iuKPJCdSeUhXge/o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578455289; 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=WAyFVokvd/qDR4nuAyVDRmGp5pg99piONaTKi+oPUR0=; b=d7oUTaOq0uMDF92dDW/iZ3qPqnTeqsr1OUDY43BsHoeIR4GCjo6KTulqIIhRVKqRHtoOy85sCHJ2tcho2SuVsjKdxpDz1OFAa38uHqG9oQ0m+VgnON+oEMa/NjSae+vgCYcnqhwNlUA3mHkowxOp9Gf3JH/ixLfHYsSi6WyLZuY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass 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 1578455289286618.3063136366959; Tue, 7 Jan 2020 19:48:09 -0800 (PST) Received: from localhost ([::1]:35146 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ip2KF-0005iQ-FI for importer@patchew.org; Tue, 07 Jan 2020 22:48:07 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:48716) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ip2I4-0003Jo-Sp for qemu-devel@nongnu.org; Tue, 07 Jan 2020 22:45:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ip2I3-0002k5-Lv for qemu-devel@nongnu.org; Tue, 07 Jan 2020 22:45:52 -0500 Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]:36286) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ip2I3-0002jG-GK for qemu-devel@nongnu.org; Tue, 07 Jan 2020 22:45:51 -0500 Received: by mail-pf1-x432.google.com with SMTP id x184so912797pfb.3 for ; Tue, 07 Jan 2020 19:45:51 -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.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jan 2020 19:45:49 -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=WAyFVokvd/qDR4nuAyVDRmGp5pg99piONaTKi+oPUR0=; b=XSX0wIsTN6Rprrhea0R4b3vHQgYQIZeUwGeWQqqBru0235sJqfM8YgMes6LEFPAzjY vl9W9J8ta5W1IvJKv+cIcvq0mhrrB8bn9lR90lKhQaFr0xfPiCaQyd//mhmR3uoIFhH3 PtljSA9Rv7KZmpgH+3XeftjsxKqBcnLQX6lYy72nZNv2xxq6yS0Quc+0sTot0x2HWbNj w+gZnxrghhtGTAs0uXHpFRZX5NLPebL7ZFy/+j13RnyDjVp0qtGw6kUEzRpfh1EIehnB /wRAaBf8lNmioV3vU62AKolgVLqHmBEi04AlM/Sluxefm5btMrtTRpFToIHpI8fcWJt2 s+dQ== 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=WAyFVokvd/qDR4nuAyVDRmGp5pg99piONaTKi+oPUR0=; b=CjGhaT6+SgcQM/7s1N+L5i6wX10F3E6fnNSmPJA/mALBXWdQ0IzfKb4Y+Wb7VsYX/P 1jwczXz8AgOv+I0wcVjXqPutQjtZ6wR69N6LlpBVN7HDTJtA5mO/U0rNUeWheQ/W0HsF VNxeU6HuKMAwtbV1SRqcABCyxXX1Rdtg6aHgPpEylXDVU/DZAbTW3oTHsaZTI5a6CVCs MIMr/AffvB6hsrP+AafcpoS2d83cqf5rrUNMM8sq2G1LVqZIxHe263vxY+CKRPFOiEtW Ytbnxui7I+7Eb+fIS6BPCCEgQxuAV48u1mby2h47kE8UmYMxTYkhC+OjOYYQujh2R0kT eqoA== X-Gm-Message-State: APjAAAUQ/MfVaRC9+r/MrV83Z+z2tAAwHA5U6ZMeQnzKhjhDGJf+4JB4 QPYJe/Hm4mKkAHbluhLUp3QNPPht9tPfvA== X-Google-Smtp-Source: APXvYqyo/y2l25JmbNfQkGSc1w2aPPLpQGGsNPAUw3XCnrc9H28Pb+HKce6TKkJczk3PZpNcPL4Sdw== X-Received: by 2002:a62:62c4:: with SMTP id w187mr2940652pfb.216.1578455150297; Tue, 07 Jan 2020 19:45:50 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 07/41] configure: Support -static-pie if requested Date: Wed, 8 Jan 2020 14:44:49 +1100 Message-Id: <20200108034523.17349-8-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::432 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, =?UTF-8?q?Alex=20Benn=C3=A9e?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Recent toolchains support static and pie at the same time. As with normal dynamic builds, allow --static to default to PIE if supported by the toolchain. Allow --enable/--disable-pie to override the default. Reviewed-by: Alex Benn=C3=A9e Signed-off-by: Richard Henderson --- v2: Fix --disable-pie --static --- configure | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/configure b/configure index de2c4867ad..94a4b1c848 100755 --- a/configure +++ b/configure @@ -1025,7 +1025,6 @@ for opt do ;; --static) static=3D"yes" - LDFLAGS=3D"-static $LDFLAGS" QEMU_PKG_CONFIG_FLAGS=3D"--static $QEMU_PKG_CONFIG_FLAGS" ;; --mandir=3D*) mandir=3D"$optarg" @@ -2001,11 +2000,6 @@ if test "$static" =3D "yes" ; then if test "$modules" =3D "yes" ; then error_exit "static and modules are mutually incompatible" fi - if test "$pie" =3D "yes" ; then - error_exit "static and pie are mutually incompatible" - else - pie=3D"no" - fi fi =20 # Unconditional check for compiler __thread support @@ -2036,7 +2030,18 @@ if compile_prog "-Werror -fno-pie" "-no-pie"; then LDFLAGS_NOPIE=3D"-no-pie" fi =20 -if test "$pie" =3D "no"; then +if test "$static" =3D "yes"; then + if test "$pie" !=3D "no" && compile_prog "-fPIE -DPIE" "-static-pie"; th= en + QEMU_CFLAGS=3D"-fPIE -DPIE $QEMU_CFLAGS" + LDFLAGS=3D"-static-pie $LDFLAGS" + pie=3D"yes" + elif test "$pie" =3D "yes"; then + error_exit "-static-pie not available due to missing toolchain support" + else + LDFLAGS=3D"-static $LDFLAGS" + pie=3D"no" + fi +elif test "$pie" =3D "no"; then QEMU_CFLAGS=3D"$CFLAGS_NOPIE $QEMU_CFLAGS" LDFLAGS=3D"$LDFLAGS_NOPIE $LDFLAGS" elif compile_prog "-fPIE -DPIE" "-pie"; then --=20 2.20.1