From patchwork Tue Mar 31 03:54:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 185077 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp3243000ilr; Mon, 30 Mar 2020 20:57:05 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuFxw+/gKSB9uYrj3J+wssW2e4b4btp/k7IjEMLuTe+JPa6zavw6Q2YZl0I03xHTNCmwL93 X-Received: by 2002:ac8:719a:: with SMTP id w26mr3170158qto.257.1585627024691; Mon, 30 Mar 2020 20:57:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585627024; cv=none; d=google.com; s=arc-20160816; b=kw8hOrRpmwRj3YtAl88iWtnOtvcxA6CvaP9vUIlHN2Bu+sTmXvxvLmBQR8zZtv5oV/ pgnzU1vyvT4Fp+bSxv4At+aWeaYFm2G8igwK7br9VQv97pxJRt2falcdcIXEyNafZRPm 5onRIB7E067eIXebXLNsJogflRpvaTwbCnBpmsaKDgRTbdEs9pF2XpAKwTuMisUDp9fM wuqvJUfQpvd2vlns/XKAQUc+mVdk9POuqm1sCYks7z2lzNFdb+yIJwXIl/Op0dOCyDMo vFjYTKX7Ja7PrZuz5tWM24wSPboTxS2TzTgHuq7Ym/xHVXGM7Mdq520pVmZM44GVuYrb L5Eg== 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=4fxKsy6khBcHTq1p6rkwxiGqHx6M8cWBd65wf3ZxqfQ=; b=wjvp01tCtxzIBA58nMxVoyjLJm0Ggwu5IRUSMUGjTUeXyZEaE9hfiDflevY8DPjxHx hajAhOBcFyy9+ir0+dFOVuRJoQ68qAszPJLdflP1XNtk21QuATVcnavOY4WvC4T5Mr9h yB8yXfG+5/i5WthnNMN5qhLCRGfy4PqG8VRlio+kqLoqkBiOjlGS4ujDDeqtSPrXQJzk j9jLFNrByOfulGLrLHuSXish62jNquL0ZFvQb1WjqET/BS6drvRC894qh7yqqOMwwYwu AeZDz+DbWVvzPqbmGckoky09Zi9h6LUz3UG7H51gvthLTr963jcSSPPBDSj6MqDX5obB 0wEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=APe97RPR; 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 l53si9568280qtl.355.2020.03.30.20.57.04 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 30 Mar 2020 20:57:04 -0700 (PDT) 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=APe97RPR; 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]:60016 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jJ81Q-0008TR-2C for patch@linaro.org; Mon, 30 Mar 2020 23:57:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60866) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jJ7zZ-0004gM-3h for qemu-devel@nongnu.org; Mon, 30 Mar 2020 23:55:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jJ7zX-0008FR-W5 for qemu-devel@nongnu.org; Mon, 30 Mar 2020 23:55:09 -0400 Received: from mail-pl1-x641.google.com ([2607:f8b0:4864:20::641]:34279) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jJ7zX-0008F4-Qj for qemu-devel@nongnu.org; Mon, 30 Mar 2020 23:55:07 -0400 Received: by mail-pl1-x641.google.com with SMTP id a23so7621386plm.1 for ; Mon, 30 Mar 2020 20:55:07 -0700 (PDT) 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=4fxKsy6khBcHTq1p6rkwxiGqHx6M8cWBd65wf3ZxqfQ=; b=APe97RPRwahsiYzPaIZvKEg7kxEcZ9VN2zoNFNCG+NumkrpRkPHTiU3fbYUfHVdT2z FxeamWMB04LyyqhreI//MuW3TP8oMp1uZGkDZ9/Z6wdDjlqAohr9aa0QSuRDvgwz33Hk FQsrmw2OfiaQ7NLS31HZrtKs5a52JPU/vxpeiO9icIzzMvGDe60rWiqp9wPJEFnNu8mN AIejH6ua01VEtw0+Gb0uNnKRyGCBkngv9McmrpjuuA/6ZDlwPmDbMaZjNitKMols0TeB RuSYD/sVlBdmBLUQSMO0JVX7jWE+NPcVkHFLmRAMHoEeUrzf5PXmGBqHJqXQuKtYvm7q LS5g== 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=4fxKsy6khBcHTq1p6rkwxiGqHx6M8cWBd65wf3ZxqfQ=; b=RNkYqje+T12bGh9sXJ8PFtfFzr/O9bHNwB1mTe6C0APQQcOsiUlFjNPoimnQLTwKoB AnpDgbhdaT4gFXoE7S/ehkTZrTg6DM/im/WBOA95Kuyrd8BBuO2prRiYCTJoYZbFubXe QHS0S7SSCGDRhIpAJc25SK8Zwrd119JFYOddNGCJTnNxrzE2wPrwXcz+qzWSbT9HTO0W GGzHTZffGvge6MH4XuZG4HkVn4+Jumm5nIieW5iD7uYRAcxkq6N08TbdsAipYeV4WiJ9 J6XUXRtvRY4F227AoUVtZw7jV8L8EtSdc1MgrshkPfz8Iouy4EEu1NpPapYtivG7GuSx hQKg== X-Gm-Message-State: AGi0PuaURZXd0WrfW0JzzFJ/BlTIbgzewVk8/mcLOE1s2c0xgM4xTqaV 708hdombqcLnOouskkCl6c3zHpM5H5g= X-Received: by 2002:a17:90a:2103:: with SMTP id a3mr1527798pje.181.1585626906522; Mon, 30 Mar 2020 20:55:06 -0700 (PDT) Received: from localhost.localdomain (174-21-149-226.tukw.qwest.net. [174.21.149.226]) by smtp.gmail.com with ESMTPSA id h11sm11386174pfq.56.2020.03.30.20.55.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Mar 2020 20:55:05 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL for-5.0 05/10] configure: Unnest detection of -z, relro and -z, now Date: Mon, 30 Mar 2020 20:54:51 -0700 Message-Id: <20200331035456.6494-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200331035456.6494-1-richard.henderson@linaro.org> References: <20200331035456.6494-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::641 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, Fangrui Song , =?utf-8?q?Alex_?= =?utf-8?q?Benn=C3=A9e?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= 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. Reviewed-by: Alex Bennée Reviewed-by: Fangrui Song Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- v2: Do not split into two tests. v3: Update to QEMU_LDFLAGS. --- configure | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) -- 2.20.1 diff --git a/configure b/configure index 1cdc439a57..1e622f5acb 100755 --- a/configure +++ b/configure @@ -2129,9 +2129,6 @@ if test "$pie" != "no" ; then QEMU_CFLAGS="-fPIE -DPIE $QEMU_CFLAGS" QEMU_LDFLAGS="-pie $QEMU_LDFLAGS" pie="yes" - if compile_prog "" "-Wl,-z,relro -Wl,-z,now" ; then - QEMU_LDFLAGS="-Wl,-z,relro -Wl,-z,now $QEMU_LDFLAGS" - fi else if test "$pie" = "yes"; then error_exit "PIE not available due to missing toolchain support" @@ -2142,6 +2139,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.plt is read-only too. +if compile_prog "" "-Wl,-z,relro -Wl,-z,now" ; then + QEMU_LDFLAGS="-Wl,-z,relro -Wl,-z,now $QEMU_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