From patchwork Tue Feb 20 21:59:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 10230905 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8C679602A7 for ; Tue, 20 Feb 2018 22:00:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 77BE22878E for ; Tue, 20 Feb 2018 22:00:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6C3292893F; Tue, 20 Feb 2018 22:00:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 02C732878E for ; Tue, 20 Feb 2018 22:00:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=ybXLj+u+HgD5meP2b/POlbYpUQ/Jp9iKX1IBiLiRw7k=; b=b/VOxMiSlMGdvg6SAfFkfjrx3h MVA9OSujjvKRBgI7VZcdCMknwVqvelPApjNk1cCzSEloxmmDbUuFkSm76TjNomYpIJe2e8VqB8Brp XjMNc80M45pPq/hO7B0GIiaqrdiXEUwYHePMDpLj3MjysTnhSAzHL4iAK+IlvpO+b77Rq3jeTCDae BvZ2zeBxd3/3nri6zlAb4kYyMglv5P8HnPZHqZxjP/yq6A27wAFjAH5AzLZ0q5u4HFkEHNpvYratZ kuw8rkr2yv0vnrhISApeMt79FVS/pk7j/5ujksVsaRzTWQqvNnR1QBiSy31lOKZq1hLyebWPRVLAe u6FPGnAQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1eoFxV-0006L4-HV; Tue, 20 Feb 2018 22:00:21 +0000 Received: from mout.kundenserver.de ([217.72.192.74]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eoFxO-00067j-Hs for linux-arm-kernel@lists.infradead.org; Tue, 20 Feb 2018 22:00:16 +0000 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue104 [212.227.15.145]) with ESMTPA (Nemesis) id 0MHG5L-1f2IRx1ZmF-00E2MQ; Tue, 20 Feb 2018 22:59:58 +0100 From: Arnd Bergmann To: Nicolas Pitre Subject: [PATCH 2/7] ARM: LTO: avoid THUMB2_KERNEL+LTO Date: Tue, 20 Feb 2018 22:59:49 +0100 Message-Id: <20180220215954.4092811-3-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20180220215954.4092811-1-arnd@arndb.de> References: <20180220215954.4092811-1-arnd@arndb.de> X-Provags-ID: V03:K0:u3KJWzqET9ns5Lg+m/MiDFxCNf+0k3MQUUUfTn6++ORQZePXN1j mi6mz90RJHWy+PVhAkmNYeriJ35b4438nHM6SFXwhRhgsyXBB96WYGpwm3QP2TEatBilBtx IAk8ErVh57EmlAbnHvtWBTTKfMwUJ6jXq0i/gjvgIhsnhQy1UZ2TMUr7fytlRBnhbH60/zW p8KUauJSv6ARo5IvkBcuw== X-UI-Out-Filterresults: notjunk:1; V01:K0:lq2vHQPEv3M=:5SSk4VkGusr2hEy+y4tCo3 eTpGu9WiFscv9HdHREs8x0QHu5x0jy/xu3meN1t+p4LeX000RpuTf23cyvUIp9ibKnqYK8B2q jSdGvNhJpmFjIzraWeeev6C8Y6YfWP4Jv+gA7DM6FxfV/RRjG9E1Ohs3WCqwPTuAyOUZxjg+t HzudzChvronAoGTK9P8cBSygtoZNqZUb4MTPQiCPOk9hXH1m4n8tNYX8Bx+Ts7hOeF0whtDPw 4btdT87XipB+CIL/zLclhSTzN0vImmD8wnzQCtNRr7ijuitfbnykLWd5HroZQC3H0Bg8htsQL H+vsfKpZYAc/FCj2+ICIHNk9LKfjM/gdxylM3ex4QR28AKVQiXqXnvz4w7a8yXdtBJl/Q/U1q XeIUeYM3ygLyS8pzt3ELvplVHCLdRxtap9s89yHJdoGNwddES+RlcVFZFtSirOINeSq67+L3n TJdbvy+iJ26nVcF6IpcRXrDWeE6FwwO1JmOUVBBvtEIS2EA5h2eqyVzv1a90DSTpeKb9r5X26 C39dbtdxmoIxX24WTuZpWVyhXruDUeOZ8FUtn2HiHOnHUFGiQ+kAHdR8XQUoUXR5zcEHXc7rf llH0nCtFeOvORdyHS5+TKSwR6J4kkwrJ5vgRd4znffaF12JtHl6Jt1zhC8g9kIWWIVT8cuvZL scppz2aNVch0hVvKBqzPn9T3wtVM9SAVy1o/+Y4OhWwRnd9Ik+tyPmt25ZEYZBMu9PRxVT7zd wS0eSnUaP6KWOdsq8K+dGUUy4s9VIN1mxoFWpQ== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180220_140014_927756_A92FB1C3 X-CRM114-Status: GOOD ( 11.68 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andi Kleen , Arnd Bergmann , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Trying to build an LTO-Enabled kernel with Thumb2 instructions failed horribly for me, with an endless output of things like ccVnNycO.s:2665: Error: thumb conditional instruction should be in IT block -- `bxne lr' ccVnNycO.s:7128: Error: thumb conditional instruction should be in IT block -- `strexeq r5,r2,[r3]' ccVnNycO.s:7258: Error: thumb conditional instruction should be in IT block -- `strexeq lr,r0,[r3]' ccVnNycO.s:17380: Error: thumb conditional instruction should be in IT block -- `strexeq r1,r2,[r6]' ccVnNycO.s:19163: Error: thumb conditional instruction should be in IT block -- `strexeq r8,r6,[r3]' ccVnNycO.s:22722: Error: thumb conditional instruction should be in IT block -- `strexeq r7,r1,[r0]' ccVnNycO.s:24105: conditional infixes are deprecated in unified syntax ccVnNycO.s:24105: Error: thumb conditional instruction should be in IT block -- `sbcccs r1,r1,r3' ccVnNycO.s:24105: Error: thumb conditional instruction should be in IT block -- `movcc r3,#0' ccVnNycO.s:24210: conditional infixes are deprecated in unified syntax ccVnNycO.s:24210: Error: thumb conditional instruction should be in IT block -- `sbcccs r2,r2,r3' ccVnNycO.s:24210: Error: thumb conditional instruction should be in IT block -- `movcc r3,#0' I did not investigate this too much, disabling Thumb2 support when LTO is set lets me build randconfig kernels. Since ARM_SINGLE_ARMV7M is Thumb2-only, I have to disallow LTO for V7-M targets. Signed-off-by: Arnd Bergmann --- arch/arm/Kconfig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 8ed0f664f86f..fbf2c3ab9a97 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -18,7 +18,7 @@ config ARM select ARCH_OPTIONAL_KERNEL_RWX if ARCH_HAS_STRICT_KERNEL_RWX select ARCH_OPTIONAL_KERNEL_RWX_DEFAULT if CPU_V7 select ARCH_SUPPORTS_ATOMIC_RMW - select ARCH_SUPPORTS_LTO + select ARCH_SUPPORTS_LTO if !ARM_SINGLE_ARMV7M select ARCH_USE_BUILTIN_BSWAP select ARCH_USE_CMPXCHG_LOCKREF select ARCH_WANT_IPC_PARSE_VERSION @@ -1533,6 +1533,7 @@ config SCHED_HRTICK config THUMB2_KERNEL bool "Compile the kernel in Thumb-2 mode" if !CPU_THUMBONLY depends on (CPU_V7 || CPU_V7M) && !CPU_V6 && !CPU_V6K + depends on !LTO default y if CPU_THUMBONLY select ARM_UNWIND help