Linux-MIPS Archive on lore.kernel.org
 help / color / Atom feed
From: Nathan Chancellor <natechancellor@gmail.com>
To: Nick Desaulniers <ndesaulniers@google.com>
Cc: Ralf Baechle <ralf@linux-mips.org>,
	Paul Burton <paul.burton@mips.com>,
	James Hogan <jhogan@kernel.org>,
	linux-mips@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>,
	clang-built-linux <clang-built-linux@googlegroups.com>,
	Werner Koch <wk@gnupg.org>
Subject: Re: [PATCH 4/5] lib/mpi: Fix for building for MIPS64 with Clang
Date: Mon, 12 Aug 2019 10:45:57 -0700
Message-ID: <20190812174557.GA14197@archlinux-threadripper> (raw)
In-Reply-To: <CAKwvOd=BYmsExYeOQmuEJ-Yybgqd_22vQ_WwU0jEXTXAaKpQVw@mail.gmail.com>

On Mon, Aug 12, 2019 at 10:42:31AM -0700, Nick Desaulniers wrote:
> On Sun, Aug 11, 2019 at 8:31 PM Nathan Chancellor
> <natechancellor@gmail.com> wrote:
> >
> > From: Werner Koch <wk@gnupg.org>
> >
> > * 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 <wk@gnupg.org>
> > [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 <natechancellor@gmail.com>
> > ---
> >  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

  reply index

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-12  3:31 [PATCH 0/5] Clang build fixes for MIPS Nathan Chancellor
2019-08-12  3:31 ` [PATCH 1/5] MIPS: Don't use bc_false uninitialized in __mm_isBranchInstr Nathan Chancellor
2019-08-12  4:47   ` Paul Burton
2019-08-12  3:31 ` [PATCH 2/5] MIPS/ptrace: Update mips_get_syscall_arg's return type Nathan Chancellor
2019-08-12  4:47   ` Paul Burton
2019-08-12  3:31 ` [PATCH 3/5] lib/mpi: Fix for building for MIPS32 with Clang Nathan Chancellor
2019-08-12  5:23   ` Nathan Chancellor
2019-08-12  5:26     ` Nathan Chancellor
2019-08-12 12:28       ` Herbert Xu
2019-08-12 17:58     ` Paul Burton
2019-08-12  7:35   ` Jussi Kivilinna
2019-08-12 17:14     ` Nathan Chancellor
2019-08-12 19:40       ` Jussi Kivilinna
2019-08-12 19:45         ` Nathan Chancellor
2019-08-12  3:31 ` [PATCH 4/5] lib/mpi: Fix for building for MIPS64 " Nathan Chancellor
2019-08-12  5:25   ` Nathan Chancellor
2019-08-12 17:42   ` Nick Desaulniers
2019-08-12 17:45     ` Nathan Chancellor [this message]
2019-08-12  3:31 ` [PATCH 5/5] MIPS: tlbex: Explicitly cast _PAGE_NO_EXEC to a boolean Nathan Chancellor
2019-08-12  4:47   ` Paul Burton

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190812174557.GA14197@archlinux-threadripper \
    --to=natechancellor@gmail.com \
    --cc=clang-built-linux@googlegroups.com \
    --cc=jhogan@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=paul.burton@mips.com \
    --cc=ralf@linux-mips.org \
    --cc=wk@gnupg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-MIPS Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-mips/0 linux-mips/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-mips linux-mips/ https://lore.kernel.org/linux-mips \
		linux-mips@vger.kernel.org linux-mips@archiver.kernel.org
	public-inbox-index linux-mips

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-mips


AGPL code for this site: git clone https://public-inbox.org/ public-inbox