Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp12622ybl; Mon, 12 Aug 2019 10:52:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqyf9aZToNNK9WKTSoTxUORskctoplA2w893L5omJBu8CUTrMNFMPEFBoQO8r+5JNqWzg1+C X-Received: by 2002:a62:64d4:: with SMTP id y203mr36429279pfb.91.1565632348931; Mon, 12 Aug 2019 10:52:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565632348; cv=none; d=google.com; s=arc-20160816; b=uNftV69AeMSNbzwD59/UDcWk+o0wXjli0f/gwo7RdZcdeL716ubXuicAguFOF8MZxt aWbbge/0DNJoT78jNGBOQYmOLDOlsomi4N+QO8g9M9CrtiqnaQ3UTr3SB3EUkiz3wLV9 G43lBj0dBkWlnLyCkNVcOfFDea74gZfQz6SzlO1DAmBwjeZLPtBQq/sEb0MsTPsLvTvr 1u89rshsNZrddLlUWdJBbdBaNb9d63o0XIM1jmCcour3kX4VVm1yKnScq+Np0DB8RCwP 5ibl74tKJ4MSkBqXnLxCVv+MhY5ldwFulws0khQA4340VGyNns0Uj567j/+yi/M0xfMU m+bA== 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:dkim-signature; bh=z+y0C86lIYFqkc13B1ZVf/z3tXXKI/4p8OSUCocFgOs=; b=l/Bi6eFnshay/UqhGo7VZLO0ScVqGuJ4KXU+JTw1kJ907aaLif3DiiPSa1oUfFhtqq kLFnuafugi8CJ2E+orH8xUBeml56zhaypzAGDaN8R6Mr2swpqlLHfj+MP1uipw3q21Oe NnY0y19WRXhfQGuXbbRWVMd5Q0BL67lefZPve1PF81ctxdZO2egNVSk3uJGmv+GxlD5r e56JssSI5pm4/FWuwO+HFwn1oQlMNaB9xZFFphW4U2fRgjTu2UR0EzxmYgjQXBnR+qQ0 7jNffV8YKmoqQo/elYQX8C+1REc9kdYoqn1MYCidaXpDZ4i4NFsxVufi+GvNcrirogYK sOsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=nZUNVjOg; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q26si6327298pfh.286.2019.08.12.10.52.12; Mon, 12 Aug 2019 10:52:28 -0700 (PDT) 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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=nZUNVjOg; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726610AbfHLRvZ (ORCPT + 99 others); Mon, 12 Aug 2019 13:51:25 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:42218 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726144AbfHLRvZ (ORCPT ); Mon, 12 Aug 2019 13:51:25 -0400 Received: by mail-wr1-f65.google.com with SMTP id b16so8627640wrq.9; Mon, 12 Aug 2019 10:51:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=z+y0C86lIYFqkc13B1ZVf/z3tXXKI/4p8OSUCocFgOs=; b=nZUNVjOg2d0QuJzusHNui0cXDqbVVlkxIbCsmKs77PTYxhTBSdMDrOK3GG0CAEEJqX lTZ5d2jDsnPHddZ6HoqdxEC4zM+Y/4hSzT7FlYlYJp3AeMrb8FD7f3bMgy2Fph2gunsa vQYqbVPr4Um0EdigE7fTrE0DxJsnpkB7sb7VBcvLU5sOrUtLkoWD+b2bojTgqdVOzLST 1V8v7dbOx8DnA/C2eJ0SGH9WL7FQ4txv+37K3nTJwpTtC9eIVE1h37FfxdsnAMXLluW2 MaL8QNq3Ck0faY7ygXIvrpOLOvONfc+axTJlPPnOsQuUv7Xix3eg3HhgnpR/CBEJP29U H8+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=z+y0C86lIYFqkc13B1ZVf/z3tXXKI/4p8OSUCocFgOs=; b=b2425GXNFMUiViPHUPTMQFmlYMGxjyx9p7aYZwTqiR95RZ/0yAv3iO50zGCbv7RSGi kTewJDqH6E+s8/qYK7X8dHsWQ8T6TmcaCAW7B60naPDyxyMZUUiSM+z+CokbpBV0fy78 8tiFeAh7ZhNTOo+LysmZ0NzkVZFpjzqER0uuppXLtny9i0gq2IoH/YHy3l6M2VzohNht LAPzB87QU+uMvHZLdoTeUCtfoyidVsxmcfuwXIpVwbjDGHU2emvela6ofk3y38KSlxz/ DZLkeMwkzoZMjSlAsjvC60+FfCLq7CBdyvLWA8WoyNqLkqlz8nX85Pc2tCP+dbyAgYbP aSew== X-Gm-Message-State: APjAAAWnW40mELp+cRyt/ouKxPYxnOn6cZAw14ZR1LVPytGIbd9So82h 5eQHodRYu08xx2hB2iJgFsc= X-Received: by 2002:a5d:6b07:: with SMTP id v7mr31494739wrw.169.1565631959424; Mon, 12 Aug 2019 10:45:59 -0700 (PDT) Received: from archlinux-threadripper ([2a01:4f8:222:2f1b::2]) by smtp.gmail.com with ESMTPSA id l15sm17734393wrq.64.2019.08.12.10.45.58 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 12 Aug 2019 10:45:59 -0700 (PDT) Date: Mon, 12 Aug 2019 10:45:57 -0700 From: Nathan Chancellor To: Nick Desaulniers Cc: Ralf Baechle , Paul Burton , James Hogan , linux-mips@vger.kernel.org, LKML , clang-built-linux , Werner Koch Subject: Re: [PATCH 4/5] lib/mpi: Fix for building for MIPS64 with Clang Message-ID: <20190812174557.GA14197@archlinux-threadripper> References: <20190812033120.43013-1-natechancellor@gmail.com> <20190812033120.43013-5-natechancellor@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 12, 2019 at 10:42:31AM -0700, Nick Desaulniers wrote: > On Sun, Aug 11, 2019 at 8:31 PM Nathan Chancellor > wrote: > > > > From: Werner Koch > > > > * mpi/longlong.h [MIPS64][__clang__]: Use the C version like we > > already do for 32 bit MIPS > > > > clang errors: > > > > 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 > > Reminds me of: > https://github.com/ClangBuiltLinux/linux/commit/7b7c1df2883dd4393592859758c3e76207da8b1d > > > umul_ppmm(prod_high, prod_low, s1_ptr[j], s2_limb); > > ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > lib/mpi/longlong.h:652:20: note: expanded from macro 'umul_ppmm' > > : "=l" ((USItype)(w0)), \ > > ~~~~~~~~~~^~~ > > lib/mpi/generic_mpih-mul1.c:37:3: error: invalid output constraint '=h' > > in asm > > umul_ppmm(prod_high, prod_low, s1_ptr[j], s2_limb); > > ^ > > lib/mpi/longlong.h:653:7: note: expanded from macro 'umul_ppmm' > > "=h" ((USItype)(w1)) \ > > ^ > > 2 errors generated. > > > > Fixes: 5ce3e312ec5c ("crypto: GnuPG based MPI lib - header files (part 2)") > > Link: https://github.com/ClangBuiltLinux/linux/issues/605 > > Link: https://github.com/gpg/libgcrypt/commit/e7ae0ae243c8978a67c802169183187d88557be8 > > Signed-off-by: Werner Koch > > [nc: Added build error and tags to commit message > > Modified subject line > > Removed GnuPG-bug-id > > Removed space between defined and (__clang__)] > > Signed-off-by: Nathan Chancellor > > --- > > lib/mpi/longlong.h | 3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > diff --git a/lib/mpi/longlong.h b/lib/mpi/longlong.h > > index 8a1507fc94dd..5636e6a09f7a 100644 > > --- a/lib/mpi/longlong.h > > +++ b/lib/mpi/longlong.h > > @@ -688,7 +688,8 @@ do { \ > > : "d" ((UDItype)(u)), \ > > "d" ((UDItype)(v))); \ > > } while (0) > > -#elif (__GNUC__ >= 5) || (__GNUC__ >= 4 && __GNUC_MINOR__ >= 4) > > +#elif defined(__clang__) || (__GNUC__ >= 5) || (__GNUC__ == 4 && \ > > + __GNUC_MINOR__ >= 4) > > So the minimum supported version of GCC to build the kernel is > currently 4.6, so we can clean up a lot more here. I'd remove the > check, and delete the #elif and #else implementations. > Sure, I will dig into this further and send a v2. Thanks for the review, Nathan > > #define umul_ppmm(w1, w0, u, v) \ > > do { \ > > typedef unsigned int __ll_UTItype __attribute__((mode(TI))); \ > > -- > > 2.23.0.rc2 > > > > > -- > Thanks, > ~Nick Desaulniers