From: Nick Desaulniers <ndesaulniers@google.com>
To: joel@jms.id.au
Cc: mpe@ellerman.id.au, LKML <linux-kernel@vger.kernel.org>,
linuxppc-dev@lists.ozlabs.org, Arnd Bergmann <arnd@arndb.de>,
Kees Cook <keescook@chromium.org>,
jji@us.ibm.com
Subject: Re: [PATCH v2] raid6/ppc: Fix build for clang
Date: Mon, 3 Dec 2018 10:45:01 -0800 [thread overview]
Message-ID: <CAKwvOdndyeRZApOqbp-6evEpYgzHyGo4qqaMKd_DQ4U9x8_5wA@mail.gmail.com> (raw)
In-Reply-To: <CACPK8XdbWzb=52iFV_fj0Y5KMWPgsRv_A8PZgfKn9vm96y3LOw@mail.gmail.com>
On Mon, Dec 3, 2018 at 2:24 AM Joel Stanley <joel@jms.id.au> wrote:
>
> On Sat, 3 Nov 2018 at 04:04, Nick Desaulniers <ndesaulniers@google.com> wrote:
> >
> > On Thu, Nov 1, 2018 at 5:45 PM Joel Stanley <joel@jms.id.au> wrote:
> > >
> > > We cannot build these files with clang as it does not allow altivec
> > > instructions in assembly when -msoft-float is passed.
> > >
> > > Jinsong Ji <jji@us.ibm.com> wrote:
> > > > We currently disable Altivec/VSX support when enabling soft-float. So
> > > > any usage of vector builtins will break.
> > > >
> > > > Enable Altivec/VSX with soft-float may need quite some clean up work, so
> > > > I guess this is currently a limitation.
> > > >
> > > > Removing -msoft-float will make it work (and we are lucky that no
> > > > floating point instructions will be generated as well).
> > >
> > > This is a workaround until the issue is resolved in clang.
> > >
> > > Link: https://bugs.llvm.org/show_bug.cgi?id=31177
> > > Link: https://github.com/ClangBuiltLinux/linux/issues/239
> > > Signed-off-by: Joel Stanley <joel@jms.id.au>
> > > ---
> > > v2: fix typo in comment, thanks Jinsong
> > >
> > > lib/raid6/Makefile | 15 +++++++++++++++
> > > 1 file changed, 15 insertions(+)
> > >
> > > diff --git a/lib/raid6/Makefile b/lib/raid6/Makefile
> > > index 2f8b61dfd9b0..7ed43eaa02ef 100644
> > > --- a/lib/raid6/Makefile
> > > +++ b/lib/raid6/Makefile
> > > @@ -18,6 +18,21 @@ quiet_cmd_unroll = UNROLL $@
> > >
> > > ifeq ($(CONFIG_ALTIVEC),y)
> > > altivec_flags := -maltivec $(call cc-option,-mabi=altivec)
> > > +
> > > +ifdef CONFIG_CC_IS_CLANG
> > > +# clang ppc port does not yet support -maltivec when -msoft-float is
> > > +# enabled. A future release of clang will resolve this
> > > +# https://bugs.llvm.org/show_bug.cgi?id=31177
> > > +CFLAGS_REMOVE_altivec1.o += -msoft-float
> > > +CFLAGS_REMOVE_altivec2.o += -msoft-float
> > > +CFLAGS_REMOVE_altivec4.o += -msoft-float
> > > +CFLAGS_REMOVE_altivec8.o += -msoft-float
> > > +CFLAGS_REMOVE_altivec8.o += -msoft-float
> > > +CFLAGS_REMOVE_vpermxor1.o += -msoft-float
> > > +CFLAGS_REMOVE_vpermxor2.o += -msoft-float
> > > +CFLAGS_REMOVE_vpermxor4.o += -msoft-float
> > > +CFLAGS_REMOVE_vpermxor8.o += -msoft-float
> > > +endif
> >
> > Hi Joel, thanks for this patch! My same thoughts about
> > CONFIG_CC_IS_CLANG vs cc-option from
> > https://lists.ozlabs.org/pipermail/linuxppc-dev/2018-November/180939.html
> > apply here as well. I don't feel strongly about either though. What
> > are your thoughts?
>
> I'm not sure that we can test for this one with cc-option. The result
> of having -maltivec with -msoft-float is a error about the internals
> of clang, which isn't something that kbuild is set up to test for.
As in clang itself crashes, and cc-option/kbuild can't handle that gracefully?
>
> When clang is fixed to allow this combination we will still build this
> code in the same way, so in that sense it fails "open".
>
> Cheers,
>
> Joel
--
Thanks,
~Nick Desaulniers
next prev parent reply other threads:[~2018-12-03 18:45 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-02 0:44 [PATCH v2] raid6/ppc: Fix build for clang Joel Stanley
2018-11-02 17:34 ` Nick Desaulniers
2018-12-03 10:24 ` Joel Stanley
2018-12-03 18:45 ` Nick Desaulniers [this message]
2018-12-03 22:13 ` Joel Stanley
2018-12-03 22:55 ` Nick Desaulniers
2018-12-03 23:24 ` Segher Boessenkool
2018-12-22 9:55 ` [v2] " Michael Ellerman
Reply instructions:
You may reply publicly 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=CAKwvOdndyeRZApOqbp-6evEpYgzHyGo4qqaMKd_DQ4U9x8_5wA@mail.gmail.com \
--to=ndesaulniers@google.com \
--cc=arnd@arndb.de \
--cc=jji@us.ibm.com \
--cc=joel@jms.id.au \
--cc=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).