From nobody Wed May 8 08:30:54 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1576639410; cv=none; d=zohomail.com; s=zohoarc; b=bkaTv7YFrm0+yvVxJr12TI8xHxemeCr3nCWmehc9woCEa/Vr1oFNVEJZ9V6gBypLjoZRvXZh52VqooaBYlzBpbYHwNtjrwUeQrtIKJX6i6YAHj1MBNBiZoq2TChwfsFbbwMFlTaeAgYhXOKbpLqg0zDJG6twS7b4nsseGODaBPo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576639410; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=+Toe6+kf85085QGBznhMe/ZC3IHb6MH8qdiKw5XlMFI=; b=AOGIoLQ164MHvKqjblSXD2L/ESEK8A4o3s9G2b5AeTKd9IkEONPYB29bLOaxfJuRsH1VWKL5k2sQMmF5/ZmrxGM0KXQgtV8BYJAHaPaCx/E+yjbPMRm+y6MazdilJ4BvDiJnqS+ZQ4Aes5YV4KN+VPsjgeSbm6jZNwCy6XQZmwM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1576639410647791.5607380525291; Tue, 17 Dec 2019 19:23:30 -0800 (PST) Received: from localhost ([::1]:48990 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihPvt-0000BC-BF for importer@patchew.org; Tue, 17 Dec 2019 22:23:29 -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) 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) 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-Google-Smtp-Source: APXvYqzyoVU80nkVM6viZDd7ZtB0p0SrBMZyumo1mlLO5ihNbChTPwBahQXi90mgQe5g8ujkMk/d1Q== X-Received: by 2002:a63:4d5e:: with SMTP id n30mr288667pgl.275.1576639165011; Tue, 17 Dec 2019 19:19:25 -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 Content-Transfer-Encoding: quoted-printable 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Thomas Huth --- configure | 47 ----------------------------------------------- 1 file changed, 47 deletions(-) diff --git a/configure b/configure index 84b413dbfc..255ac432af 100755 --- a/configure +++ b/configure @@ -6292,49 +6292,6 @@ if test "$cpu" =3D "s390x" ; then fi fi =20 -# Probe for the need for relocating the user-only binary. -if ( [ "$linux_user" =3D yes ] || [ "$bsd_user" =3D yes ] ) && [ "$pie" = =3D no ]; then - textseg_addr=3D - case "$cpu" in - arm | i386 | ppc* | s390* | sparc* | x86_64 | x32) - # ??? Rationale for choosing this address - textseg_addr=3D0x60000000 - ;; - 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=3D0x60000000 - ;; - 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,/=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D/d' \ - -e '/=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D/,$d' \ - -e "s/[.] =3D [0-9a-fx]* [+] SIZEOF_HEADERS/. =3D $textseg_addr + = SIZEOF_HEADERS/" \ - -e "s/__executable_start =3D [0-9a-fx]*/__executable_start =3D $te= xtseg_addr/" > config-host.ld - textseg_ldflags=3D"-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" =3D "yes" ; then fi fi =20 -if test "$target_linux_user" =3D "yes" || test "$target_bsd_user" =3D "yes= " ; then - ldflags=3D"$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 --=20 2.20.1 From nobody Wed May 8 08:30:54 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1576639505; cv=none; d=zohomail.com; s=zohoarc; b=RWdQEf7RemgO3CzkaxN24yK/AqofjRhKclycv44/GEEumYo/mcaZP90vDKhQLTyeVK2ozMnG97w4QvCq/zTND86Xwk64oOOpaNbvtscJjaX50wpDqnDFUuajXtB6x4ictmuLfKtIy9o2WIItxt1w9PDPbrhgqfow5er6C4qrnO4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576639505; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=h8PHcS1tBBTVD9W0+xFnEcSw+EjWnL99+V49q3i39H0=; b=hwa0SMuq6GMdCvyr8ZNCzL/28Kc+f1Tw9NhJkIEa3B4NQ3vLAuU8jknHrPwAQmFt4pHDcVmlkNY+fqN97gUJrBVRWFTJSoKUsf82FOb6NLX6md+ch4O3n3dbLQ0AHu7QTV/ExShNz1I9i1HpE5EzPvo8Buq4AOLl2ZA8OqINz54= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1576639505106714.1719547350413; Tue, 17 Dec 2019 19:25:05 -0800 (PST) Received: from localhost ([::1]:49022 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihPxP-0002TH-1P for importer@patchew.org; Tue, 17 Dec 2019 22:25:03 -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) 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) 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-Google-Smtp-Source: APXvYqwe2x72/05jIOJeYOMIRFWSeh6d98ZCKwqk102Wd5QqpWzeUXBoKZelImajpcJezaTch3S50Q== X-Received: by 2002:a65:538b:: with SMTP id x11mr273892pgq.395.1576639166549; 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 Content-Transfer-Encoding: quoted-printable 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Thomas Huth --- accel/tcg/translate-all.c | 37 +++++-------------------------------- 1 file changed, 5 insertions(+), 32 deletions(-) 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 =3D PROT_WRITE | PROT_READ | PROT_EXEC; int flags =3D MAP_PRIVATE | MAP_ANONYMOUS; - uintptr_t start =3D 0; size_t size =3D tcg_ctx->code_gen_buffer_size; void *buf; =20 - /* 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 |=3D MAP_32BIT; - /* Cannot expect to map more than 800MB in low memory. */ - if (size > 800u * 1024 * 1024) { - tcg_ctx->code_gen_buffer_size =3D size =3D 800u * 1024 * 1024; - } -# elif defined(__sparc__) - start =3D 0x40000000ul; -# elif defined(__s390x__) - start =3D 0x90000000ul; -# elif defined(__mips__) -# if _MIPS_SIM =3D=3D _ABI64 - start =3D 0x128000000ul; -# else - start =3D 0x08000000ul; -# endif -# endif - - buf =3D mmap((void *)start, size, prot, flags, -1, 0); + buf =3D mmap(NULL, size, prot, flags, -1, 0); if (buf =3D=3D MAP_FAILED) { return NULL; } =20 #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 =3D mmap(NULL, size, prot, flags, -1, 0); switch ((int)(buf2 !=3D MAP_FAILED)) { --=20 2.20.1 From nobody Wed May 8 08:30:54 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1576639277; cv=none; d=zohomail.com; s=zohoarc; b=Jp6M0E3ZQ/I2QQvKUyU2PzuwE45vOpTHAUCKitqmgudCzCcrwNWxtjpEcV3btL9QSYRgC7eLB4sXlLIJEB+0Rv4stPzazt6N+c6R6sM2oVuZ5WLBwrgkNv+xhPQIls2yL/anHd9fLbz5hc05DeQrppq5T1aBgp7FQkzF32+ScdY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576639277; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=U37ZVea/IPVlUTlCbim6MG1bzwxdwI6SbTuQBxQprmQ=; b=Qtvh2Ae65LXgli+imbPEU24KNGy0qb0Ge+kHY2TH43AKS/9HfS8kUVm3jtxM1HP+5kys+drRShLxxAhbVzusoNEaEBUblLJsWXYCq41l8Y6B6tb8Hv1IQ6qJ2HR99XwqVcM23VbbMCJjmiz+TUQJDMm4YZR2ybeUlstTYqU2ETM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 157663927698091.99051821007697; Tue, 17 Dec 2019 19:21:16 -0800 (PST) Received: from localhost ([::1]:48930 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihPtj-0005lg-0V for importer@patchew.org; Tue, 17 Dec 2019 22:21:15 -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) 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) 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-Google-Smtp-Source: APXvYqzFBVLJsImdbnJCUrmpE0AC+UmycuXsj28TDd7TV8loQem68Pn1JUl9xOgQWVqnfqxpYpN7tQ== X-Received: by 2002:a63:3f47:: with SMTP id m68mr276712pga.411.1576639168087; Tue, 17 Dec 2019 19:19:28 -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 Content-Transfer-Encoding: quoted-printable 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" 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(-) 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 =20 -if test "$pie" =3D ""; then - case "$cpu-$targetos" in - i386-Linux|x86_64-Linux|x32-Linux|i386-OpenBSD|x86_64-OpenBSD) - ;; - *) - pie=3D"no" - ;; - esac -fi - if test "$pie" !=3D "no" ; then cat > $TMPC << EOF =20 --=20 2.20.1 From nobody Wed May 8 08:30:54 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1576639281; cv=none; d=zohomail.com; s=zohoarc; b=hgDb9Ji4eiWwqlE7xUtiGObV8zaU7vglopy5RAwBdtckx99pV2EQce6q4F9vmbF7//B0W6uIcGURMdja8BIRC1lHCiefP0ba3u9NJTZI1qdMjuMm9YNhE+hW4nH2mE+aO0FdpkrrHhZ7rVaBXlD2l87ybpqQrBAvMCPbe91+qb0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576639281; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=SWmO1kQqi8bfr8nyMbMf0tsp3eELnVxdGpB7UInxtBo=; b=a6qgFhzSwW8EJGgZQ+EAMWQYWpLrs4cWNyGq66RlK92KLgn2b95VjlWRBNIjUhPFycX1leNn5YZEiq7WtkAz9CtkpI/81qajT/tCruEXwQBKD4u3WqkAf/5I0x7WtsH136LCtEftyV0HFJYRuorsRGiCn+d+AvRWzvyCspuWV3s= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1576639281802377.7964798906296; Tue, 17 Dec 2019 19:21:21 -0800 (PST) Received: from localhost ([::1]:48944 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihPto-0005rI-Az for importer@patchew.org; Tue, 17 Dec 2019 22:21:20 -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) 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) 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-Google-Smtp-Source: APXvYqzNkP2ktpfX4dgcQmKYgSda8d77FTds98YszTjvtTcBdJwsfwUQfUse+KvHHSq8o5jc3JjvOA== X-Received: by 2002:a65:49ca:: with SMTP id t10mr324831pgs.37.1576639169720; 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 Content-Transfer-Encoding: quoted-printable 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Thomas Huth --- configure | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) 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 =20 -if test "$pie" !=3D "no" ; then - cat > $TMPC << EOF +cat > $TMPC << EOF =20 #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=3D"-fno-pie" - LDFLAGS_NOPIE=3D"-nopie" - fi =20 +# Check we support --no-pie first; we will need this for building ROMs. +if compile_prog "-Werror -fno-pie" "-no-pie"; then + CFLAGS_NOPIE=3D"-fno-pie" + LDFLAGS_NOPIE=3D"-no-pie" +fi + +if test "$pie" !=3D "no" ; then if compile_prog "-fPIE -DPIE" "-pie"; then QEMU_CFLAGS=3D"-fPIE -DPIE $QEMU_CFLAGS" LDFLAGS=3D"-pie $LDFLAGS" --=20 2.20.1 From nobody Wed May 8 08:30:54 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1576639424; cv=none; d=zohomail.com; s=zohoarc; b=Jq/utxdvrHAbUjgi9mJ3V1QE4ccRjxTvlzpbhYGX0WQzncphQBTGrs1ZBjK/pF3IxnqsMlpiRpxjC1Tqkly69FmVEX4Bx5ny4TESwRTaedbWiL9BKcPon//StmqzXWCqfH0o1D4iZ4mA5G7pR8rANQuS6V4FwfW6HDGWEmAOorw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576639424; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=IVABMN0hJYlQXO1glbSSBN/F4pdMjp3DIhyEvyino7c=; b=eE/gxIWcoG4fEjE7b2C1UxCOuuj29f/OclogoDoaVqNeEi053fZJ/cfI0N2q+hSwhwUdkgh+P0m0gm7KBYs9NoCAuPfphy8Xhw91x0SDsYw59XrPAJWWlFOM0jbdF7YX4eoz2a2ZWLWqxkA2Gc5VaLqM4JXqZmtGs7N1pFRF+3w= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1576639424542695.6878095572735; Tue, 17 Dec 2019 19:23:44 -0800 (PST) Received: from localhost ([::1]:48994 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihPw7-0000VD-6L for importer@patchew.org; Tue, 17 Dec 2019 22:23:43 -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) 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) 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-Google-Smtp-Source: APXvYqw9lrS94GUPXHsMFF5nhNCcSXjGjJ2r6QqfUTbHKsk0WYkWLYHBMlP3/esnNBQB/dPv1PJGSA== X-Received: by 2002:a63:4b48:: with SMTP id k8mr326832pgl.362.1576639171240; Tue, 17 Dec 2019 19:19:31 -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 Content-Transfer-Encoding: quoted-printable 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" 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(-) diff --git a/configure b/configure index 972ce7396f..f8981eec15 100755 --- a/configure +++ b/configure @@ -2034,9 +2034,6 @@ if test "$pie" !=3D "no" ; then QEMU_CFLAGS=3D"-fPIE -DPIE $QEMU_CFLAGS" LDFLAGS=3D"-pie $LDFLAGS" pie=3D"yes" - if compile_prog "" "-Wl,-z,relro -Wl,-z,now" ; then - LDFLAGS=3D"-Wl,-z,relro -Wl,-z,now $LDFLAGS" - fi else if test "$pie" =3D "yes"; then error_exit "PIE not available due to missing toolchain support" @@ -2047,6 +2044,16 @@ if test "$pie" !=3D "no" ; then fi fi =20 +# Detect support for DT_BIND_NOW. +if compile_prog "" "-Wl,-z,now" ; then + LDFLAGS=3D"-Wl,-z,now $LDFLAGS" +fi + +# Detect support for PT_GNU_RELRO. +if compile_prog "" "-Wl,-z,relro" ; then + LDFLAGS=3D"-Wl,-z,relro $LDFLAGS" +fi + ########################################## # __sync_fetch_and_and requires at least -march=3Di486. Many toolchains # use i686 as default anyway, but for those that don't, an explicit --=20 2.20.1 From nobody Wed May 8 08:30:54 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1576639438; cv=none; d=zohomail.com; s=zohoarc; b=l0k/LJzuNp4RYfDsPzmlhYPIMMMD9x4wkh9Wv6R23StzzKDFWBAvoG3tyIPWfz8rYdSggCTDiDVfafYj7Hy6OZ2ayK0DRdfajbC/tsLzkr5vzfRkZi967K1sbN+QrbrfKatscfrvIBmAsTshajYaGmJtZBa95u6EdRAFM7dDqIE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576639438; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=o0Btsp+XuBjjSu9t/pnVNpY24aVKknJmQRq/Lz0GJe4=; b=IGuw5LPUWjANkA4DdmzIWfC7UAaheAmtH8R2oh3I+uHe1nbWz/4hTymzF+taiANwI1OzX54G+juYcQfX5gmqrIgocNHFZ702i94ST3FD0i/MNNI2M6JOPfuLnivUviIjT3/AxuGeGTugK2xtdQjPPz63jZWcZdO+wGf5YXfZkGQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1576639438388843.3268487777262; Tue, 17 Dec 2019 19:23:58 -0800 (PST) Received: from localhost ([::1]:48998 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihPwL-0000h7-5s for importer@patchew.org; Tue, 17 Dec 2019 22:23:57 -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) 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) 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-Google-Smtp-Source: APXvYqxgJc1qNkADxBp1Lx4lA2njspWXjR9X5mj2i/KJb/n6GliuR4EMrDz86wzPEteIQ8SJ5/MCJg== X-Received: by 2002:a17:90a:fe02:: with SMTP id ck2mr62354pjb.10.1576639172806; 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 Content-Transfer-Encoding: quoted-printable 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Thomas Huth --- configure | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) 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=3D"-no-pie" fi =20 -if test "$pie" !=3D "no" ; then - if compile_prog "-fPIE -DPIE" "-pie"; then - QEMU_CFLAGS=3D"-fPIE -DPIE $QEMU_CFLAGS" - LDFLAGS=3D"-pie $LDFLAGS" - pie=3D"yes" - else - if test "$pie" =3D "yes"; then - error_exit "PIE not available due to missing toolchain support" - else - echo "Disabling PIE due to missing toolchain support" - pie=3D"no" - fi - fi +if test "$pie" =3D "no"; then + QEMU_CFLAGS=3D"$CFLAGS_NOPIE $QEMU_CFLAGS" + LDFLAGS=3D"$LDFLAGS_NOPIE $LDFLAGS" +elif compile_prog "-fPIE -DPIE" "-pie"; then + QEMU_CFLAGS=3D"-fPIE -DPIE $QEMU_CFLAGS" + LDFLAGS=3D"-pie $LDFLAGS" + pie=3D"yes" +elif test "$pie" =3D "yes"; then + error_exit "PIE not available due to missing toolchain support" +else + echo "Disabling PIE due to missing toolchain support" + pie=3D"no" fi =20 # Detect support for DT_BIND_NOW. --=20 2.20.1 From nobody Wed May 8 08:30:54 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1576639283; cv=none; d=zohomail.com; s=zohoarc; b=LcW73DZQ6A4htkdzRM3bTkwkh+zRL/vn7ezvuTjNoKqna8lYIn0Q/EOgRi30XQaMTkirYWIIR+E/DmkF8YK0/ant72T2oByc4yJL3wH85D1OQOAQlLiQRC/e1fh7Nf8mWStGM/6BrVaJkZkcZGWUSw7v46uOB8dpBQV3SliI9jY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576639283; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=jQ/iIszATFHSOTQDeJa8KJZXVRGX9Wk3W4o78mWyy8c=; b=TKaTeaIOjy6n4MPLo1yrPylOa0T1zJn6WnE37Tmcjbfd/Sb/9XdXWaZIpyDlxeyG18vkz5NBfYgArgEzoFIucNpU1y6T/rA86H4rskMTY4pfJJgBAyx19q9HU0uskwaVJpafwYNVWQxsQSlmWH63+myX0LnKm0HcO5Pnlmd6OEE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1576639283677703.7352153970222; Tue, 17 Dec 2019 19:21:23 -0800 (PST) Received: from localhost ([::1]:48952 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihPtq-00063C-9S for importer@patchew.org; Tue, 17 Dec 2019 22:21:22 -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) 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) 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-Google-Smtp-Source: APXvYqysgFmZt1Hs5Eigo61Bq/hL08LCzw76grC4cilGo7IV4qdzSyU1wH/rom8vn1SarNRIgasBIA== X-Received: by 2002:a65:56c9:: with SMTP id w9mr323141pgs.296.1576639174204; Tue, 17 Dec 2019 19:19:34 -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 Content-Transfer-Encoding: quoted-printable 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Thomas Huth --- configure | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/configure b/configure index 1645a58b3a..c03491018a 100755 --- a/configure +++ b/configure @@ -1023,7 +1023,6 @@ for opt do ;; --static) static=3D"yes" - LDFLAGS=3D"-static $LDFLAGS" QEMU_PKG_CONFIG_FLAGS=3D"--static $QEMU_PKG_CONFIG_FLAGS" ;; --mandir=3D*) mandir=3D"$optarg" @@ -1994,11 +1993,6 @@ if test "$static" =3D "yes" ; then if test "$modules" =3D "yes" ; then error_exit "static and modules are mutually incompatible" fi - if test "$pie" =3D "yes" ; then - error_exit "static and pie are mutually incompatible" - else - pie=3D"no" - fi fi =20 # Unconditional check for compiler __thread support @@ -2032,6 +2026,17 @@ fi if test "$pie" =3D "no"; then QEMU_CFLAGS=3D"$CFLAGS_NOPIE $QEMU_CFLAGS" LDFLAGS=3D"$LDFLAGS_NOPIE $LDFLAGS" +elif test "$static" =3D "yes"; then + if compile_prog "-fPIE -DPIE" "-static-pie"; then + QEMU_CFLAGS=3D"-fPIE -DPIE $QEMU_CFLAGS" + LDFLAGS=3D"-static-pie $LDFLAGS" + pie=3D"yes" + elif test "$pie" =3D "yes"; then + error_exit "-static-pie not available due to missing toolchain support" + else + LDFLAGS=3D"-static $LDFLAGS" + pie=3D"no" + fi elif compile_prog "-fPIE -DPIE" "-pie"; then QEMU_CFLAGS=3D"-fPIE -DPIE $QEMU_CFLAGS" LDFLAGS=3D"-pie $LDFLAGS" --=20 2.20.1