From patchwork Wed Dec 18 03:19:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 181969 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp89903ile; Tue, 17 Dec 2019 19:24:32 -0800 (PST) X-Google-Smtp-Source: APXvYqwAylPfzN1oRA3rrfq6cb23IYhNU7fS7qiXdIhGqW9QWclNEioTZwd5bSuY2zMjwfjkpq38 X-Received: by 2002:aed:24c7:: with SMTP id u7mr374346qtc.335.1576639472771; Tue, 17 Dec 2019 19:24:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576639472; cv=none; d=google.com; s=arc-20160816; b=D/fPion9F+SfvvJYZxl9gGjDf/LaSGsNph5oW/qoEr62Y+x4PFyQLBC+wGrJDAGhSC aXIadV2DcB6TOqMLiXeRrUQx1qOC5O70QKzu9YqETw+5RceQvKOhF8Qu3YbggohqBGX8 Inje3TJp2Y+bzEuob3yDaJgueL0oslhbLVttC3q2iXnvnH3irI4OoFjjuPVEU3jfA8x6 ZLci0TcUL7ZNF2lVkBFHt+xgFzMiHlVVYSK8U4qtflYdWUMWCxcVHKBPQmtje6Vw9usb +4nTSmOEIrN1kbikqzAoMCGJ0GoJyweBQNQLiCKiACSi/l9qA1xDi6KkCoziKtp/WjhG a6hA== 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=o0Btsp+XuBjjSu9t/pnVNpY24aVKknJmQRq/Lz0GJe4=; b=0thWwwIoZMnTcSVlgHzE6bnoGAaQqk3z3oZ/jh9bKwbsSI4ljyUXJrE/svHqnB7FQH 8QdFakeH332EitqeCqzd4jPCug1vlGvi2YxP+vZD55KrUjJXV2ELNyEIJC7VtpsJu8wo 3dS6PD6Q3Vl28Ma34U61++UtO9toO8bb2zF16+r2q/5C96qqg58PVO0w0Zf+29M4YsT2 Ka4nwjq9p6bnYdC/+/G1KzdcjliYV3opgcBFl7y7oIHazu7r/6Gjv+VbFB98PLN7sRj4 2G/mpa38ZrrfxCXpxBWKeo1tnesa4UnCXlAE8AAxC8NvtuT/Qm6fZMacvW2CCJfoaiqG KHdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=d15FKVHP; 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 v79si821537qkb.160.2019.12.17.19.24.32 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 17 Dec 2019 19:24:32 -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=d15FKVHP; 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]:49016 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihPwu-000227-8m for patch@linaro.org; Tue, 17 Dec 2019 22:24:32 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44392) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihPs8-0004CN-GJ for qemu-devel@nongnu.org; Tue, 17 Dec 2019 22:19:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihPs7-0002mi-EX for qemu-devel@nongnu.org; Tue, 17 Dec 2019 22:19:36 -0500 Received: from mail-pl1-x641.google.com ([2607:f8b0:4864:20::641]:42849) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ihPs7-0002lQ-8s for qemu-devel@nongnu.org; Tue, 17 Dec 2019 22:19:35 -0500 Received: by mail-pl1-x641.google.com with SMTP id p9so307256plk.9 for ; Tue, 17 Dec 2019 19:19:35 -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=o0Btsp+XuBjjSu9t/pnVNpY24aVKknJmQRq/Lz0GJe4=; b=d15FKVHPFr6axZ4COedyrHYLMZvtPPJVkLja7j7bZoeOGr5raNuBbsFAcXbY8O9NTM 9yGD7zkpjmYq/xsxIa7Q9I+ybwAtUW3SeunqtG29l/DT2TrmhuyPOCcvxO9LcYaf58UP XDmJHZkugZEyqmW5qxVPCuzR3kUc4eiA/PehgH7qsH2qhQF6wgY24dKbLMwObPP1z2Fh 0shYr0BC63SFVXvQRBx4z2c91JjXElXJOFK+k6WAyxNwgg1YDqfCEhHDEJT85xWPN3C7 0C6xOgBtiPL0KPWlOxefV2cEiIBYFVlz5nNWZKAJRgcbsAt6+3uwKkl922PUZomgi4aW W51A== 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=o0Btsp+XuBjjSu9t/pnVNpY24aVKknJmQRq/Lz0GJe4=; b=n1R+2OqYncuAGLgFMx1y13qzJL/E+gDYmBegkhu8gHM0cT/LCYCunLeguyzeAYQl69 2/MDOnNKySX3IQFeKK8ojrNa0aP/RSvtT1etp8oiLwTWt/eUQ8qTF8LLgKEeN9ORRlIJ TKvv2VCJs+P1WFaaPqaIn0ah4781dMR1TH2mYVx/TBA3dPSrd6nbsRuutRGbcCJhEJVm DpxURoTU677yNszjivH1/krxLDpFPZT0mQ4BAvE8OtdPLWabS6IY+25+gIKliIsjz1xk +qTDndQ2NgUWTKZW7eJuebyNyve37MDWZ/P9OEnRmu1XqHL7eLxiwIyGpWYjG/B1Ac+c sHWg== X-Gm-Message-State: APjAAAUwMDdW/1RS/vCQNbZZ4knj48ubB8wnGLYx+HUL8G4YhWm/5j5U ILOl2eTFVJmMTHoXvjT7DkDhmIc/SUw= X-Received: by 2002:a17:90a:fe02:: with SMTP id ck2mr62354pjb.10.1576639172806; Tue, 17 Dec 2019 19:19:32 -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.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Dec 2019 19:19:32 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 6/7] configure: Override the os default with --disable-pie Date: Tue, 17 Dec 2019 17:19:19 -1000 Message-Id: <20191218031920.6414-7-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::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: philmd@redhat.com, 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. Signed-off-by: Richard Henderson --- configure | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) -- 2.20.1 Reviewed-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daudé diff --git a/configure b/configure index f8981eec15..1645a58b3a 100755 --- a/configure +++ b/configure @@ -2029,19 +2029,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 DT_BIND_NOW.