From patchwork Wed Dec 18 22:34:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 182032 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp1282329ile; Wed, 18 Dec 2019 14:36:53 -0800 (PST) X-Google-Smtp-Source: APXvYqxk7yv6g31A5IvZM7pnvjWJg/gzXdMwdyAqCj/4nnWS3ITMTk8vWr2XBD4HIsVnM65OPyms X-Received: by 2002:ac8:4515:: with SMTP id q21mr2576534qtn.376.1576708613548; Wed, 18 Dec 2019 14:36:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576708613; cv=none; d=google.com; s=arc-20160816; b=SrfZV150uGG510C1EQziuxeW2l2BmLcJt4EhJJyUFiEoUQyi2ncV7I0u0Ci4WHzebo kSzHepMv4UaT4NzXkxByqNjXkRx549iJSK5V2pZLpVVh2IpqpXALS1HYirhPnIdl+Qez UicA6WRx/lJfsFI2FW55sMYuSInFCDhSlUViCyg+WTfloev9CotD7zZJGMlWRF/i4Scv cIK2sYV3XjusRLg8boxAQOu+VfsqmZj13XZilCpSU/ZdWsafXScBVh8xV50u8kc5vRtx ck9zUBBsBRBBcflMDcbHuC64Cb3KIxy4sOgPjAg7uPW7Ur/D2SiHR7BJx7jYUwoF+pK2 Yw5w== 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=jITgTjhnj7lyoJXWYxFS3Q7b9u1xGvXARpfPJEwIkz8=; b=Q2ysss5Z+XIeEQRwRliBKS3LXN4BIlYpCGoLJVL+HENE63k6PGA2z0piA0cVc9rEk2 ZNKOiO3L5oL2PLV/kyoTY9grN3k8mr1C/pcN3oLoog9ibNte0YwzaR4x1rG5LKZLGQtt TKYo8UGljatQpCtBhZDYiD35KUaSuOFuVKSUV9mZA7PJ2QEHRZdSVKOmmDVUyFQ8nO8H Q5GTxFSrpQNDRFJY6FxMzP793vvdGZsD9/jmG78jCu+coCI1llqijm+dcAsTq32M780N YISamqI7Ub2k404zLSHregPMwf9Zo3lq3mgllib1J+1n+kwMeTwhxuCENOtYgUgWSajs NTCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=O6bFouSC; 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 s8si2798679qkj.85.2019.12.18.14.36.53 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Dec 2019 14:36:53 -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=O6bFouSC; 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]:33450 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihhw4-00048a-Qx for patch@linaro.org; Wed, 18 Dec 2019 17:36:52 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:54401) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihhuB-0001WQ-Cf for qemu-devel@nongnu.org; Wed, 18 Dec 2019 17:34:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihhuA-0003xP-CL for qemu-devel@nongnu.org; Wed, 18 Dec 2019 17:34:55 -0500 Received: from mail-pg1-x541.google.com ([2607:f8b0:4864:20::541]:45853) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ihhu9-0003wt-Ps for qemu-devel@nongnu.org; Wed, 18 Dec 2019 17:34:53 -0500 Received: by mail-pg1-x541.google.com with SMTP id b9so2005332pgk.12 for ; Wed, 18 Dec 2019 14:34:53 -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=jITgTjhnj7lyoJXWYxFS3Q7b9u1xGvXARpfPJEwIkz8=; b=O6bFouSCNjB/kJSo0SlUL9fYP6wBEm0D81Yltp3OMNSyBtBbFfuANiM0v7OMCpa51A L14pvnOtRr3AhqtRh+GcGey/jxN+uhM/d3IYmc8Dp6+EBJ//q47LxdA4/XJcz93bDbdk SyWOZTKPrKNac2je1LDlmkq8Pkvu1vYNHKvRjYJYH/pbuit+H094ChHn3UlY+NfGR1FK 9ojGVZE1DsB5WIGvfCXbODlRMU0tQhfEXdv9SB41OjmRy19+O+H9rvN8uEKvjMfGQSIs jJEVMRb1muo5BPrRZKcy7ZFir5cU2f1EpLaysSpKQZJVdxALyQOQCNcpkN3UU59EAmPc NmXA== 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=jITgTjhnj7lyoJXWYxFS3Q7b9u1xGvXARpfPJEwIkz8=; b=GK6oDWCdOAe3m8XmiChv0NE2AqafAZ8sFw1TzjnlQwjN/ftKc1HG1Ey6DuMazcSibh zP9pNE0Iri5DeAH4LDrqLkYeKXW9LEh1CNZEu/FMJDfCA2kYL70zu6VCugfrOpYEaTfM JxM3SEWU5pE9rs+93+/KrfslSK7kjF9LfB1Q4OU7tasXUocI/eaRZFBPrB2Pi/4EKXdh sS1E6pJFNyf/eP6CnA2Vaq7AYdbDEhrqKHejDUJ3XTFy07mcKg6zPpTXm5JGfth1XrGc KChOoYlj3wA65svEY2GC+Fy+uUc+kY+EWpuFYvVl5X5C1nVftH0LX+tCTpHb/+b5ARhU 960g== X-Gm-Message-State: APjAAAUF2XZTDNv37hHlfOLtCRIZT/8AMQl+pDjMz+LfJViOVFs22NPE 3raJONzLRl2A8cDHyc7IcuV+wfKrJ5M= X-Received: by 2002:aa7:9192:: with SMTP id x18mr5783182pfa.125.1576708492563; Wed, 18 Dec 2019 14:34:52 -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.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Dec 2019 14:34:52 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 5/7] configure: Unnest detection of -z,relro and -z,now Date: Wed, 18 Dec 2019 12:34:39 -1000 Message-Id: <20191218223441.23852-6-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::541 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. Use them unconditionally. Signed-off-by: Richard Henderson --- v2: Do not split into two tests. --- configure | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) -- 2.20.1 Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Fangrui Song diff --git a/configure b/configure index 7a646ec007..2503288654 100755 --- a/configure +++ b/configure @@ -2040,9 +2040,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" @@ -2053,6 +2050,12 @@ if test "$pie" != "no" ; then fi fi +# Detect support for PT_GNU_RELRO + DT_BIND_NOW. +# The combination is known as "full relro", because .got is read-only too. +if compile_prog "" "-Wl,-z,relro -Wl,-z,now" ; then + LDFLAGS="-Wl,-z,relro -Wl,-z,now $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