From patchwork Wed Dec 18 22:34:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 182036 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp1283845ile; Wed, 18 Dec 2019 14:38:41 -0800 (PST) X-Google-Smtp-Source: APXvYqz4tY3PXu9fcZ97/D9mFEmWCtjnijCtZZ8Koh5GVJrSVbm8wKgINIgvULI5aQl0ZkjXE00A X-Received: by 2002:ac8:6c5:: with SMTP id j5mr4589561qth.284.1576708721257; Wed, 18 Dec 2019 14:38:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576708721; cv=none; d=google.com; s=arc-20160816; b=Cl9ZIdNJ3We4sNFOyjUiSrZCpVzvpGiPVpoyy7rnl0tRpb68qQsdt/LoOP0itXM7Ve SAMRIGULOsB5fP0wyG9lHi2RZIah+veBpDJwhcktZmQdiIBsiu+IfKPodsfxH6jIATx3 OnH8S9XkiFAzJwhPn16QTTJhNu1Q4cQinMnbmhPPK0fYrwXXpRWoqAzhPhcPE709z9ZO d+VGJbuSh+qz22qng7h7YgWfY1bzYfrzsnihytdmeFEaT4QEcS0tSePtf94RvsvbUsLl G2oM3Qdx694TsSWlf6MY29LYdqw5rkyuEY4YHaII+4LIf+QIBHosK2h8mEDjt3cXZPM4 NLuw== 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=U++KNLczq+T0iSXhRIdVMellsLpueqaa5pKBG4Au/Xo=; b=UKk2AEKacXaddxs/xjZMIAizpvIcsEAgfXBxG7iCY60C7I4AMBnl88eM8fTJMY+4xQ QiP5ICEDgkNXSCFSzFeK9V/gszpokZbGgWXj1kBqgfS32BkarDkO0uaLofjjdqsv1wWI hei9OzF4/gjTDRl1Wa8IhSCKotlxY4m0hcoFuS+xws3m6fu2y9PfUVWySC9fjwvXGjxG vTsl3PeZTDSmph8Oa5DU4Q5kFiqTlEFuRuC4Ew5A9q0ID+i4K7pCBVYR232aO+KUYFsH YWdS3wKoby1fx66o8E9MMb+0kSRiw6tPei9S5VJf4zsdD1c+F9GyqiRilFjS9ttj7jJV fWxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=veaVSP0y; 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 t27si2172661qvt.34.2019.12.18.14.38.41 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Dec 2019 14:38:41 -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=veaVSP0y; 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]:33478 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihhxo-0005zk-Mj for patch@linaro.org; Wed, 18 Dec 2019 17:38:40 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:54433) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihhuC-0001YP-KI for qemu-devel@nongnu.org; Wed, 18 Dec 2019 17:34:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihhuB-0003yA-Ir for qemu-devel@nongnu.org; Wed, 18 Dec 2019 17:34:56 -0500 Received: from mail-pj1-x1043.google.com ([2607:f8b0:4864:20::1043]:37215) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ihhuB-0003xm-Cy for qemu-devel@nongnu.org; Wed, 18 Dec 2019 17:34:55 -0500 Received: by mail-pj1-x1043.google.com with SMTP id m13so1545084pjb.2 for ; Wed, 18 Dec 2019 14:34:55 -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=U++KNLczq+T0iSXhRIdVMellsLpueqaa5pKBG4Au/Xo=; b=veaVSP0yzNYOIt1Y7emls/H5UuzaSVzRv8gD+Z7MtnHFigqRMtdc6CVY+d018N9v4G cz7G71bO1yg5cOoKr3zPp7WcZLmD5Grq0ZRQQbk055g7PHDRzqMLJcKzFIRpdQGELbA+ IEgOdBRbgbZy//jvG95aFfg5c+1EgPuserCtV3MNSvIbk7gUuuQHPf8XMYJxz0Y59485 2l+nIUh16JZ9ityDbIQtaPkFWGCVb0fDg4UuiBG5wegYOBwL8BK01UQth/xBY65Aw1jb NRsL/2YvEMAbUrbFuOHS323eO4Z2vwW4mEog5JHzASS2d+owmPBaVNvg5NMtKJQEPLaN 1MQA== 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=U++KNLczq+T0iSXhRIdVMellsLpueqaa5pKBG4Au/Xo=; b=GMPQGNDoVBMuIeD67ucSSXtt8MVLFJ53OlhnbyGU5U5fVu4OzCwwrwfN5ED4aVDjyQ vzBPoBUjYV7GV52qrJ6IQ4V/kHVuwKrtjk1aoILhghzLpsT7dSeh92liubKOpSu/qyCM SjjcN+7NegehSaBCzWSqx1GkgjIbAm7LSUehizsNZ4ZNiKvkpYxAu7erDwefw7u+niEX W4bLb3lthIZRZ6AMEtvcyTSKciVE01C5TvNfMEI+aDQn5gkHsRSxLr2CpSqJy+LIrICF o2zVhWag4uJbPhv6fvipebcgC0+20fyVLloEG2OQ7V6o5nVwaqGY/ytfVGlQJS25XzSc iZgg== X-Gm-Message-State: APjAAAW1ruB5pnL16SXYzNT0bdxwfM5hrOfmc0LPeQSCYaInIGVhuz7e o9S2VRJQlXgeQ4dZs/VjI4s8zy63N+M= X-Received: by 2002:a17:90a:6:: with SMTP id 6mr5808158pja.71.1576708494153; Wed, 18 Dec 2019 14:34:54 -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.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Dec 2019 14:34:53 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 6/7] configure: Override the os default with --disable-pie Date: Wed, 18 Dec 2019 12:34:40 -1000 Message-Id: <20191218223441.23852-7-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::1043 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" Some distributions, e.g. Ubuntu 19.10, enable PIE by default. If for some reason one wishes to build a non-pie binary, we must provide additional options to override. At the same time, reorg the code to an elif chain. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth Signed-off-by: Richard Henderson --- configure | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) -- 2.20.1 diff --git a/configure b/configure index 2503288654..f6ff079fab 100755 --- a/configure +++ b/configure @@ -2035,19 +2035,18 @@ if compile_prog "-Werror -fno-pie" "-no-pie"; then 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" - pie="yes" - else - if test "$pie" = "yes"; then - error_exit "PIE not available due to missing toolchain support" - else - echo "Disabling PIE due to missing toolchain support" - pie="no" - fi - fi +if test "$pie" = "no"; then + QEMU_CFLAGS="$CFLAGS_NOPIE $QEMU_CFLAGS" + LDFLAGS="$LDFLAGS_NOPIE $LDFLAGS" +elif compile_prog "-fPIE -DPIE" "-pie"; then + QEMU_CFLAGS="-fPIE -DPIE $QEMU_CFLAGS" + LDFLAGS="-pie $LDFLAGS" + pie="yes" +elif test "$pie" = "yes"; then + error_exit "PIE not available due to missing toolchain support" +else + echo "Disabling PIE due to missing toolchain support" + pie="no" fi # Detect support for PT_GNU_RELRO + DT_BIND_NOW.