Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6767145imu; Mon, 3 Dec 2018 02:25:46 -0800 (PST) X-Google-Smtp-Source: AFSGD/XxUKDljCVdCmptDKqHMX0R/Njs5Vn3Ue1FHMYdGvVBY+DhBZ0zh758tUiZaPYo8cWP9UMG X-Received: by 2002:a62:d148:: with SMTP id t8mr15689631pfl.52.1543832746629; Mon, 03 Dec 2018 02:25:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543832746; cv=none; d=google.com; s=arc-20160816; b=Qabh3IvnVpJ0qm+QBFbwRVL1qbcXGY+4EKLHaKY7OIN8u6nf5Cc2PERc7tRShIBaVy zlanX4HIb7Abb1n0qms6trQ8AojUot51qhsVB5cH9Ne5WPEz/cGJuTeKWN0m+KX7DlxF 4xsScs348ZejEZE28DvJRN09agKwxtJe0x9N7yXvRzNHqgwwwUdD5E2325+Obdw1CUHP CNjqpNX4wVxAgjSoxiblLe3axPRSQdm1SlgJfUKU8De1qjZe8RYqfq7zXniSbh3sGSnT cHdiYXWQtF49IIlf8JaKgtochfs57J4d4i1y+6Pvc9YoGVyn3P+iKjVJm7LwJtKC3csQ gQ6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=VOwRlFEtKUX0nfoeZ2XPbc477wBa9aEEuwSfpux+fcc=; b=ELYuv/AdewQC60h9M6YIQg3Q9DaRBmAbn8wMkIr2D3HaJeDx2YrUjJdrgP6Jt41G3y XJJuyo5YKrhtesteQP90WnDWMxXPNr7wIc+QUe915kNZjm+Ck55KDpSfycSlv36K/b4R O5vVrOhl6y5MYo2tCmyYNuXEmSX6nUfhFXUFehsFttvDDz33xvkZ1egEcp2tQl+jf8JF v4WCj54xzMbTZNDOhAuh2qaka8qsco1sAZlAKOkmrrvamogjCXmK5cmogcSVi6IJ+crW cZSod/9PGbM6xIGFcNYJJbLiy6qnv4hayu++6LNRNlAKgzretPR4RwtMzadSaC8AbOf7 0Pfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@jms.id.au header.s=google header.b="M5Ps/4Wl"; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ce11si13478150plb.420.2018.12.03.02.25.31; Mon, 03 Dec 2018 02:25:46 -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; dkim=pass header.i=@jms.id.au header.s=google header.b="M5Ps/4Wl"; 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 S1726216AbeLCKZT (ORCPT + 99 others); Mon, 3 Dec 2018 05:25:19 -0500 Received: from mail-qt1-f196.google.com ([209.85.160.196]:40703 "EHLO mail-qt1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725983AbeLCKZS (ORCPT ); Mon, 3 Dec 2018 05:25:18 -0500 Received: by mail-qt1-f196.google.com with SMTP id k12so13022093qtf.7 for ; Mon, 03 Dec 2018 02:24:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jms.id.au; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=VOwRlFEtKUX0nfoeZ2XPbc477wBa9aEEuwSfpux+fcc=; b=M5Ps/4WlD8OWnqjLkvlE9jOoK4B/1n5XftBvYEP5DufCDRy6rLzqWfQ59gIcJ3O1uO eMjbm7qplwMDfhZsGqvqbdKtQASxbcqfmY47xUCDv801HJDxs/VRuoPEWetMDVBtKe9O H9wwAccrEEm0Ha9aqeDkMrR7UTCkZKkkKHvc4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=VOwRlFEtKUX0nfoeZ2XPbc477wBa9aEEuwSfpux+fcc=; b=fgpq6SIWWH8z/swOvsh/NBqB/T72gMs7hZvdwnAv6H3CpxmESKiTsKJp71EgYtxZm3 0rSRFkh96yrfMnLRbkUeiNVP4rIY8yWc5FXwT1aeLWccl5ZSMWENW96yTnfRn4+cpPTo NvP1L5eYtctm+OHKFcKIJ8K1Lc1vEaRlsCktrPVQi1RZuuxwaDSayz+5c1HWSJGd5CiX YZtffZdHpxJiO1UomIx29ggQm1U/s0kgKOE3fnltm5WNImePjQPdvZMxkvGMKjSgcgf/ DGWfigk0rZv29noaetw7rs9wlrrF3v+Mhd6mHJv7iKFMo5wyofsupZb0S0QXahCrEomV 9tXg== X-Gm-Message-State: AA+aEWbeHiM54/+NabecAiQsLNHENPMgMKgO0MbK7MVa6/jsPo4iWE7j tith5ICo185nX/4DqYBKcPRVqpDjWaKAKHcUYXM= X-Received: by 2002:ac8:29b7:: with SMTP id 52mr14602422qts.266.1543832691764; Mon, 03 Dec 2018 02:24:51 -0800 (PST) MIME-Version: 1.0 References: <20181102004455.10157-1-joel@jms.id.au> In-Reply-To: From: Joel Stanley Date: Mon, 3 Dec 2018 20:54:40 +1030 Message-ID: Subject: Re: [PATCH v2] raid6/ppc: Fix build for clang To: Nick Desaulniers Cc: Michael Ellerman , Linux Kernel Mailing List , linuxppc-dev@lists.ozlabs.org, Arnd Bergmann , Kees Cook , Jinsong Ji Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 3 Nov 2018 at 04:04, Nick Desaulniers wrote: > > On Thu, Nov 1, 2018 at 5:45 PM Joel Stanley wrote: > > > > We cannot build these files with clang as it does not allow altivec > > instructions in assembly when -msoft-float is passed. > > > > Jinsong Ji 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 > > --- > > 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. 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