From patchwork Thu Feb 18 14:02:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 102742 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp605655lbl; Thu, 18 Feb 2016 06:05:17 -0800 (PST) X-Received: by 10.98.13.68 with SMTP id v65mr10210617pfi.150.1455804317586; Thu, 18 Feb 2016 06:05:17 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 64si9642026pfi.163.2016.02.18.06.05.17; Thu, 18 Feb 2016 06:05:17 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1946396AbcBROFO (ORCPT + 30 others); Thu, 18 Feb 2016 09:05:14 -0500 Received: from mout.kundenserver.de ([212.227.17.13]:61184 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1425501AbcBROFJ (ORCPT ); Thu, 18 Feb 2016 09:05:09 -0500 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue101) with ESMTPA (Nemesis) id 0LfAVs-1aCVpi2wK8-00omGd; Thu, 18 Feb 2016 15:04:42 +0100 From: Arnd Bergmann To: Russell King Cc: linux-arm-kernel@lists.infradead.org, Arnd Bergmann , Ard Biesheuvel , Nicolas Pitre , Jon Medhurst , Marc Zyngier , Nicolas Pitre , linux-kernel@vger.kernel.org Subject: [PATCH 8/9] ARM: do not use optimized do_div for ARMv3 Date: Thu, 18 Feb 2016 15:02:00 +0100 Message-Id: <1455804123-2526139-9-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1455804123-2526139-1-git-send-email-arnd@arndb.de> References: <1455804123-2526139-1-git-send-email-arnd@arndb.de> X-Provags-ID: V03:K0:szUbznyZjp1Denmj3hWaReWQT4ox8XoI6iNEWzVlUnAlebMFGEi 7mMgXdvDCdaVASX9x5hrtrUhFPnEP1pNO1AfKMtddL8xUjeNKO0jLgwLKoo5q/eVvzwZzd1 U5dRm+4et5cicxSehSmMZl/HhWBotPBAD5nmPLGE1CRp3s2KnhQqcqLtUBm+Ij7xnxwGXrq Qkc3xSdu8CPMhw4gALcfg== X-UI-Out-Filterresults: notjunk:1; V01:K0:HQ4cD1EA/yo=:/gSAfULom+uMoLVmlo5l/p ACci4vHHkXV1nFTwzSa4IA/lYwQd4KQQXYc6oCLLuXG6NnvTWiCYRjYAxlxjDMyXLWIRi32sY mKNtiWjM2KHInocJiABQtemHeAfLoyRLeurS5xV/8mrrDM2WuSmlAjzBZrSkkz4BtOxp7xCIv oSe4NjuE4T23HdKTxHIIlMsm4E5tN3UYuPJQwRjWY4XAKOJe0+1oB/82XBh2vufEaRL/7qAYo sc+sFdi1ZqolIhHZ4e46pjDk1cCH1zuoPZee2VfCZ1bqRPbATkEQ0HfBTHmI/SNtN/VNRkbtz prKFsCHUQGKpTZiyZsTKXd6GfMrUZxXEgw3uU5pS8QssjAObGs9AUl6wpocJ9jnyM6AJwNkdX OrqFqZt20a39uQuv9bbb6VIaM1l61HmT61VCthDFNSA4/JcZ7l0sFPAvlFiPXN4VezJ0Khadw 0TEW6vWqHFQNe4S9+2Z0LwcFYEeo46qj+rO7VxuT6I3CVpunsw4znf4kGsPMC2qKtvUNOf3mo pcdMbs0L8uNF20wVSa3jud9tR5zC86GdcM8OFZ0oBaHTvP0N3f6AlG3h5VetKrzaah28QSJMi yCWZblFe33zi8RXe1RK3URxhEbzLKVpDf93JWI2mR7AwBwr4V+XkbEBBOjluNIYsbxI7ruD8I Y8ZREWgjE5lrj2XZuyDpXH8IiMQL1Zoj1Ds9BEoE2WbjHW71HaZA7qxGbvTYh8D+X8b4= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The gcc-4.9 optimization goes wrong while building target_core_iblock.c for ARMv3 and leaves a bogus reference to __aeabi_uldivmod in the output: ERROR: "__aeabi_uldivmod" [drivers/target/target_core_iblock.ko] undefined! I could not find anyone who is interested in fixing it in gcc, so as a workaround this disables the do_div magic, just like we do for old compilers and for OABI. Signed-off-by: Arnd Bergmann --- arch/arm/include/asm/div64.h | 8 ++++++++ 1 file changed, 8 insertions(+) -- 2.7.0 diff --git a/arch/arm/include/asm/div64.h b/arch/arm/include/asm/div64.h index 7d919a9b32e5..958fdc2363f5 100644 --- a/arch/arm/include/asm/div64.h +++ b/arch/arm/include/asm/div64.h @@ -58,6 +58,14 @@ static inline uint32_t __div64_32(uint64_t *n, uint32_t base) */ #define do_div(n, base) __div64_32(&(n), base) +#elif defined(CONFIG_CPU_32v3) + +/* + * modern compiler versions (>= gcc-4.9) tend to misoptimize + * the code for ARMv3, and this is not getting fixed any more. + */ +#define do_div(n, base) __div64_32(&(n), base) + #else /*