From patchwork Wed Dec 18 22:34:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 182030 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp1280753ile; Wed, 18 Dec 2019 14:35:07 -0800 (PST) X-Google-Smtp-Source: APXvYqyQxJVN7VP+qhukSiXTf6zRjtPi/BgszWjEa5w8C3Yvcc7eEmh8FG5lomfkINzDfBNeTb/d X-Received: by 2002:a05:6808:2d2:: with SMTP id a18mr1371198oid.120.1576708507454; Wed, 18 Dec 2019 14:35:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576708507; cv=none; d=google.com; s=arc-20160816; b=aPv3++hEFNibpRvzWWz1T0vZUaGSQKUzU2aq7XWJ7q7tsSS0vAzyXeur3IMt7PPMSg yDmspcY9AO6ReN1Gd+CYeo1BJeW3KAEF8H6C0bqTvSfk5bC1Hjv7DZ/9GjzxYD1D4tQE 3nHkbxsE2cDWaMzSAEygcJalm9o0H+vEKAQzl7fa0bjN2RqRCRzklPYIs/sS58G0DwI4 OnxyC2OvCf6Bb4I9xJD7W25p7aLBzF0Byji6Ng4Ai88o6p1LiQYEvJCrHB2NoWXuAKLW DT4btkEwH5D1xCUQIB8dB5kCsJH00JF4UB31GNY1uaLS8pPVURX9+u2i8ebSm/aQZNPG VEUQ== 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:message-id:date:subject:to:from:dkim-signature; bh=bDZlkQFsGu9lcu99bMN7sasPdTJ24bpvTwRb0OW56FU=; b=jfXYFapkztFzQgVfNFadxbuTgmIBu6pG0U0PjaLJDtuxvj03d3FwqncR3KIkVVqWdB fbyb8HKw7m5ybuiyBb6bCT9PpU2UDj+pE7Q3caSDZq7dCwdh8ApAbT2KNVkKUqYe2mqo rlUyQUEte9Nkis3phq5S55DPuysAtvXIU1ZqS7+TYyCMM2BTwxWSXa0lg2uaCvWKIeIf DYxDNTPw5lrwn5NQD2ACyQlFFDT9hU6QBvwpBO54fmqbntaead8/m7oJ+ISRxfMPYKW+ XteG3eeJ3O1gNbkIGJ7oZcRiW/XC8rv8vFvw2IN6fekTfqhhoqvzeK0auA6Fz1lLo/a9 AHlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=tj9PKDCF; 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 x186si1281744oig.209.2019.12.18.14.35.07 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Dec 2019 14:35:07 -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=tj9PKDCF; 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]:33376 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihhuM-0001TY-Hp for patch@linaro.org; Wed, 18 Dec 2019 17:35:06 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:54247) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihhu5-0001TF-Vv for qemu-devel@nongnu.org; Wed, 18 Dec 2019 17:34:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihhu3-0003tl-Hb for qemu-devel@nongnu.org; Wed, 18 Dec 2019 17:34:49 -0500 Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]:43791) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ihhu3-0003sg-B8 for qemu-devel@nongnu.org; Wed, 18 Dec 2019 17:34:47 -0500 Received: by mail-pf1-x441.google.com with SMTP id x6so927864pfo.10 for ; Wed, 18 Dec 2019 14:34:46 -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:mime-version :content-transfer-encoding; bh=bDZlkQFsGu9lcu99bMN7sasPdTJ24bpvTwRb0OW56FU=; b=tj9PKDCFbWLDvalXBdDD9W0vYOYboqKZSWJkfyBguTG4lpTusua5m+Ks7RWVlH8P+f Tz1QyiBdNdZc/KCOxkzrplR56h9HnVGpHoxrOkWvRL0AyhLAqyb8P5Y9BbaULJqruMoC 69WhVLlAxcXmJSjqt4dtUYl4kzD7V7vdvviNxsrufyox7oRSbWcz0QNo3ao/j2v9Di7I pKPQJwwvIbYUzTmdiMENY4C9/v7LMnpxU5i9D2ZzM+4LEepo3OZd6ieRoZ7WkkgquIey UiM/uYlOn6ltJc3QCSoezTZZI7w+0hM79M68csSbsw9sI4o0hOJyTV6lmSekEAw5MGGo ySKQ== 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:mime-version :content-transfer-encoding; bh=bDZlkQFsGu9lcu99bMN7sasPdTJ24bpvTwRb0OW56FU=; b=k+xRba19uxfh1gJawsdrOag1BypYGuYTfF5dFq1LJv+FBmJ6mDd6tSfMR1ghQfzMku f6/qeKvP0PnKCbdrc6cV8Vno4ADBs4PWNKr6uNQ/hQ8NjJz63B/CU6M5yFV8r5YuTp5b IFyWtQqZAzLL2FwWhroLtthxxbFaRu3AD5Wmpn9DE9qyxhfj5zv4eGtCqz3jTvVYQzRr cwb3YA6fGxhHr8AlOOkA/lXXtNN6hgw+tOoWS9KtMaO4lYWCDlacpgLL0FfCyMni+T5Z ooW2RXiMncn5BHGZPxlOtOSU8rt4pCgYSO7aJoaPMTmrcCdX9lxobyJCbA0A2sbmcDY6 x8MA== X-Gm-Message-State: APjAAAWd0CN9/OlNXKPfs+Eu08OUxdWEeITxBX7+1ncyOIF0yeJx+grw /Ku34XezNLDQdI384vhrbUWwwTLMFlE= X-Received: by 2002:a65:640e:: with SMTP id a14mr5185106pgv.402.1576708484590; Wed, 18 Dec 2019 14:34:44 -0800 (PST) Received: from localhost.localdomain ([2605:e000:c74f:dc00:6838:d2b2:17e2:8445]) by smtp.gmail.com with ESMTPSA id j1sm4627779pff.107.2019.12.18.14.34.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Dec 2019 14:34:43 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 0/7] configure: Improve PIE and other linkage Date: Wed, 18 Dec 2019 12:34:34 -1000 Message-Id: <20191218223441.23852-1-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 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" This begins by dropping the -Ttext-segment stuff, which Fangrui Song correctly points out does not work with lld. But it's also obsolete, so instead of adding support for lld's --image-base, remove it all. Then, remove some other legacy random addresses that were supposed to apply to softmmu, but didn't really make any sense, and aren't used anyway when PIE is used, which is the default with a modern linux distribution. Then, clean up some of the configure logic surrounding PIE, and its current non-application to non-x86. Finally, add support for static-pie linking. Changes in v2: - Remove mention of config-host.ld from make distclean - Do not split -z,rodata/-z,now into two tests - Fix --disable-pie --static Tested in conjunction with AJB's configure: allow disable of cross compilation container https://lists.gnu.org/archive/html/qemu-devel/2019-12/msg02943.html as otherwise check-tcg simply doesn't work on aarch64 if you happen to have docker installed. r~ Richard Henderson (7): configure: Drop adjustment of textseg tcg: Remove softmmu code_gen_buffer fixed address configure: Do not force pie=no for non-x86 configure: Always detect -no-pie toolchain support configure: Unnest detection of -z,relro and -z,now configure: Override the os default with --disable-pie configure: Support -static-pie if requested Makefile | 2 +- accel/tcg/translate-all.c | 37 ++---------- configure | 116 +++++++++++--------------------------- 3 files changed, 38 insertions(+), 117 deletions(-) -- 2.20.1