From patchwork Wed Dec 18 03:19:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 181968 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp89759ile; Tue, 17 Dec 2019 19:24:20 -0800 (PST) X-Google-Smtp-Source: APXvYqznSeVwyg4gPhhA2bEc854cINvqJgGSDbLzhVE1g50VeMuEmIbFsrPV07TRDuGx1bSR/c7u X-Received: by 2002:a05:6214:923:: with SMTP id dk3mr370860qvb.96.1576639460015; Tue, 17 Dec 2019 19:24:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576639460; cv=none; d=google.com; s=arc-20160816; b=b/7zAiEIAGm2IidK+6LgyAJoar7hynXaNyqgcSwAclVrGzK4xkyyYgFDq5nXZsMTK0 313PVLTp2ct8qJtufyAykaC6k1Al7HwTTJSaPAznpemvNgdPU9+L8+D3JfWHEsz/JDil Mvvk9pt15/yz9yPbOnrlUK3apZm8q3nuxlNvBov6913G0hK6Auhxn2dV0p9KlQmw+N+J 0nGMGlgNJlPcUvb6tqI+kJKb8XHDHlfOSRXDX8m7JWtQ+yscSTkJosh0uiJ6IyW8c1xK V0FOFqIvVid8le1fasGAITvXrQMUUoJzATAoSPg5p0Jq4FkGlIZvtVFQ+KaQuJsINBDr cXqg== 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=IVABMN0hJYlQXO1glbSSBN/F4pdMjp3DIhyEvyino7c=; b=Kbq4s5hek8odltYhPIGMaL5vTXJndO6PPbbvqE7PMFqwuE9kGrx7PyE6l9Qdz3f8XL czOpEqBUENPK1E90Q0R8Pau4WcIzeosRnh/HruhjPsJWDJNFe6rGeLkLT/fpaII4lu+2 LtnsCOhyeElUO4O9isMGndJMuVOa0hkDReLIlfbTSqXRD2Cf/DXr15icFLv7azKoxqJH vGeEGc/22qc+aF5lGMPeUiy3fAruieJ0Nn7Ket74ijDNucrAbx+FwvGBc0XEw47JfAOD ChOZpLS80NgVrzlxhPGC+1ygmUvU7ciH7A5Ls8hOqNcqQzXSwKpnp+jLIWyATIJ/GFbP NQUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="SSDo/qpY"; 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 12si784018qkn.76.2019.12.17.19.24.19 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 17 Dec 2019 19:24:20 -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="SSDo/qpY"; 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]:49010 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihPwh-0001n8-7j for patch@linaro.org; Tue, 17 Dec 2019 22:24:19 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44268) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihPs6-00049R-SO for qemu-devel@nongnu.org; Tue, 17 Dec 2019 22:19:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihPs4-0002kL-Oz for qemu-devel@nongnu.org; Tue, 17 Dec 2019 22:19:34 -0500 Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]:42840) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ihPs4-0002jj-JW for qemu-devel@nongnu.org; Tue, 17 Dec 2019 22:19:32 -0500 Received: by mail-pf1-x441.google.com with SMTP id 4so385241pfz.9 for ; Tue, 17 Dec 2019 19:19:32 -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=IVABMN0hJYlQXO1glbSSBN/F4pdMjp3DIhyEvyino7c=; b=SSDo/qpYhLTxx5ztb+3nRQGRrHrPeNn6y4BeS90fRI+xFdHV3IXpC8lVNzQ095sSwE 0R82gSpua4KmLmJN1WnTc8PYHeRlLHnv7fT/1GB/R4XqMre5+FhUE/qAjHAMqe83TOin VXWkPEb3X5MZdVg3tfrBL/G7JH4QGDdEgXBc8t1SYWPRhej5bXSaAxfIYB+MP/J0BAVr kC3J/oJwtw+uF9VbKdGZeHMOU4fOfYtMLZOp/czIcl1HxugSBJVnXox/Fl6+85ozjopm Huo/504ckZIvREvtng90CwtPJ4uhbwOfszfudb6EwXs7rxMEKXTPuHL8QJ967OdbNuJ9 ph8A== 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=IVABMN0hJYlQXO1glbSSBN/F4pdMjp3DIhyEvyino7c=; b=DMC1uDRgxHdyIG/rCRdPNko8dpt4KblRlqdCYUCkJsB7CLsmFtf9g5bbcM4xyoEDZw Nws93BUnzUv//+3qpngNXberPOouX4epVZrS6pPjtuEIdXWo6QwSpM5cMKHsVfWoLEfA 2TMPMLVKRj/aoauITNNcq2O0dwaRtF4qXgm7VPQaCRCNVeKh8usvAmqxgfKp4oLAp8cd 4Kr1/97Q+7xHPYqoM6p+/4O9+PWxkrNzlmlLIBbybMsLIEvMyGwnqF59YHQs6jhGN0lK Gh15jgIEEuRHh+EGxfKGVz4YG3E9GtTzzaGiqRNsIkQ85rnLNDnkaK1pFNSt+nDssrmd TH3g== X-Gm-Message-State: APjAAAUXnnJ0BOPlaZTjvhEKTN/ukrfTQ51g4eb0rzWqYQTsThEQUCf6 Bl7zzxOPA/+TnI+DETD68/kTCIOztHw= X-Received: by 2002:a63:4b48:: with SMTP id k8mr326832pgl.362.1576639171240; Tue, 17 Dec 2019 19:19:31 -0800 (PST) Received: from localhost.localdomain ([2605:e000:c74f:dc00:6838:d2b2:17e2:8445]) by smtp.gmail.com with ESMTPSA id k27sm404870pfp.66.2019.12.17.19.19.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Dec 2019 19:19:30 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 5/7] configure: Unnest detection of -z,relro and -z,now Date: Tue, 17 Dec 2019 17:19:18 -1000 Message-Id: <20191218031920.6414-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191218031920.6414-1-richard.henderson@linaro.org> References: <20191218031920.6414-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::441 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, i@maskray.me, berrange@redhat.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" There is nothing about these options that is related to PIE. Nor is there anything that specifically ties them to each other. Use them unconditionally. Signed-off-by: Richard Henderson --- configure | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) -- 2.20.1 diff --git a/configure b/configure index 972ce7396f..f8981eec15 100755 --- a/configure +++ b/configure @@ -2034,9 +2034,6 @@ if test "$pie" != "no" ; then QEMU_CFLAGS="-fPIE -DPIE $QEMU_CFLAGS" LDFLAGS="-pie $LDFLAGS" pie="yes" - if compile_prog "" "-Wl,-z,relro -Wl,-z,now" ; then - LDFLAGS="-Wl,-z,relro -Wl,-z,now $LDFLAGS" - fi else if test "$pie" = "yes"; then error_exit "PIE not available due to missing toolchain support" @@ -2047,6 +2044,16 @@ if test "$pie" != "no" ; then fi fi +# Detect support for DT_BIND_NOW. +if compile_prog "" "-Wl,-z,now" ; then + LDFLAGS="-Wl,-z,now $LDFLAGS" +fi + +# Detect support for PT_GNU_RELRO. +if compile_prog "" "-Wl,-z,relro" ; then + LDFLAGS="-Wl,-z,relro $LDFLAGS" +fi + ########################################## # __sync_fetch_and_and requires at least -march=i486. Many toolchains # use i686 as default anyway, but for those that don't, an explicit