[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+icZUWJLGfp-UVhXDaCR=Xnce7phE1ffPHC4RzM8mXPhBaV9g@mail.gmail.com>
Date: Fri, 10 Apr 2020 08:38:05 +0200
From: Sedat Dilek <sedat.dilek@...il.com>
To: Jian Cai <caij2003@...il.com>
Cc: Nick Desaulniers <ndesaulniers@...gle.com>, manojgupta@...gle.com,
Peter.Smith@....com, stefan@...er.ch, samitolvanen@...gle.com,
ilie.halip@...il.com, jiancai@...gle.com,
Russell King <linux@...linux.org.uk>,
Arnd Bergmann <arnd@...db.de>,
Linus Walleij <linus.walleij@...aro.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Mauro Carvalho Chehab <mchehab+samsung@...nel.org>,
Doug Anderson <armlinux@...isordat.com>,
Benjamin Gaignard <benjamin.gaignard@...aro.org>,
Bartosz Golaszewski <bgolaszewski@...libre.com>,
Masahiro Yamada <masahiroy@...nel.org>,
Masami Hiramatsu <mhiramat@...nel.org>,
"Steven Rostedt (VMware)" <rostedt@...dmis.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Tejun Heo <tj@...nel.org>,
"Joel Fernandes (Google)" <joel@...lfernandes.org>,
Patrick Bellasi <patrick.bellasi@....com>,
Krzysztof Kozlowski <krzk@...nel.org>,
Dan Williams <dan.j.williams@...el.com>,
"Eric W. Biederman" <ebiederm@...ssion.com>,
David Howells <dhowells@...hat.com>,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
Clang-Built-Linux ML <clang-built-linux@...glegroups.com>
Subject: Re: [PATCH] ARM: do not assemble iwmmxt.S with LLVM toolchain
On Fri, Apr 10, 2020 at 1:28 AM Jian Cai <caij2003@...il.com> wrote:
>
> iwmmxt.S contains XScale instructions LLVM ARM backend does not support.
> Skip this file if LLVM integrated assemmbler or LLD is used to build ARM
> kernel.
>
> Signed-off-by: Jian Cai <caij2003@...il.com>
> ---
> arch/arm/Kconfig | 2 +-
> init/Kconfig | 6 ++++++
> 2 files changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> index 66a04f6f4775..39de8fc64a73 100644
> --- a/arch/arm/Kconfig
> +++ b/arch/arm/Kconfig
> @@ -804,7 +804,7 @@ source "arch/arm/mm/Kconfig"
>
> config IWMMXT
> bool "Enable iWMMXt support"
> - depends on CPU_XSCALE || CPU_XSC3 || CPU_MOHAWK || CPU_PJ4 || CPU_PJ4B
> + depends on !AS_IS_CLANG && !LD_IS_LLD && (CPU_XSCALE || CPU_XSC3 || CPU_MOHAWK || CPU_PJ4 || CPU_PJ4B)
> default y if PXA27x || PXA3xx || ARCH_MMP || CPU_PJ4 || CPU_PJ4B
> help
> Enable support for iWMMXt context switching at run time if
> diff --git a/init/Kconfig b/init/Kconfig
> index 1c12059e0f7e..b0ab3271e900 100644
> --- a/init/Kconfig
> +++ b/init/Kconfig
> @@ -19,6 +19,12 @@ config GCC_VERSION
> config CC_IS_CLANG
> def_bool $(success,$(CC) --version | head -n 1 | grep -q clang)
>
> +config AS_IS_CLANG
> + def_bool $(success,$(AS) --version | head -n 1 | grep -q clang)
> +
> +config LD_IS_LLD
> + def_bool $(success,$(LD) --version | head -n 1 | grep -q LLD)
> +
> config CLANG_VERSION
> int
> default $(shell,$(srctree)/scripts/clang-version.sh $(CC))
> --
> 2.26.0.110.g2183baf09c-goog
Yesterday, when looking trough commits in Linus tree, I saw:
"init/kconfig: Add LD_VERSION Kconfig"
Nick had a patchset to distinguish LINKER via Kconfig (I cannot find
it right now).
So we should do all this the way CC_IS_XXX CC_VERSION handling is done.
I just want to point to [2] where we can rework (simplify) this
handling for CC and LD handling in a further step.
In one of Peter Z. tree someone started to do so (I was inspired by that).
Unfortunately, the hunk from [1] is IMHO a bit mis-placed and CC and
LD handling should stay together:
CC_IS_XXX where XXX is GCC or CLANG
CC_VERSION where CC is GCC or CLANG
LD_IS_XXX where XXX is BFD or GOLD or LLD
LD_VERSION
Just my €0,02.
Regards,
- Sedat -
[1] https://git.kernel.org/linus/9553d16fa671b9621c5e2847d08bd90d3be3349c
[2] https://github.com/ClangBuiltLinux/linux/issues/941
Powered by blists - more mailing lists