From patchwork Tue Mar 31 03:54:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 185081 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp3244743ilr; Mon, 30 Mar 2020 21:00:10 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtV44eY6brYmqWsYxIEcTCjwwnkye0jsTSy25teaM26sOLqDFXh23fpZN/5Ln08jwHNsP/3 X-Received: by 2002:ac8:4982:: with SMTP id f2mr3318219qtq.38.1585627210552; Mon, 30 Mar 2020 21:00:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585627210; cv=none; d=google.com; s=arc-20160816; b=Cu2jjp5YWepMMAlA96RQG4aacL1fTfC5WpTL0Z5sQqc4QZAkiB0OVnRyIKdlP7KKDP yZteAJGvP9GoUWR8a6C513s9zwBkRjhCZ7kxtbn/RuWteF8mzWwIJOCotVzoX509YgOG X6Tb0UXTY7KR4YdHUC0geNOaHHuaYJOiwFzSY4igatl2jZ02QZzGMbliJeeUOwsDd+kz ei734FNB0sFeAjRJEjMPJHBe3DmOHoh9arQm46g5y71VQ9AGWVdnpDvYllbamlVATjVa KIh6OUamS2/tW0UlI1I/21HCDmJ1HHUbNaiZokEyH5+47b3xvvVROyeNTbNIhA24HMep 0dxA== 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=S+YD6LWo1z5Vsgzq3ypvuc0IEmwxuyzEeq5y1l14e9U=; b=E5THdtH8cZD1yAK5/FWThaJKXF0/p14pE3yGE+uSrJodb2GOYFTVAZw+t/Kk70uYdX g8l6HQmnHRadGfbOgYN03y6JwEC02OzcUjmZ9k3xX5yuOpOxW7ihzhD9foWFoptAOvtb Q7z1SnPFCkv/drHc68JBy1cpkIhQ40ApPLF2uLtKJ6bF3dW1XoTqzvVKg8x39j0BoxDX TZ2SrBOqqFDUsfw+xqNxrqXFx71HxinAVG+M+XDcvxYvvlfyuRtQxotN2nvFQ5mZQ721 3N80fDgfWf8wekqSlh73vRJmO/9SULnp13PomX8/zqob3Su/NAd0pDx0BAeSGpNQmWxg LmTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=F0iVltKB; 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 s71si9830496qke.126.2020.03.30.21.00.10 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 30 Mar 2020 21:00:10 -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=F0iVltKB; 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]:60096 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jJ84Q-000605-1M for patch@linaro.org; Tue, 31 Mar 2020 00:00:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60880) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jJ7za-0004jJ-Df for qemu-devel@nongnu.org; Mon, 30 Mar 2020 23:55:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jJ7zZ-0008G2-7q for qemu-devel@nongnu.org; Mon, 30 Mar 2020 23:55:10 -0400 Received: from mail-pj1-x1030.google.com ([2607:f8b0:4864:20::1030]:40623) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jJ7zZ-0008Ff-2J for qemu-devel@nongnu.org; Mon, 30 Mar 2020 23:55:09 -0400 Received: by mail-pj1-x1030.google.com with SMTP id kx8so509781pjb.5 for ; Mon, 30 Mar 2020 20:55:09 -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=S+YD6LWo1z5Vsgzq3ypvuc0IEmwxuyzEeq5y1l14e9U=; b=F0iVltKBtDusq4Qu78xf8Dgg2AK0wrtUwzFG0F4FqPtqM596JK+LHTw8Ha4bbt7sLI hYL+YYQPcpHlRxNuD5CUG0CHT9kpCwKDlqcjaNsNLjuZ6qJ3XhCfe2I5BGSnFPeCB0Zq EBdvy8ESOP+lIVkvDUmdTwed633e8O7Q7VBPdgIwie6TCYrZNz10MYCCx89tNLIB/BNT DB2b1q6RjCdMf9VfRcrb4Y7AfFnZ0uJvcbqFqzKG2quVWPb0alMgcGKIgr5LwwE9Tsww yftmzybgy//6tR96tasRCDkya9zFKwAi7owLiSI8pO+lEBqU+9XiNyhIHLyQdAAXZaGH iwTQ== 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=S+YD6LWo1z5Vsgzq3ypvuc0IEmwxuyzEeq5y1l14e9U=; b=LhNR0t6ZZLt8v1CGibW0eJWmxIx5ZOtfQCZ9zcNvOLs7mCANl2At9pKs4yC/H5GL2T qoWphpNfZrSVpNuRmhMQrZCGCFRaf57RndTXGjJ72HLn6HrRckCtNdvdNXX6WJhDKEna mffwVJkQyz5WGaATIQI6F0UgPBDSShC6OplcNWVitlJMT35j3JpFdCP7Od1s1XCxHddC nAYI0wta5RNxPPcNppO7cnxyRa3kQlu9mngEHsnPijtE/0pnXCBqL3LN6NWv81YzIogd SuYWZkV/8ACsvefLJEXaY1u4IuFbSLujX0YYQRg3mds8xTSQfvLBoEX5S05aN0oVeYPu 99Dw== X-Gm-Message-State: AGi0Pua/99fER5f/xZNDhSBWFn9+jTtX05ryFYv3o50gi9AVnGSwCC4/ U7GyuKAWGqK0PTSUoL5oAP4no5eUtX0= X-Received: by 2002:a17:90a:8c18:: with SMTP id a24mr1585344pjo.43.1585626907775; Mon, 30 Mar 2020 20:55:07 -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.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Mar 2020 20:55:07 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL for-5.0 06/10] configure: Override the os default with --disable-pie Date: Mon, 30 Mar 2020 20:54:52 -0700 Message-Id: <20200331035456.6494-8-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::1030 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, Thomas Huth , =?utf-8?q?Al?= =?utf-8?q?ex_Benn=C3=A9e?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= 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: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth Signed-off-by: Richard Henderson --- v3: Update for QEMU_LDFLAGS. --- configure | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) -- 2.20.1 diff --git a/configure b/configure index 1e622f5acb..481d5077f7 100755 --- a/configure +++ b/configure @@ -2124,19 +2124,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" - QEMU_LDFLAGS="-pie $QEMU_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" + QEMU_LDFLAGS="$LDFLAGS_NOPIE $QEMU_LDFLAGS" +elif compile_prog "-fPIE -DPIE" "-pie"; then + QEMU_CFLAGS="-fPIE -DPIE $QEMU_CFLAGS" + QEMU_LDFLAGS="-pie $QEMU_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.