From patchwork Wed Dec 18 03:19:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 181967 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp89625ile; Tue, 17 Dec 2019 19:24:09 -0800 (PST) X-Google-Smtp-Source: APXvYqwm81fs55JErzQms4N1AHZCCY7AT2spNN0jiB0iKp2VbWgab8dWZXD07PYuSk5g7ddBDKCo X-Received: by 2002:a0c:b2c7:: with SMTP id d7mr340046qvf.111.1576639449272; Tue, 17 Dec 2019 19:24:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576639449; cv=none; d=google.com; s=arc-20160816; b=Lrlz8NH3t6g4xZex4o5yDZei7Jq6amfYj/bBra9YLeJhS2T3fF1g1t7zo5MnRjkpb8 0cqwFEAkFGvMdGrX3oeSHwq4EgKHsRypf4xpsjZ//LSxa52OFmNQWMluXMbOwpViGADr pNP1gg2/Q1olvJymnqBbJnRSBMASpXZAizAyC5oqwlkW2kCqqhJM3EG97dzwWHdi9xto XfBl/xh2QVccjKnDXtuNbBRgNz3Hj9N06tdM0GXrKsElsU42Jx8x+/BgrBfsFSDRJU14 6NEfUDCDWtqwBX6ISWXCnMUD/XpKGJnhRXDYdQrnWgGDdW+3LxZCh8U1jFhUSEOG2szp cl6A== 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=+Toe6+kf85085QGBznhMe/ZC3IHb6MH8qdiKw5XlMFI=; b=PjNRC0k3H361lZni/0NY2Q0ZqVSHMO2/FKQ0ZD3m9rO1p9fSx/4/Nn2h4eizxYVtdc iLNmppIfzPyuTHynSHowjENGJQQBMfjjrr9S0ZJVD4j9ROw+egtr3BvWGpbt174jqCB2 va8BHj5TsvI/2onylfM9ZWbvcieXxHblRXMQau9VNSMHCLqpW6ZlTo38aNxYeuK2VTPG /yeflz3BA61CcJds2RP5H5hn7z8020CHKUiV2RE4DTnGApQfflEkbW/eLJD5oPyncJRM cLnO+7kMK17dfI30RJ//kNUT6QJHizbH+b8XB8AbLaMElv+0RHasxKCjVyl7+z3diY9Z fJzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=ffmarJqS; 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 i11si556874qvt.120.2019.12.17.19.24.09 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 17 Dec 2019 19:24:09 -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=ffmarJqS; 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]:49002 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihPwW-0001WL-PX for patch@linaro.org; Tue, 17 Dec 2019 22:24:08 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43923) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihPrz-00042w-QA for qemu-devel@nongnu.org; Tue, 17 Dec 2019 22:19:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihPry-0002dn-Ld for qemu-devel@nongnu.org; Tue, 17 Dec 2019 22:19:27 -0500 Received: from mail-pg1-x542.google.com ([2607:f8b0:4864:20::542]:43048) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ihPry-0002cz-Fv for qemu-devel@nongnu.org; Tue, 17 Dec 2019 22:19:26 -0500 Received: by mail-pg1-x542.google.com with SMTP id k197so435061pga.10 for ; Tue, 17 Dec 2019 19:19:26 -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=+Toe6+kf85085QGBznhMe/ZC3IHb6MH8qdiKw5XlMFI=; b=ffmarJqSOoWRRJ5Qixi6fN4Y6Fx0Lh9cOfGrdDRa0B2w/drHIBmGHpPU018P36NEx+ LJDfFwiMk+GWmrjheD59oPdZ7/Erer1TPxuWR4SUtHwiiJX/ATSccpifVIOucGMQSeTz 1m+BH7kq5AT33MXSEah3M+lnQu7ib6TFHb0SiAB5pahjKVTmKdLBkldDqX5dRNsBeJFl GBo2qZMSXttsKjpGixXbKYvkGvhkPtS2d9oLhIxeblfP+Xs/i8bOIBvzsgXGr1Od/Y7A jBS5cKBvJT10/ObOuCPMfF1XKAb4YalkR5BoFejcrq1JYLejccn1gQxGry3Gq65GnOpu D9fw== 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=+Toe6+kf85085QGBznhMe/ZC3IHb6MH8qdiKw5XlMFI=; b=adJ4oZE66NZ8XdKgNporQim6QVnvzuG6VjHnpdZmynOY0NyCbdTjUEimRFzQW5RJRi r21qAs/mRK9AiDfu2sJ7u8s1NW5x/Hrb3LLjFRPW2tSdgZCtVugjxh824yDt2v5UK8pi tbj/lH0BdjozTcA3eTO+dOoR7hwSt543NFEc8wsJGXyxKFwDI2B37L8RJp1uHPqIoTny RjIlJ/M2sIfQPjK6ZrhOd84+H0SVZYMJ6sf9qHdMXIXTNWSK5BPD30BVIashXNZtJtjr U70RR1x56daqGay2vYBzkM3WSIfD1aYtL86+PmD23bS89yMRWJYWlJWXuMp+d2fegMvl Z2WA== X-Gm-Message-State: APjAAAW7UmhhQx7mgBMdgfrvF0NoNKkKPRI0WBA/De45n2T1js6xaIq4 Cfisc4mZl+/76/Pp1fM7wuk8Fvpt8hg= X-Received: by 2002:a63:4d5e:: with SMTP id n30mr288667pgl.275.1576639165011; Tue, 17 Dec 2019 19:19:25 -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.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Dec 2019 19:19:24 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 1/7] configure: Drop adjustment of textseg Date: Tue, 17 Dec 2019 17:19:14 -1000 Message-Id: <20191218031920.6414-2-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::542 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" This adjustment was random and unnecessary. The user mode startup code in probe_guest_base() will choose a value for guest_base that allows the host qemu binary to not conflict with the guest binary. With modern distributions, this isn't even used, as the default is PIE, which does the same job in a more portable way. Signed-off-by: Richard Henderson --- configure | 47 ----------------------------------------------- 1 file changed, 47 deletions(-) -- 2.20.1 Reviewed-by: Thomas Huth diff --git a/configure b/configure index 84b413dbfc..255ac432af 100755 --- a/configure +++ b/configure @@ -6292,49 +6292,6 @@ if test "$cpu" = "s390x" ; then fi fi -# Probe for the need for relocating the user-only binary. -if ( [ "$linux_user" = yes ] || [ "$bsd_user" = yes ] ) && [ "$pie" = no ]; then - textseg_addr= - case "$cpu" in - arm | i386 | ppc* | s390* | sparc* | x86_64 | x32) - # ??? Rationale for choosing this address - textseg_addr=0x60000000 - ;; - mips) - # A 256M aligned address, high in the address space, with enough - # room for the code_gen_buffer above it before the stack. - textseg_addr=0x60000000 - ;; - esac - if [ -n "$textseg_addr" ]; then - cat > $TMPC </dev/null 2>&1; then - error_exit \ - "We need to link the QEMU user mode binaries at a" \ - "specific text address. Unfortunately your linker" \ - "doesn't support either the -Ttext-segment option or" \ - "printing the default linker script with --verbose." \ - "If you don't want the user mode binaries, pass the" \ - "--disable-user option to configure." - fi - - $ld --verbose | sed \ - -e '1,/==================================================/d' \ - -e '/==================================================/,$d' \ - -e "s/[.] = [0-9a-fx]* [+] SIZEOF_HEADERS/. = $textseg_addr + SIZEOF_HEADERS/" \ - -e "s/__executable_start = [0-9a-fx]*/__executable_start = $textseg_addr/" > config-host.ld - textseg_ldflags="-Wl,-T../config-host.ld" - fi - fi -fi - # Check that the C++ compiler exists and works with the C compiler. # All the QEMU_CXXFLAGS are based on QEMU_CFLAGS. Keep this at the end to don't miss any other that could be added. if has $cxx; then @@ -7897,10 +7854,6 @@ if test "$gprof" = "yes" ; then fi fi -if test "$target_linux_user" = "yes" || test "$target_bsd_user" = "yes" ; then - ldflags="$ldflags $textseg_ldflags" -fi - # Newer kernels on s390 check for an S390_PGSTE program header and # enable the pgste page table extensions in that case. This makes # the vm.allocate_pgste sysctl unnecessary. We enable this program From patchwork Wed Dec 18 03:19:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 181970 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp90600ile; Tue, 17 Dec 2019 19:25:21 -0800 (PST) X-Google-Smtp-Source: APXvYqzTnD9j/uB78uY6wrheEnlzKzoRk2zLPvmVixuI1pMhQzfKaUnBK2sR51tmnBkUSchc/sCP X-Received: by 2002:a37:354:: with SMTP id 81mr357874qkd.276.1576639521573; Tue, 17 Dec 2019 19:25:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576639521; cv=none; d=google.com; s=arc-20160816; b=VLSatvZuKin8rKmqniTKRUdqkQTACpfK0SuHMsnXXLdGTVcO3DgnfEp2+3KKTrzEe7 KHw/bYcLvNfXX+w5UsRmwnBJovHdB7ZmCy1TNp+hB/v/wgZhYbL7sUw5E5qNu6didree JlsgDeH3HGNr//4PVr7dx3rdsOX39mTeyfepzEYMn/otQ5Es5LI+PFmsrhYGpSDDCcuS hm8tie/j0voiVn24qAJHJyzrniI6X791vPLyUvRHRTY4TQQ1Z6G+bxLdEI1haVGenTqs I2f2Ym/coUvjdulPB+SF3Sca+46L/L5Qz7DtgHp4syv+aFjNL/1UNSh0qR4muy7u4oSd dXLQ== 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=h8PHcS1tBBTVD9W0+xFnEcSw+EjWnL99+V49q3i39H0=; b=i5rhMXHwf0V2fjqa6opR4dqwICAncGnfRgfgjKI58ilTYIT863yULVYg+ju/EVOT+/ c7/iECpsJ5Dt883GywObFeZxW0rz9KQaTPz6zEo7V3uxweONcwSoLTAtLNlPCoWlcenq xiaoeOglJnHkoYS1pqrhyPYLHgggumA91/6XaYwIXxp09+WU6hbd8U4nLTycAxkEb5dq pGQYEQv/PmfWH4qLR1tmFL7rpojLgGGuOWFpPyrQ0/FGItZtPc2ORktq5a6uVkDOi8U8 dJ+r+AUFL6rdmD5CEcKvULGBiHMxrutckp2bqRXDm+r+sIYTObDpg9PKiEdQTd50PcOy P02g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=TiDiSH0C; 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 d26si794165qko.68.2019.12.17.19.25.21 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 17 Dec 2019 19:25:21 -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=TiDiSH0C; 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]:49026 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihPxh-0002u3-42 for patch@linaro.org; Tue, 17 Dec 2019 22:25:21 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43999) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihPs1-00043A-9F for qemu-devel@nongnu.org; Tue, 17 Dec 2019 22:19:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihPs0-0002fY-28 for qemu-devel@nongnu.org; Tue, 17 Dec 2019 22:19:29 -0500 Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]:43050) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ihPrz-0002eT-Sy for qemu-devel@nongnu.org; Tue, 17 Dec 2019 22:19:28 -0500 Received: by mail-pg1-x544.google.com with SMTP id k197so435102pga.10 for ; Tue, 17 Dec 2019 19:19:27 -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=h8PHcS1tBBTVD9W0+xFnEcSw+EjWnL99+V49q3i39H0=; b=TiDiSH0CzvqeeXBY6u5uqYBDzw+ukp20Troi0DWC5YiyN9eps5Gk51TO1dEiYqrALj y+3JWVmb1TKwsyywrqz9TxjdvoJqf7SFodHAdib8JlrLi5flSNaJ80r0+CBfN/6NoqPp +tZq27GLropxlZVQ44Jx/vI186h6KxmxPeGR3aTDxj69vEd60dUYz02S4O3DfR57UpKr 8oplMbNfv0xhBOMI1yRs2RlnKX8/I0Mg1sY8Q0T7DvZHxXsdCqJPIEfKJV+tEcnmhFbg Yws+Od9OPrtaWnS53f9qXtBiybDV3n1h064LITPgWv2qElmK6pbwIu9M5xzgstoNgUNp 6+uA== 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=h8PHcS1tBBTVD9W0+xFnEcSw+EjWnL99+V49q3i39H0=; b=Y6xUHWVhZtCUIMmtQV2/HBg73UanmpxrGWvS71ePCvN4pSyjrOdAn+sZk2CWl8QKQk 7GQ1JzImyi8iQynY4hLVz4n2PDprWsOdmagmiTbUBoC0qNy1JVq2AQF1EidXkj8s3XAz KMBv0sQiXwp5ytHczPs1x49RjEymAW3JGVf/z69rQ2TCON1yVDfitPHSB/STw4VfH48+ WefGTBTmNa8ncDBhQSHggOq2zajJNLs2XZJwn/CF97XI80b0uPN9FfMn4lcCCxfmsGNn 7CSxBo48IXaabOZ0oZwoqp3Jo1269vXVL2jFUpoUSsYM0yt28/4v/H/BaHkbsi9O0qRU K/2g== X-Gm-Message-State: APjAAAXPS+wn8wciLfPTtLmks3cu+556Oagghuk4uaDjHmSXzIZ2EFSs lKjFJ0YNeWKOvzhEOgCJHAhJhEQF0aI= X-Received: by 2002:a65:538b:: with SMTP id x11mr273892pgq.395.1576639166549; Tue, 17 Dec 2019 19:19:26 -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.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Dec 2019 19:19:26 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 2/7] tcg: Remove softmmu code_gen_buffer fixed address Date: Tue, 17 Dec 2019 17:19:15 -1000 Message-Id: <20191218031920.6414-3-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::544 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" The commentary talks about "in concert with the addresses assigned in the relevant linker script", except there is no linker script for softmmu, nor has there been for some time. (Do not confuse the user-only linker script editing that was removed in the previous patch, because user-only does not use this code_gen_buffer allocation method.) Signed-off-by: Richard Henderson --- accel/tcg/translate-all.c | 37 +++++-------------------------------- 1 file changed, 5 insertions(+), 32 deletions(-) -- 2.20.1 Reviewed-by: Thomas Huth diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index 9f48da9472..88468a1c08 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -1032,47 +1032,20 @@ static inline void *alloc_code_gen_buffer(void) { int prot = PROT_WRITE | PROT_READ | PROT_EXEC; int flags = MAP_PRIVATE | MAP_ANONYMOUS; - uintptr_t start = 0; size_t size = tcg_ctx->code_gen_buffer_size; void *buf; - /* Constrain the position of the buffer based on the host cpu. - Note that these addresses are chosen in concert with the - addresses assigned in the relevant linker script file. */ -# if defined(__PIE__) || defined(__PIC__) - /* Don't bother setting a preferred location if we're building - a position-independent executable. We're more likely to get - an address near the main executable if we let the kernel - choose the address. */ -# elif defined(__x86_64__) && defined(MAP_32BIT) - /* Force the memory down into low memory with the executable. - Leave the choice of exact location with the kernel. */ - flags |= MAP_32BIT; - /* Cannot expect to map more than 800MB in low memory. */ - if (size > 800u * 1024 * 1024) { - tcg_ctx->code_gen_buffer_size = size = 800u * 1024 * 1024; - } -# elif defined(__sparc__) - start = 0x40000000ul; -# elif defined(__s390x__) - start = 0x90000000ul; -# elif defined(__mips__) -# if _MIPS_SIM == _ABI64 - start = 0x128000000ul; -# else - start = 0x08000000ul; -# endif -# endif - - buf = mmap((void *)start, size, prot, flags, -1, 0); + buf = mmap(NULL, size, prot, flags, -1, 0); if (buf == MAP_FAILED) { return NULL; } #ifdef __mips__ if (cross_256mb(buf, size)) { - /* Try again, with the original still mapped, to avoid re-acquiring - that 256mb crossing. This time don't specify an address. */ + /* + * Try again, with the original still mapped, to avoid re-acquiring + * the same 256mb crossing. + */ size_t size2; void *buf2 = mmap(NULL, size, prot, flags, -1, 0); switch ((int)(buf2 != MAP_FAILED)) { From patchwork Wed Dec 18 03:19:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 181964 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp88139ile; Tue, 17 Dec 2019 19:22:06 -0800 (PST) X-Google-Smtp-Source: APXvYqxujFB8A84s9ml0KZdydB6F3unaPxFSMUuRuCKBMetSmw4ohox/FwrlQl5LAuwl68r9dsYL X-Received: by 2002:a05:6830:4a7:: with SMTP id l7mr138747otd.372.1576639326726; Tue, 17 Dec 2019 19:22:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576639326; cv=none; d=google.com; s=arc-20160816; b=e+DIh2lb7uvAsUfGL5pEovLGnkein3f2c9S2sPLwIIOEGiS5hxwa/DwA0Ce+U8ktR/ OM1SKDdA1SU9RJijEncaXxvQBGqaWdl2i9shk2me3S9mNSTofd5Em/tsEpxMulfN0W0z TeptqVlhKEbl8c0XzoB8EgOMPfFxAGWe6+rpykpV5nN+XQ68F/yacsOhEEVcyhpdiCh2 XxWimDofPlBL9ba+n90EeWaV6FTfzHIp/Zo5/iXqK4t1qCDvpu1rPT4TwiW12aIXLWp4 lJHmqNlc8mNNNSR/IACHM0lusCEDARoLo8hGFZ7Io2AECIk5qUU8lkNnxMkNlNAnqHEe nWQA== 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=U37ZVea/IPVlUTlCbim6MG1bzwxdwI6SbTuQBxQprmQ=; b=e0DY4bjd992bvpxHQf26LgNsIQySB5XcaY6r9F/1GZ9tW0+Ry1VlggC7rvXiq4PWoN FPBstLnbfIYHF0aHmYEa+hF3i4f7alb2mJe/+QQkIJXnGa+Kk3TUUyNJyD6GsSi9UVX9 KVsgP0b0rHTztsVJrJwt+p8UsDvj1MzN+Fhpc6tucJcZT/g66WkBDwnM4OE0S35FsKjo 6xIJm5+jBN3+mtYluk7fulDdsfnOs4Msj2TJwjapeAEeCI7+jMpyebgDvkwB4qebak3O FqwEojtCVpece3N1/38c0uHhgwZiNmSRihmw1+yV3rK/7aiYGF259/+RrxDCQpSO2wRf bd5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=O4sqalGr; 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 d140si568939oig.269.2019.12.17.19.22.06 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 17 Dec 2019 19:22:06 -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=O4sqalGr; 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]:48966 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihPuX-0007Mh-IW for patch@linaro.org; Tue, 17 Dec 2019 22:22:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44060) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihPs2-00044Z-HR for qemu-devel@nongnu.org; Tue, 17 Dec 2019 22:19:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihPs1-0002hF-KB for qemu-devel@nongnu.org; Tue, 17 Dec 2019 22:19:30 -0500 Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]:41927) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ihPs1-0002gF-F4 for qemu-devel@nongnu.org; Tue, 17 Dec 2019 22:19:29 -0500 Received: by mail-pf1-x441.google.com with SMTP id w62so387819pfw.8 for ; Tue, 17 Dec 2019 19:19:29 -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=U37ZVea/IPVlUTlCbim6MG1bzwxdwI6SbTuQBxQprmQ=; b=O4sqalGrVEpEgA/aYiYZMesdGTR5zzjQ9y+d7OjxUqB7mb0KeKZezCUHmhHRyV6c7P QaePnNjrKRMhvBwd7jV0G06PCdsNPsG/w81xR4fC7r+jhZltfHUOcQmi+fbP+ohUoleD cBPgegVi3Ua9TlEER7EeS57W/BFaprT4qJ78r07pwe++hLPYR5NwYN7tahvLqUf2+PfL ZeelmluZ/DlQiHZyKclSqD2JOIz3IlqWKmvxLN2U41QdvWi3L5u5hO2wX4R7v8rUIwLl kTxF2e0PMHKYtzzTG4SO79QnaJHO7at+0NBW3YO9VwqZmup6pUE/pQu+Chdlb8ceftvB xs0w== 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=U37ZVea/IPVlUTlCbim6MG1bzwxdwI6SbTuQBxQprmQ=; b=RLDnURzqVYUZNq/Z43poRImuj4fp0nC1dYAxGkOxuv0469HIPN6a5SBFiUsxM5gXd9 x/G6rSzMwDZCtWG5zTmPBTP9snXFfc9wjzWznv8wRikwj6JGy1Zur7pWZ2pCgmdMYlp3 uEk5fR3fqt/jACU8cyKgY1NuL6yESSqeNdc+CAbOk1wXfWF09S0wVs2BfthkcF83BtKy mymCFpXOYIfWIzpXbmPQrh1m5obPMbJJ/oXpwSbPeSLHBfv9R3B0iKwJhpsWSYCksRbW rEI8p2uf8LToFp5R8+keNjinf9JkpkKfQ4QWPJAMdFlEr6XCjLREbJckTs33s5BhW9By uvYA== X-Gm-Message-State: APjAAAUyz4uqET0DkBxJgnQHGTdPmSV7Z/oIYoDdF9pbIffdEJPHS8qc O2LblwcywrwIlT70PtjiM2mg/+f5jZ8= X-Received: by 2002:a63:3f47:: with SMTP id m68mr276712pga.411.1576639168087; Tue, 17 Dec 2019 19:19:28 -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.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Dec 2019 19:19:27 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 3/7] configure: Do not force pie=no for non-x86 Date: Tue, 17 Dec 2019 17:19:16 -1000 Message-Id: <20191218031920.6414-4-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::441 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" PIE is supported on many other hosts besides x86. The default for non-x86 is now the same as x86: pie is used if supported, and may be forced via --enable/--disable-pie. Signed-off-by: Richard Henderson --- configure | 10 ---------- 1 file changed, 10 deletions(-) -- 2.20.1 diff --git a/configure b/configure index 255ac432af..2fb4457d7c 100755 --- a/configure +++ b/configure @@ -2012,16 +2012,6 @@ if ! compile_prog "-Werror" "" ; then "Thread-Local Storage (TLS). Please upgrade to a version that does." fi -if test "$pie" = ""; then - case "$cpu-$targetos" in - i386-Linux|x86_64-Linux|x32-Linux|i386-OpenBSD|x86_64-OpenBSD) - ;; - *) - pie="no" - ;; - esac -fi - if test "$pie" != "no" ; then cat > $TMPC << EOF From patchwork Wed Dec 18 03:19:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 181965 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp88230ile; Tue, 17 Dec 2019 19:22:12 -0800 (PST) X-Google-Smtp-Source: APXvYqwDRCVoqMWJ4NRVEjASqZ8TN9iPzukTqXybVY94FItPCXXXRBsG2s6XvrxsetecV9+D/Uqy X-Received: by 2002:a05:6830:147:: with SMTP id j7mr189706otp.44.1576639332782; Tue, 17 Dec 2019 19:22:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576639332; cv=none; d=google.com; s=arc-20160816; b=YLwOij1RSY6X2KHsjihxlFWGDqD7DKzMRjml5+NMZ8i/IKdMDQayMFQ7OGoO3ik2Vf VSjU0X6E0Lw+WSWirYLQ4DOVzJM+iCVmbuOXWXPh/fd+62ekWzC90o6fy54OGs2hwaPF Qjy2EhRNyG0HrFO81Cst673VYkCda1SEjfLla+TOjmYUS6ihKDxnLkNLWbTCleFmi8// gTvulzRlKy1WecIAHS4WhxnohNx55zCEZO2gR4JFgKTHDxS/3wyNXJUvH+k4oGEQucyU PFvyKUfdbKys9zNhW2pypNki7sXMuZ3IhfGUacrrtTfwPb0jxT7bDsrOHjpUK/K7fY/L eVeQ== 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=SWmO1kQqi8bfr8nyMbMf0tsp3eELnVxdGpB7UInxtBo=; b=ry2KwZN4v42Ap9GrhTdpEKztqti0hJftMPgVKfIcIceKnjHuJVCl5837tn6zoL0kSw /+hgK3iLx5ISMK5KNE7A40gUAZKnXGpqS0norE43QIX7/2dZiTxNdkyXe7cvVq41GdFL KFMfVmfjjoDdgloiGXsO+MTiKsHbm1hgCfdClGw55LpDqf7VXbw6AjACXrhe1o6haBSF RqLG8673u/Iqh8VadsKBGiQaZ5sN7fyzIWs0MuOhCdO1Q+yjTFwiDEubWyeRAXeKwaX0 ttNGEb9uslXs7QDIjbAfmmEfBtVH5Fj4NRstp9jqok5dWYJuj/l4LWTygF+c75oHPYMr FFyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=EGVqbIdR; 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 n11si563224otf.125.2019.12.17.19.22.12 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 17 Dec 2019 19:22:12 -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=EGVqbIdR; 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]:48970 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihPud-0007W4-Kc for patch@linaro.org; Tue, 17 Dec 2019 22:22:11 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44144) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihPs4-00046m-6N for qemu-devel@nongnu.org; Tue, 17 Dec 2019 22:19:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihPs3-0002ic-71 for qemu-devel@nongnu.org; Tue, 17 Dec 2019 22:19:32 -0500 Received: from mail-pf1-x443.google.com ([2607:f8b0:4864:20::443]:45480) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ihPs3-0002i3-1j for qemu-devel@nongnu.org; Tue, 17 Dec 2019 22:19:31 -0500 Received: by mail-pf1-x443.google.com with SMTP id 2so378268pfg.12 for ; Tue, 17 Dec 2019 19:19:30 -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=SWmO1kQqi8bfr8nyMbMf0tsp3eELnVxdGpB7UInxtBo=; b=EGVqbIdRGvMaQXdeWAJtbMzNpZwwWlC76YQ0QG9FY3huacb+X6IX14INLFeYaFFwOh JvDxBO4K1V1D8dZW15AzVdFJqdhyEpXB+Wb9GnllpzRhgquuxARiijJ62HM8XO6iHP4M EIlkNdVZBMBDtNr0tGoUQLtg++K45HjFayOfSmpdkabTvkglk1KM2bYXilGwYZM61AV3 PD1HK3RjOMF/v1GTp+oBIFFOYmd0U3wuvKVNpOahK4VjjVPbsncmjSGz0Hn0EUEvEDDx Sid6xMrg6u9o8rj88+606e1zICTGUYOrM2SeeQhZicMS7yylfcOFbCi1J5O7fs+NpX1M Z66w== 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=SWmO1kQqi8bfr8nyMbMf0tsp3eELnVxdGpB7UInxtBo=; b=avyeDd54soICOOErE+becu9JHICnaHw7S1QTO6s3LH+2pB+xByob4W0I+K4Du+RimN DRtr4KpVoBatvGth60pmeTGoKMCETodt/FdKoLGv/KcXIjVFTrR/56jHisdXqr7urPGU 2IY9QeLC4pJDGa2I8hFILTmwrmRFJBvguKjwPZc5qoLGusfVX2U5a0fVKnlZFWSVcwcW TgYyNRLQ/7XEP4WfuaejUxnxHoh9xrPnnYMI7Ida9abJ7qSzYfxOaAw/RCnd20tUzd+F IVwhX329ja4jNxx3Q2/SGGzcSTa/HwCXBpt+y27ijjYlcNXBPYSsFD8gf7zXHfd8CMSV nIOw== X-Gm-Message-State: APjAAAXpekkiBewtzJLon5ox6ab56BTYrq1W1mbJybUILUGBjyWxBEVh bZKWLgeVOtfhSntTZf9Rg4qYfneg5iE= X-Received: by 2002:a65:49ca:: with SMTP id t10mr324831pgs.37.1576639169720; Tue, 17 Dec 2019 19:19:29 -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.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Dec 2019 19:19:29 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 4/7] configure: Always detect -no-pie toolchain support Date: Tue, 17 Dec 2019 17:19:17 -1000 Message-Id: <20191218031920.6414-5-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::443 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" The CFLAGS_NOPIE and LDFLAGS_NOPIE variables are used in pc-bios/optionrom/Makefile, which has nothing to do with the PIE setting of the main qemu executables. This overrides any operating system default to build all executables as PIE, which is important for ROMs. Signed-off-by: Richard Henderson --- configure | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) -- 2.20.1 Reviewed-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daudé diff --git a/configure b/configure index 2fb4457d7c..972ce7396f 100755 --- a/configure +++ b/configure @@ -2012,26 +2012,24 @@ if ! compile_prog "-Werror" "" ; then "Thread-Local Storage (TLS). Please upgrade to a version that does." fi -if test "$pie" != "no" ; then - cat > $TMPC << EOF +cat > $TMPC << EOF #ifdef __linux__ # define THREAD __thread #else # define THREAD #endif - static THREAD int tls_var; - int main(void) { return tls_var; } - EOF - # check we support --no-pie first... - if compile_prog "-Werror -fno-pie" "-no-pie"; then - CFLAGS_NOPIE="-fno-pie" - LDFLAGS_NOPIE="-nopie" - fi +# Check we support --no-pie first; we will need this for building ROMs. +if compile_prog "-Werror -fno-pie" "-no-pie"; then + CFLAGS_NOPIE="-fno-pie" + 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" From patchwork Wed Dec 18 03:19:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 181968 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp89759ile; Tue, 17 Dec 2019 19:24:20 -0800 (PST) X-Google-Smtp-Source: APXvYqznSeVwyg4gPhhA2bEc854cINvqJgGSDbLzhVE1g50VeMuEmIbFsrPV07TRDuGx1bSR/c7u X-Received: by 2002:a05:6214:923:: with SMTP id dk3mr370860qvb.96.1576639460015; Tue, 17 Dec 2019 19:24:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576639460; cv=none; d=google.com; s=arc-20160816; b=b/7zAiEIAGm2IidK+6LgyAJoar7hynXaNyqgcSwAclVrGzK4xkyyYgFDq5nXZsMTK0 313PVLTp2ct8qJtufyAykaC6k1Al7HwTTJSaPAznpemvNgdPU9+L8+D3JfWHEsz/JDil Mvvk9pt15/yz9yPbOnrlUK3apZm8q3nuxlNvBov6913G0hK6Auhxn2dV0p9KlQmw+N+J 0nGMGlgNJlPcUvb6tqI+kJKb8XHDHlfOSRXDX8m7JWtQ+yscSTkJosh0uiJ6IyW8c1xK V0FOFqIvVid8le1fasGAITvXrQMUUoJzATAoSPg5p0Jq4FkGlIZvtVFQ+KaQuJsINBDr cXqg== 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=IVABMN0hJYlQXO1glbSSBN/F4pdMjp3DIhyEvyino7c=; b=Kbq4s5hek8odltYhPIGMaL5vTXJndO6PPbbvqE7PMFqwuE9kGrx7PyE6l9Qdz3f8XL czOpEqBUENPK1E90Q0R8Pau4WcIzeosRnh/HruhjPsJWDJNFe6rGeLkLT/fpaII4lu+2 LtnsCOhyeElUO4O9isMGndJMuVOa0hkDReLIlfbTSqXRD2Cf/DXr15icFLv7azKoxqJH vGeEGc/22qc+aF5lGMPeUiy3fAruieJ0Nn7Ket74ijDNucrAbx+FwvGBc0XEw47JfAOD ChOZpLS80NgVrzlxhPGC+1ygmUvU7ciH7A5Ls8hOqNcqQzXSwKpnp+jLIWyATIJ/GFbP NQUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="SSDo/qpY"; 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 12si784018qkn.76.2019.12.17.19.24.19 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 17 Dec 2019 19:24:20 -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="SSDo/qpY"; 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]:49010 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihPwh-0001n8-7j for patch@linaro.org; Tue, 17 Dec 2019 22:24:19 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44268) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihPs6-00049R-SO for qemu-devel@nongnu.org; Tue, 17 Dec 2019 22:19:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihPs4-0002kL-Oz for qemu-devel@nongnu.org; Tue, 17 Dec 2019 22:19:34 -0500 Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]:42840) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ihPs4-0002jj-JW for qemu-devel@nongnu.org; Tue, 17 Dec 2019 22:19:32 -0500 Received: by mail-pf1-x441.google.com with SMTP id 4so385241pfz.9 for ; Tue, 17 Dec 2019 19:19:32 -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=IVABMN0hJYlQXO1glbSSBN/F4pdMjp3DIhyEvyino7c=; b=SSDo/qpYhLTxx5ztb+3nRQGRrHrPeNn6y4BeS90fRI+xFdHV3IXpC8lVNzQ095sSwE 0R82gSpua4KmLmJN1WnTc8PYHeRlLHnv7fT/1GB/R4XqMre5+FhUE/qAjHAMqe83TOin VXWkPEb3X5MZdVg3tfrBL/G7JH4QGDdEgXBc8t1SYWPRhej5bXSaAxfIYB+MP/J0BAVr kC3J/oJwtw+uF9VbKdGZeHMOU4fOfYtMLZOp/czIcl1HxugSBJVnXox/Fl6+85ozjopm Huo/504ckZIvREvtng90CwtPJ4uhbwOfszfudb6EwXs7rxMEKXTPuHL8QJ967OdbNuJ9 ph8A== 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=IVABMN0hJYlQXO1glbSSBN/F4pdMjp3DIhyEvyino7c=; b=DMC1uDRgxHdyIG/rCRdPNko8dpt4KblRlqdCYUCkJsB7CLsmFtf9g5bbcM4xyoEDZw Nws93BUnzUv//+3qpngNXberPOouX4epVZrS6pPjtuEIdXWo6QwSpM5cMKHsVfWoLEfA 2TMPMLVKRj/aoauITNNcq2O0dwaRtF4qXgm7VPQaCRCNVeKh8usvAmqxgfKp4oLAp8cd 4Kr1/97Q+7xHPYqoM6p+/4O9+PWxkrNzlmlLIBbybMsLIEvMyGwnqF59YHQs6jhGN0lK Gh15jgIEEuRHh+EGxfKGVz4YG3E9GtTzzaGiqRNsIkQ85rnLNDnkaK1pFNSt+nDssrmd TH3g== X-Gm-Message-State: APjAAAUXnnJ0BOPlaZTjvhEKTN/ukrfTQ51g4eb0rzWqYQTsThEQUCf6 Bl7zzxOPA/+TnI+DETD68/kTCIOztHw= X-Received: by 2002:a63:4b48:: with SMTP id k8mr326832pgl.362.1576639171240; Tue, 17 Dec 2019 19:19:31 -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.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Dec 2019 19:19:30 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 5/7] configure: Unnest detection of -z,relro and -z,now Date: Tue, 17 Dec 2019 17:19:18 -1000 Message-Id: <20191218031920.6414-6-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::441 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. Nor is there anything that specifically ties them to each other. Use them unconditionally. Signed-off-by: Richard Henderson --- configure | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) -- 2.20.1 diff --git a/configure b/configure index 972ce7396f..f8981eec15 100755 --- a/configure +++ b/configure @@ -2034,9 +2034,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" @@ -2047,6 +2044,16 @@ if test "$pie" != "no" ; then fi fi +# Detect support for DT_BIND_NOW. +if compile_prog "" "-Wl,-z,now" ; then + LDFLAGS="-Wl,-z,now $LDFLAGS" +fi + +# Detect support for PT_GNU_RELRO. +if compile_prog "" "-Wl,-z,relro" ; then + LDFLAGS="-Wl,-z,relro $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 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. From patchwork Wed Dec 18 03:19:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 181966 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp88285ile; Tue, 17 Dec 2019 19:22:17 -0800 (PST) X-Google-Smtp-Source: APXvYqz94nlz9F4fKIJ4HJwlEddP3j+ziZVJ0A8e2qo0XC7zSygmLqx0NSZaRyTfRpmxchJH/seY X-Received: by 2002:a05:6830:1e5c:: with SMTP id e28mr107906otj.293.1576639337603; Tue, 17 Dec 2019 19:22:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576639337; cv=none; d=google.com; s=arc-20160816; b=UfWubJcGYhWyvShDx8az7K+GXpTnEmMbqABEDPFqprxGHLSAWMqwssIgcHiRFxU6BA 1OiUpzbbTZhCsTXenwaZGf7LZZNmrQDTB+o42yrhMijn/9BfjHlHwBfdrfu8fBBjImWV 8ykqWhODW6OESTTu/mf0sg5UQzqPkOSyC5bF/dcNbm+FUk8xWCs4fRvLndHUIjFvlXTM p8g/BwnL/iC4eawPmdhS8Vp/WEegPoj+3egRX6EmtEYLCwPRVkBV4v0DZPA0qpkzWCjs IxE+ZQAy/LcqlGOxGUSbIougsgYd0O09FHDzWSXrkrwNN9+pd7xnA6Eja4Gp4UrHVvT1 smSg== 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=jQ/iIszATFHSOTQDeJa8KJZXVRGX9Wk3W4o78mWyy8c=; b=YF7J6UGDIT2Fx1iEwz3igNfPZ4CCcBFMpRhydAhZAIjgfJrt5NemKgblXyuokbfw67 we+k/Zc/HmBTq1Ra/JSBIK/XgWv0yYP3+Fe0xHpJbqGGVCzzqlw4WXx6dOlltqct0G6j hGmF4c0wh142+urGBBNWa5fRPdPuY12vFMTMg/RVw1hG3dLHctpiVkcpmHogLKW/cIpR ZWbsIUpYl1myMytEYoDDvtK/NYgY5dVW0Ak9CBZDNsdgqz6F4P2AY3GuLamb78wftFb+ UxshvzB2Oer7MjK+DCvVKM20Kah2uvl255TYiPgODwI8WuqLO+LkrYK7p6i/zQXPUOE8 ZQ3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=C7Td26JB; 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 z23si588560otk.166.2019.12.17.19.22.17 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 17 Dec 2019 19:22:17 -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=C7Td26JB; 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]:48978 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihPui-0007eM-ML for patch@linaro.org; Tue, 17 Dec 2019 22:22:16 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44406) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihPs8-0004CY-Ln 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-0002nM-Jx for qemu-devel@nongnu.org; Tue, 17 Dec 2019 22:19:36 -0500 Received: from mail-pg1-x542.google.com ([2607:f8b0:4864:20::542]:39428) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ihPs7-0002mJ-E4 for qemu-devel@nongnu.org; Tue, 17 Dec 2019 22:19:35 -0500 Received: by mail-pg1-x542.google.com with SMTP id b137so447265pga.6 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=jQ/iIszATFHSOTQDeJa8KJZXVRGX9Wk3W4o78mWyy8c=; b=C7Td26JBg2DeSPn3In/NgHzc9ZBHnWvdYisiPXb61qYCoWnR3bhiNx0VVtTSRPQNY4 WtpRSZgZhAAHQIRlOg70Q+VKAdnh2r98qj5gaKzL82BVH5gXKgl1W0qf03UqiDmIuJex txVOxty6zkom0Psg/1aRYbLD0cQKB+wyN3syTtH1H6JGY8CTBrkvF1a4oTZcwtpPxocX wm7/+eWogKW33UYV8qICU1KriRil69VtwRTLlibRxPxjl6MeWFJVf+6yiWII22DPe5Q6 a4jW8/ZhXHIZzXiQdkaeBC+CQQzX0bIO55EEYHQKsHsJeenJhwVZen955cX3S8bIfPNt 6qMg== 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=jQ/iIszATFHSOTQDeJa8KJZXVRGX9Wk3W4o78mWyy8c=; b=YSPVPgoC4N/J9Gy+wKay02gthfX9d7SbPLxo2ICUrYfYdYf+NgcT8sVUmEC9p1q2H5 1FvlHQxpi/GVA5Sst7BAQ4lzjCys0N7qLHduZmAnHSbU9yswsYp31wzBTShQzaz6iPkM FbOovmhVzKmYqT41mBa9e/dbxq2dBdRHVRy/KcVIMPEW04pgCHAbfWgql/+tMzfUgja0 K8hohoi3U2C9tG9nTsw9yI/iJQwE5M8gFFB1Y59/NhjCKQdG1GLhaWmjkrnsvQJ97zDW rp+9RaF53GAWCv0QeLg962gEex0X4K9wrJksGymI+agjCNWCZ3raH5g4x5MjG5TAXxyn JbsQ== X-Gm-Message-State: APjAAAU/jIuMtPNOa8Sx0+TnXFcxTBlByzOfKpWCu84bZOgHZ2oZ984i OEH1aXDZHGDfpT7dxmHOtdd6ybIWuvA= X-Received: by 2002:a65:56c9:: with SMTP id w9mr323141pgs.296.1576639174204; Tue, 17 Dec 2019 19:19:34 -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.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Dec 2019 19:19:33 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 7/7] configure: Support -static-pie if requested Date: Tue, 17 Dec 2019 17:19:20 -1000 Message-Id: <20191218031920.6414-8-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::542 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" Recent toolchains support static and pie at the same time. As with normal dynamic builds, allow --static to default to PIE if supported by the toolchain. Allow --enable/--disable-pie to override the default. Signed-off-by: Richard Henderson --- configure | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) -- 2.20.1 Reviewed-by: Thomas Huth diff --git a/configure b/configure index 1645a58b3a..c03491018a 100755 --- a/configure +++ b/configure @@ -1023,7 +1023,6 @@ for opt do ;; --static) static="yes" - LDFLAGS="-static $LDFLAGS" QEMU_PKG_CONFIG_FLAGS="--static $QEMU_PKG_CONFIG_FLAGS" ;; --mandir=*) mandir="$optarg" @@ -1994,11 +1993,6 @@ if test "$static" = "yes" ; then if test "$modules" = "yes" ; then error_exit "static and modules are mutually incompatible" fi - if test "$pie" = "yes" ; then - error_exit "static and pie are mutually incompatible" - else - pie="no" - fi fi # Unconditional check for compiler __thread support @@ -2032,6 +2026,17 @@ fi if test "$pie" = "no"; then QEMU_CFLAGS="$CFLAGS_NOPIE $QEMU_CFLAGS" LDFLAGS="$LDFLAGS_NOPIE $LDFLAGS" +elif test "$static" = "yes"; then + if compile_prog "-fPIE -DPIE" "-static-pie"; then + QEMU_CFLAGS="-fPIE -DPIE $QEMU_CFLAGS" + LDFLAGS="-static-pie $LDFLAGS" + pie="yes" + elif test "$pie" = "yes"; then + error_exit "-static-pie not available due to missing toolchain support" + else + LDFLAGS="-static $LDFLAGS" + pie="no" + fi elif compile_prog "-fPIE -DPIE" "-pie"; then QEMU_CFLAGS="-fPIE -DPIE $QEMU_CFLAGS" LDFLAGS="-pie $LDFLAGS"