From patchwork Wed Dec 18 22:34:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 182037 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp1284869ile; Wed, 18 Dec 2019 14:39:47 -0800 (PST) X-Google-Smtp-Source: APXvYqyaUKUURmDULSLN5eiL0wl8o6dpMGBbWooatAXqNBtheDIguOjrmY+tRqS5pezGy/pbDMxu X-Received: by 2002:a05:6830:139a:: with SMTP id d26mr5239126otq.75.1576708787635; Wed, 18 Dec 2019 14:39:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576708787; cv=none; d=google.com; s=arc-20160816; b=eLzT4x32GUE8TNcZlRIPo+1qKKNjBSxQpx/da4jZA+UiDiVSk6j0NHVQVnOzM/EMsn 1+26E/9XAJzLprwwGQdx1chRF8xs9zELti9MUuGU1+Hgqg+uhoS6yi1tvPr4u/C5OZgu lX7ftzUXc9aKwJGVC4iEW5ViYPBnLE65dJPKBFvu+bRiIp/VSFVeD4iEdeHvkQRHov1G jFVOrIDKj3j5GiaZmiEl8NSzkSvzdXnvkQ+3ilXHxy5GdIQBEmYKbWPuXJG32z2iuPuW 0nw6fweqCsOFlMXi0Rl3pEB0cur/lXXumyPR27BmEonWe1NMAOEHOCnIrCttuN8bkgKO jCzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=nApRZuyphk20QYsTZlcyHkybuciklnqNiVIxVWJIGrs=; b=EIZuiG1xbr7s8pZqmVlOosZalImSxI2DdymFx73TyUkjb8rS+aCh2hMxx1OxGx3Rja dEz4TciV2qfTDfBPyUNVWiAiNhpNo5jupf3iMpPfrj1ulUZEOF3Z/E9yXZdaWDa0wa5t moC7NEf5Uj++xetpkAM9ELixfC3NQxLmTidaPKw+Pq+iW9Ys76Yz11cUUNOedHRS0lFs RgjaHSPeaMoMhhHEy5e7ab1CIxyVpz7Xkj3HnukbbKGpNc1WQUeUB/dt3aclwf4nDcEQ RgqkDCSL3ASYQEZM0eSPF7fJZNAk21gsvggMAwqtcNnEXUVaNmvpdgHyJQyPbe3VthIa sqUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=peic9dvH; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id m25si2082322otn.208.2019.12.18.14.39.47 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Dec 2019 14:39:47 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=peic9dvH; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:33490 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihhys-0007kp-RM for patch@linaro.org; Wed, 18 Dec 2019 17:39:46 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:54375) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihhuA-0001Up-F9 for qemu-devel@nongnu.org; Wed, 18 Dec 2019 17:34:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihhu9-0003wn-0c for qemu-devel@nongnu.org; Wed, 18 Dec 2019 17:34:54 -0500 Received: from mail-pj1-x1044.google.com ([2607:f8b0:4864:20::1044]:53196) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ihhu8-0003wD-RA for qemu-devel@nongnu.org; Wed, 18 Dec 2019 17:34:52 -0500 Received: by mail-pj1-x1044.google.com with SMTP id w23so1538950pjd.2 for ; Wed, 18 Dec 2019 14:34:52 -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=nApRZuyphk20QYsTZlcyHkybuciklnqNiVIxVWJIGrs=; b=peic9dvHg0FZLS19Thrdo42vWWlyzsc1NRmi9oIJyqhEkzB4O52jcu4+qpBeqPcko8 G3P779Vn9oYD+1087jriTUnZR9YO5uiMAZcyRANWNrLg0FS9Fxmc01bP+AOcvohKUKt8 teFU2jNS3TbmACMZwqFTZzCW6cG7gWrVHY76DSRcfBVG3WbbACwE22G0bajiowLbtzzL EMXzYPJFGdrjd4Jp0prybUjyWIicR4xbrKDUS3QKCvdSQZ0WrcZki3/vhjV2rK1M/48b pnB+WzJFb5gAWgWmlXCJhwZaBWPTwRHU/NFXemGdBcDGOJTZmdNJdo92HxuZqyffHcUM Ya9A== 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=nApRZuyphk20QYsTZlcyHkybuciklnqNiVIxVWJIGrs=; b=C1q4H5G+qSFLPmgVCvArGH+kIyVFA3IJ3S1H2Ocs31q3HnCKhKWXHc9yzI6tLVAw3E pmUwS0fO0aZ6t/JDgJKP3/Cb2qPXLDlvFWcJlsEdr25lHI5jZ2CSSXEoXFIWKANXejd0 B/+ZBq3/p7ksaicEO50c1YVE2PxB7SFux/c4Ddx6GobZ0dZ4tcALRQStQAlbT1MK62Ba 44YBexhO5mAAgwZcESbOsP3Ki29sVuE2oFyAhLfTnVHd+IAK651U2PPVHBvuTxfAGqdn Ya2vS1ZALJj5eCPmQL6qdcMkkdSU3hgITPhI3L10iYU5vSc1o++G2fJ00Qxpr3EbTe8q F/rg== X-Gm-Message-State: APjAAAUYaxeDHst3Uyc+C4i7S0SNQsZZ8PX3LfXLFzT4CvKhXL+RNUd9 QOpkv5FAzh1nbZb+TgDdKtIvsjBwyuA= X-Received: by 2002:a17:90a:f494:: with SMTP id bx20mr5727450pjb.60.1576708491152; Wed, 18 Dec 2019 14:34:51 -0800 (PST) Received: from localhost.localdomain ([2605:e000:c74f:dc00:6838:d2b2:17e2:8445]) by smtp.gmail.com with ESMTPSA id j1sm4627779pff.107.2019.12.18.14.34.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Dec 2019 14:34:50 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 4/7] configure: Always detect -no-pie toolchain support Date: Wed, 18 Dec 2019 12:34:38 -1000 Message-Id: <20191218223441.23852-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191218223441.23852-1-richard.henderson@linaro.org> References: <20191218223441.23852-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::1044 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: philmd@redhat.com, Thomas Huth , i@maskray.me, berrange@redhat.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" The CFLAGS_NOPIE and LDFLAGS_NOPIE variables are used in pc-bios/optionrom/Makefile, which has nothing to do with the PIE setting of the main qemu executables. This overrides any operating system default to build all executables as PIE, which is important for ROMs. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth Signed-off-by: Richard Henderson --- configure | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) -- 2.20.1 diff --git a/configure b/configure index 99faf64a74..7a646ec007 100755 --- a/configure +++ b/configure @@ -2018,26 +2018,24 @@ if ! compile_prog "-Werror" "" ; then "Thread-Local Storage (TLS). Please upgrade to a version that does." fi -if test "$pie" != "no" ; then - cat > $TMPC << EOF +cat > $TMPC << EOF #ifdef __linux__ # define THREAD __thread #else # define THREAD #endif - static THREAD int tls_var; - int main(void) { return tls_var; } - EOF - # check we support --no-pie first... - if compile_prog "-Werror -fno-pie" "-no-pie"; then - CFLAGS_NOPIE="-fno-pie" - LDFLAGS_NOPIE="-nopie" - fi +# Check we support --no-pie first; we will need this for building ROMs. +if compile_prog "-Werror -fno-pie" "-no-pie"; then + CFLAGS_NOPIE="-fno-pie" + LDFLAGS_NOPIE="-no-pie" +fi + +if test "$pie" != "no" ; then if compile_prog "-fPIE -DPIE" "-pie"; then QEMU_CFLAGS="-fPIE -DPIE $QEMU_CFLAGS" LDFLAGS="-pie $LDFLAGS"