From: Paul Burton <paul.burton@mips.com>
To: Nathan Chancellor <natechancellor@gmail.com>
Cc: Ralf Baechle <ralf@linux-mips.org>,
Paul Burton <pburton@wavecomp.com>,
James Hogan <jhogan@kernel.org>,
"linux-mips@vger.kernel.org" <linux-mips@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"clang-built-linux@googlegroups.com"
<clang-built-linux@googlegroups.com>,
Nick Desaulniers <ndesaulniers@google.com>,
Nathan Chancellor <natechancellor@gmail.com>,
"linux-mips@vger.kernel.org" <linux-mips@vger.kernel.org>
Subject: Re: [PATCH] mips: Fix unroll macro when building with Clang
Date: Thu, 10 Oct 2019 21:04:21 +0000 [thread overview]
Message-ID: <MWHPR2201MB1277296EAF034DFC726FF1EFC1940@MWHPR2201MB1277.namprd22.prod.outlook.com> (raw)
In-Reply-To: <20191010203159.20565-1-natechancellor@gmail.com>
Hello,
Nathan Chancellor wrote:
> Building with Clang errors after commit 6baaeadae911 ("MIPS: Provide
> unroll() macro, use it for cache ops") since the GCC_VERSION macro
> is defined in include/linux/compiler-gcc.h, which is only included
> in compiler.h when using GCC:
>
> In file included from arch/mips/kernel/mips-mt.c:20:
> ./arch/mips/include/asm/r4kcache.h:254:1: error: use of undeclared
> identifier 'GCC_VERSION'; did you mean 'S_VERSION'?
> __BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 32,
> )
> ^
> ./arch/mips/include/asm/r4kcache.h:219:4: note: expanded from macro
> '__BUILD_BLAST_CACHE'
> cache_unroll(32, kernel_cache, indexop,
> ^
> ./arch/mips/include/asm/r4kcache.h:203:2: note: expanded from macro
> 'cache_unroll'
> unroll(times, _cache_op, insn, op, (addr) + (i++ * (lsize)));
> ^
> ./arch/mips/include/asm/unroll.h:28:15: note: expanded from macro
> 'unroll'
> BUILD_BUG_ON(GCC_VERSION >= 40700 && \
> ^
>
> Use CONFIG_GCC_VERSION, which will always be set by Kconfig.
> Additionally, Clang 8 had improvements around __builtin_constant_p so
> use that as a lower limit for this check with Clang (although MIPS
> wasn't buildable until Clang 9); building a kernel with Clang 9.0.0
> has no issues after this change.
Applied to mips-next.
> commit df3da04880b4
> https://git.kernel.org/mips/c/df3da04880b4
>
> Fixes: 6baaeadae911 ("MIPS: Provide unroll() macro, use it for cache ops")
> Link: https://github.com/ClangBuiltLinux/linux/issues/736
> Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
> Signed-off-by: Paul Burton <paul.burton@mips.com>
Thanks,
Paul
[ This message was auto-generated; if you believe anything is incorrect
then please email paul.burton@mips.com to report it. ]
prev parent reply other threads:[~2019-10-10 21:04 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-10 20:31 [PATCH] mips: Fix unroll macro when building with Clang Nathan Chancellor
2019-10-10 21:04 ` Paul Burton [this message]
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=MWHPR2201MB1277296EAF034DFC726FF1EFC1940@MWHPR2201MB1277.namprd22.prod.outlook.com \
--to=paul.burton@mips.com \
--cc=clang-built-linux@googlegroups.com \
--cc=jhogan@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=natechancellor@gmail.com \
--cc=ndesaulniers@google.com \
--cc=pburton@wavecomp.com \
--cc=ralf@linux-mips.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
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).