Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1435486ybz; Wed, 29 Apr 2020 22:31:05 -0700 (PDT) X-Google-Smtp-Source: APiQypLivcDZPzY7HNrYYh4mVkBhhU3t+lTUllfjfm47bCReNnrn7IhTehVpZlWEtmSF5Mgm0ZLF X-Received: by 2002:a50:9dcd:: with SMTP id l13mr1217819edk.126.1588224665018; Wed, 29 Apr 2020 22:31:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588224665; cv=none; d=google.com; s=arc-20160816; b=uhRrPm02QttMOyK/D3AsDB8bXnRT9/DRwHY/gpySoBEUvUHe/Kpc+ApD069faEFwrx uHMdzTaTSvQqkvAwOv3rYqNrX2UuQid7dN4Ub8SdCBcvr/tgYdUdu3YMYPGTTrgUvJfR LLEpJ9OIaRV8+SB4p5u5J2IkbI6qwP2mzBvvhQydS4i1VtqrDrT/jqM6BEAcukGJC4zZ /FO/wLN8qS4K7nOPbdmYC0LLwd1L2uaP4+Y8Tp51uFEXhTc2Qkc9QtpznJDsKcoMi7sl EGZxdomX8Ok6pXJfVWxCaGESdXC1t7RfZelQI9jfDpxxa3GkbIEZIFv/wfqnMuzEYKbF pd7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=Kjlk/XkERUQdTUdqrtZvTZnBVPmqSm9W3wRIXQUb3Qk=; b=MeO/cJXlmTpq5sdTtG/ST59qDEkm4hRNZN9fEdtqzXQdlDxspj0inOg5M3XWMq0lb9 +iCH2anggmEgTilE8zdCXdgkSooR9OZhtm9umbYGVWWNroHBV1RpdCD0B/EyT0Gm8EqP a8RgWrXq5hLbqzp1NMlYwmaW7c9CfJGYo7UMu1mMgEXssLNnrPBZYsmQ8n0wL7ucTs2+ 4f1jsxrvUxUHlpplt9BvVkU+y5ZCJhiPYW/NtA2cA2BEgCV5dS7SjtKhz4tl0ARXfZRi kvHql97rdrXINK7tFhd5B6uBadjfWzUK1bcrKK3HoMyuRpHNATHnC3V2IK7t9IWXaVus MqPA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p20si5410437ejw.505.2020.04.29.22.30.36; Wed, 29 Apr 2020 22:31:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726430AbgD3Fae (ORCPT + 99 others); Thu, 30 Apr 2020 01:30:34 -0400 Received: from helcar.hmeau.com ([216.24.177.18]:60322 "EHLO fornost.hmeau.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726404AbgD3Fae (ORCPT ); Thu, 30 Apr 2020 01:30:34 -0400 Received: from gwarestrin.me.apana.org.au ([192.168.0.7] helo=gwarestrin.arnor.me.apana.org.au) by fornost.hmeau.com with smtp (Exim 4.89 #2 (Debian)) id 1jU1l1-0005JC-1O; Thu, 30 Apr 2020 15:29:12 +1000 Received: by gwarestrin.arnor.me.apana.org.au (sSMTP sendmail emulation); Thu, 30 Apr 2020 15:30:04 +1000 Date: Thu, 30 Apr 2020 15:30:04 +1000 From: Herbert Xu To: Nathan Chancellor Cc: linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com, Dmitry Golovin Subject: Re: [PATCH] lib/mpi: Fix 64-bit MIPS build with Clang Message-ID: <20200430053004.GC11738@gondor.apana.org.au> References: <20200421214703.47883-1-natechancellor@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200421214703.47883-1-natechancellor@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Tue, Apr 21, 2020 at 02:47:04PM -0700, Nathan Chancellor wrote: > When building 64r6_defconfig with CONFIG_MIPS32_O32 disabled and > CONFIG_CRYPTO_RSA enabled: > > lib/mpi/generic_mpih-mul1.c:37:24: error: invalid use of a cast in a > inline asm context requiring an l-value: remove the cast > or build with -fheinous-gnu-extensions > umul_ppmm(prod_high, prod_low, s1_ptr[j], s2_limb); > ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > lib/mpi/longlong.h:664:22: note: expanded from macro 'umul_ppmm' > : "=d" ((UDItype)(w0)) > ~~~~~~~~~~^~~ > lib/mpi/generic_mpih-mul1.c:37:13: error: invalid use of a cast in a > inline asm context requiring an l-value: remove the cast > or build with -fheinous-gnu-extensions > umul_ppmm(prod_high, prod_low, s1_ptr[j], s2_limb); > ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > lib/mpi/longlong.h:668:22: note: expanded from macro 'umul_ppmm' > : "=d" ((UDItype)(w1)) > ~~~~~~~~~~^~~ > 2 errors generated. > > This special case for umul_ppmm for MIPS64r6 was added in > commit bbc25bee37d2b ("lib/mpi: Fix umul_ppmm() for MIPS64r6"), due to > GCC being inefficient and emitting a __multi3 intrinsic. > > There is no such issue with clang; with this patch applied, I can build > this configuration without any problems and there are no link errors > like mentioned in the commit above (which I can still reproduce with > GCC 9.3.0 when that commit is reverted). Only use this definition when > GCC is being used. > > This really should have been caught by commit b0c091ae04f67 ("lib/mpi: > Eliminate unused umul_ppmm definitions for MIPS") when I was messing > around in this area but I was not testing 64-bit MIPS at the time. > > Link: https://github.com/ClangBuiltLinux/linux/issues/885 > Reported-by: Dmitry Golovin > Signed-off-by: Nathan Chancellor > --- > lib/mpi/longlong.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Patch applied. Thanks. -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt