linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arm64: vdso32: Fix '--prefix=' value for newer versions of clang
@ 2020-07-23  4:15 Nathan Chancellor
  2020-07-23  4:45 ` Sedat Dilek
  2020-07-23 10:10 ` Will Deacon
  0 siblings, 2 replies; 5+ messages in thread
From: Nathan Chancellor @ 2020-07-23  4:15 UTC (permalink / raw)
  To: Catalin Marinas, Will Deacon
  Cc: linux-arm-kernel, linux-kernel, clang-built-linux,
	Nathan Chancellor, stable

Newer versions of clang only look for $(COMPAT_GCC_TOOLCHAIN_DIR)as [1],
rather than $(COMPAT_GCC_TOOLCHAIN_DIR)$(CROSS_COMPILE_COMPAT)as,
resulting in the following build error:

$ make -skj"$(nproc)" ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- \
CROSS_COMPILE_COMPAT=arm-linux-gnueabi- LLVM=1 O=out/aarch64 distclean \
defconfig arch/arm64/kernel/vdso32/
...
/home/nathan/cbl/toolchains/llvm-binutils/bin/as: unrecognized option '-EL'
clang-12: error: assembler command failed with exit code 1 (use -v to see invocation)
make[3]: *** [arch/arm64/kernel/vdso32/Makefile:181: arch/arm64/kernel/vdso32/note.o] Error 1
...

Adding the value of CROSS_COMPILE_COMPAT (adding notdir to account for a
full path for CROSS_COMPILE_COMPAT) fixes this issue, which matches the
solution done for the main Makefile [2].

[1]: https://github.com/llvm/llvm-project/commit/3452a0d8c17f7166f479706b293caf6ac76ffd90
[2]: https://lore.kernel.org/lkml/20200721173125.1273884-1-maskray@google.com/

Cc: stable@vger.kernel.org
Link: https://github.com/ClangBuiltLinux/linux/issues/1099
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
---
 arch/arm64/kernel/vdso32/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/kernel/vdso32/Makefile b/arch/arm64/kernel/vdso32/Makefile
index d88148bef6b0..5139a5f19256 100644
--- a/arch/arm64/kernel/vdso32/Makefile
+++ b/arch/arm64/kernel/vdso32/Makefile
@@ -14,7 +14,7 @@ COMPAT_GCC_TOOLCHAIN_DIR := $(dir $(shell which $(CROSS_COMPILE_COMPAT)elfedit))
 COMPAT_GCC_TOOLCHAIN := $(realpath $(COMPAT_GCC_TOOLCHAIN_DIR)/..)
 
 CC_COMPAT_CLANG_FLAGS := --target=$(notdir $(CROSS_COMPILE_COMPAT:%-=%))
-CC_COMPAT_CLANG_FLAGS += --prefix=$(COMPAT_GCC_TOOLCHAIN_DIR)
+CC_COMPAT_CLANG_FLAGS += --prefix=$(COMPAT_GCC_TOOLCHAIN_DIR)$(notdir $(CROSS_COMPILE_COMPAT))
 CC_COMPAT_CLANG_FLAGS += -no-integrated-as -Qunused-arguments
 ifneq ($(COMPAT_GCC_TOOLCHAIN),)
 CC_COMPAT_CLANG_FLAGS += --gcc-toolchain=$(COMPAT_GCC_TOOLCHAIN)

base-commit: d15be546031cf65a0fc34879beca02fd90fe7ac7
-- 
2.28.0.rc1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] arm64: vdso32: Fix '--prefix=' value for newer versions of clang
  2020-07-23  4:15 [PATCH] arm64: vdso32: Fix '--prefix=' value for newer versions of clang Nathan Chancellor
@ 2020-07-23  4:45 ` Sedat Dilek
  2020-07-23  4:51   ` Nathan Chancellor
  2020-07-23 10:10 ` Will Deacon
  1 sibling, 1 reply; 5+ messages in thread
From: Sedat Dilek @ 2020-07-23  4:45 UTC (permalink / raw)
  To: Nathan Chancellor
  Cc: Catalin Marinas, Will Deacon, linux-arm-kernel, linux-kernel,
	Clang-Built-Linux ML, stable, Masahiro Yamada

On Thu, Jul 23, 2020 at 6:15 AM Nathan Chancellor
<natechancellor@gmail.com> wrote:
>
> Newer versions of clang only look for $(COMPAT_GCC_TOOLCHAIN_DIR)as [1],
> rather than $(COMPAT_GCC_TOOLCHAIN_DIR)$(CROSS_COMPILE_COMPAT)as,
> resulting in the following build error:
>
> $ make -skj"$(nproc)" ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- \
> CROSS_COMPILE_COMPAT=arm-linux-gnueabi- LLVM=1 O=out/aarch64 distclean \
> defconfig arch/arm64/kernel/vdso32/
> ...
> /home/nathan/cbl/toolchains/llvm-binutils/bin/as: unrecognized option '-EL'
> clang-12: error: assembler command failed with exit code 1 (use -v to see invocation)
> make[3]: *** [arch/arm64/kernel/vdso32/Makefile:181: arch/arm64/kernel/vdso32/note.o] Error 1
> ...
>
> Adding the value of CROSS_COMPILE_COMPAT (adding notdir to account for a
> full path for CROSS_COMPILE_COMPAT) fixes this issue, which matches the
> solution done for the main Makefile [2].
>

[ CC Masahiro ]

Masahiro added a slightly adapted version of [2] in <kbuild.git#fixes>.
Shall this go through kbuild subsystem or folded into [1]?

- Sedat -

[1] https://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild.git/commit/?h=fixes&id=ca9b31f6bb9c6aa9b4e5f0792f39a97bbffb8c51

> [1]: https://github.com/llvm/llvm-project/commit/3452a0d8c17f7166f479706b293caf6ac76ffd90
> [2]: https://lore.kernel.org/lkml/20200721173125.1273884-1-maskray@google.com/
>
> Cc: stable@vger.kernel.org
> Link: https://github.com/ClangBuiltLinux/linux/issues/1099
> Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
> ---
>  arch/arm64/kernel/vdso32/Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/arm64/kernel/vdso32/Makefile b/arch/arm64/kernel/vdso32/Makefile
> index d88148bef6b0..5139a5f19256 100644
> --- a/arch/arm64/kernel/vdso32/Makefile
> +++ b/arch/arm64/kernel/vdso32/Makefile
> @@ -14,7 +14,7 @@ COMPAT_GCC_TOOLCHAIN_DIR := $(dir $(shell which $(CROSS_COMPILE_COMPAT)elfedit))
>  COMPAT_GCC_TOOLCHAIN := $(realpath $(COMPAT_GCC_TOOLCHAIN_DIR)/..)
>
>  CC_COMPAT_CLANG_FLAGS := --target=$(notdir $(CROSS_COMPILE_COMPAT:%-=%))
> -CC_COMPAT_CLANG_FLAGS += --prefix=$(COMPAT_GCC_TOOLCHAIN_DIR)
> +CC_COMPAT_CLANG_FLAGS += --prefix=$(COMPAT_GCC_TOOLCHAIN_DIR)$(notdir $(CROSS_COMPILE_COMPAT))
>  CC_COMPAT_CLANG_FLAGS += -no-integrated-as -Qunused-arguments
>  ifneq ($(COMPAT_GCC_TOOLCHAIN),)
>  CC_COMPAT_CLANG_FLAGS += --gcc-toolchain=$(COMPAT_GCC_TOOLCHAIN)
>
> base-commit: d15be546031cf65a0fc34879beca02fd90fe7ac7
> --
> 2.28.0.rc1
>
> --
> You received this message because you are subscribed to the Google Groups "Clang Built Linux" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to clang-built-linux+unsubscribe@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/clang-built-linux/20200723041509.400450-1-natechancellor%40gmail.com.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] arm64: vdso32: Fix '--prefix=' value for newer versions of clang
  2020-07-23  4:45 ` Sedat Dilek
@ 2020-07-23  4:51   ` Nathan Chancellor
  2020-07-23  4:55     ` Sedat Dilek
  0 siblings, 1 reply; 5+ messages in thread
From: Nathan Chancellor @ 2020-07-23  4:51 UTC (permalink / raw)
  To: Sedat Dilek
  Cc: Catalin Marinas, Will Deacon, linux-arm-kernel, linux-kernel,
	Clang-Built-Linux ML, stable, Masahiro Yamada

On Thu, Jul 23, 2020 at 06:45:07AM +0200, Sedat Dilek wrote:
> On Thu, Jul 23, 2020 at 6:15 AM Nathan Chancellor
> <natechancellor@gmail.com> wrote:
> >
> > Newer versions of clang only look for $(COMPAT_GCC_TOOLCHAIN_DIR)as [1],
> > rather than $(COMPAT_GCC_TOOLCHAIN_DIR)$(CROSS_COMPILE_COMPAT)as,
> > resulting in the following build error:
> >
> > $ make -skj"$(nproc)" ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- \
> > CROSS_COMPILE_COMPAT=arm-linux-gnueabi- LLVM=1 O=out/aarch64 distclean \
> > defconfig arch/arm64/kernel/vdso32/
> > ...
> > /home/nathan/cbl/toolchains/llvm-binutils/bin/as: unrecognized option '-EL'
> > clang-12: error: assembler command failed with exit code 1 (use -v to see invocation)
> > make[3]: *** [arch/arm64/kernel/vdso32/Makefile:181: arch/arm64/kernel/vdso32/note.o] Error 1
> > ...
> >
> > Adding the value of CROSS_COMPILE_COMPAT (adding notdir to account for a
> > full path for CROSS_COMPILE_COMPAT) fixes this issue, which matches the
> > solution done for the main Makefile [2].
> >
> 
> [ CC Masahiro ]
> 
> Masahiro added a slightly adapted version of [2] in <kbuild.git#fixes>.
> Shall this go through kbuild subsystem or folded into [1]?
> 
> - Sedat -
> 
> [1] https://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild.git/commit/?h=fixes&id=ca9b31f6bb9c6aa9b4e5f0792f39a97bbffb8c51

Sorry, should have cc'd Masahiro, slipped my mind.

Note, I kept this separate as the patches have to go back different
distances; only 5.7 has working clang support for vdso32, see
commit a5d442f50a41 ("arm64: vdso32: Enable Clang Compilation") in
Linus' tree, which appeared in 5.7-rc1 so this only needs to go into
linux-5.7.y. The main patch needs to back all the way to 4.4 so we would
need to drop this hunk when backporting, which would be annoying, as the
main patch backports cleanly to 4.9.

It could be routed via the kbuild tree but the arm64 maintainers are
pretty good at getting these fixes into the hands of Linus so I see no
reason to go around them.

Cheers,
Nathan

> > [1]: https://github.com/llvm/llvm-project/commit/3452a0d8c17f7166f479706b293caf6ac76ffd90
> > [2]: https://lore.kernel.org/lkml/20200721173125.1273884-1-maskray@google.com/
> >
> > Cc: stable@vger.kernel.org
> > Link: https://github.com/ClangBuiltLinux/linux/issues/1099
> > Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
> > ---
> >  arch/arm64/kernel/vdso32/Makefile | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/arch/arm64/kernel/vdso32/Makefile b/arch/arm64/kernel/vdso32/Makefile
> > index d88148bef6b0..5139a5f19256 100644
> > --- a/arch/arm64/kernel/vdso32/Makefile
> > +++ b/arch/arm64/kernel/vdso32/Makefile
> > @@ -14,7 +14,7 @@ COMPAT_GCC_TOOLCHAIN_DIR := $(dir $(shell which $(CROSS_COMPILE_COMPAT)elfedit))
> >  COMPAT_GCC_TOOLCHAIN := $(realpath $(COMPAT_GCC_TOOLCHAIN_DIR)/..)
> >
> >  CC_COMPAT_CLANG_FLAGS := --target=$(notdir $(CROSS_COMPILE_COMPAT:%-=%))
> > -CC_COMPAT_CLANG_FLAGS += --prefix=$(COMPAT_GCC_TOOLCHAIN_DIR)
> > +CC_COMPAT_CLANG_FLAGS += --prefix=$(COMPAT_GCC_TOOLCHAIN_DIR)$(notdir $(CROSS_COMPILE_COMPAT))
> >  CC_COMPAT_CLANG_FLAGS += -no-integrated-as -Qunused-arguments
> >  ifneq ($(COMPAT_GCC_TOOLCHAIN),)
> >  CC_COMPAT_CLANG_FLAGS += --gcc-toolchain=$(COMPAT_GCC_TOOLCHAIN)
> >
> > base-commit: d15be546031cf65a0fc34879beca02fd90fe7ac7
> > --
> > 2.28.0.rc1
> >
> > --
> > You received this message because you are subscribed to the Google Groups "Clang Built Linux" group.
> > To unsubscribe from this group and stop receiving emails from it, send an email to clang-built-linux+unsubscribe@googlegroups.com.
> > To view this discussion on the web visit https://groups.google.com/d/msgid/clang-built-linux/20200723041509.400450-1-natechancellor%40gmail.com.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] arm64: vdso32: Fix '--prefix=' value for newer versions of clang
  2020-07-23  4:51   ` Nathan Chancellor
@ 2020-07-23  4:55     ` Sedat Dilek
  0 siblings, 0 replies; 5+ messages in thread
From: Sedat Dilek @ 2020-07-23  4:55 UTC (permalink / raw)
  To: Nathan Chancellor
  Cc: Catalin Marinas, Will Deacon, linux-arm-kernel, linux-kernel,
	Clang-Built-Linux ML, stable, Masahiro Yamada

On Thu, Jul 23, 2020 at 6:51 AM Nathan Chancellor
<natechancellor@gmail.com> wrote:
>
> On Thu, Jul 23, 2020 at 06:45:07AM +0200, Sedat Dilek wrote:
> > On Thu, Jul 23, 2020 at 6:15 AM Nathan Chancellor
> > <natechancellor@gmail.com> wrote:
> > >
> > > Newer versions of clang only look for $(COMPAT_GCC_TOOLCHAIN_DIR)as [1],
> > > rather than $(COMPAT_GCC_TOOLCHAIN_DIR)$(CROSS_COMPILE_COMPAT)as,
> > > resulting in the following build error:
> > >
> > > $ make -skj"$(nproc)" ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- \
> > > CROSS_COMPILE_COMPAT=arm-linux-gnueabi- LLVM=1 O=out/aarch64 distclean \
> > > defconfig arch/arm64/kernel/vdso32/
> > > ...
> > > /home/nathan/cbl/toolchains/llvm-binutils/bin/as: unrecognized option '-EL'
> > > clang-12: error: assembler command failed with exit code 1 (use -v to see invocation)
> > > make[3]: *** [arch/arm64/kernel/vdso32/Makefile:181: arch/arm64/kernel/vdso32/note.o] Error 1
> > > ...
> > >
> > > Adding the value of CROSS_COMPILE_COMPAT (adding notdir to account for a
> > > full path for CROSS_COMPILE_COMPAT) fixes this issue, which matches the
> > > solution done for the main Makefile [2].
> > >
> >
> > [ CC Masahiro ]
> >
> > Masahiro added a slightly adapted version of [2] in <kbuild.git#fixes>.
> > Shall this go through kbuild subsystem or folded into [1]?
> >
> > - Sedat -
> >
> > [1] https://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild.git/commit/?h=fixes&id=ca9b31f6bb9c6aa9b4e5f0792f39a97bbffb8c51
>
> Sorry, should have cc'd Masahiro, slipped my mind.
>
> Note, I kept this separate as the patches have to go back different
> distances; only 5.7 has working clang support for vdso32, see
> commit a5d442f50a41 ("arm64: vdso32: Enable Clang Compilation") in
> Linus' tree, which appeared in 5.7-rc1 so this only needs to go into
> linux-5.7.y. The main patch needs to back all the way to 4.4 so we would
> need to drop this hunk when backporting, which would be annoying, as the
> main patch backports cleanly to 4.9.
>

Clarify your patch by adding...?

Cc: stable@vger.kernel.org # 5.7

> It could be routed via the kbuild tree but the arm64 maintainers are
> pretty good at getting these fixes into the hands of Linus so I see no
> reason to go around them.
>

As you and arm64 maintainers prefer.

- Sedat -

> Cheers,
> Nathan
>
> > > [1]: https://github.com/llvm/llvm-project/commit/3452a0d8c17f7166f479706b293caf6ac76ffd90
> > > [2]: https://lore.kernel.org/lkml/20200721173125.1273884-1-maskray@google.com/
> > >
> > > Cc: stable@vger.kernel.org
> > > Link: https://github.com/ClangBuiltLinux/linux/issues/1099
> > > Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
> > > ---
> > >  arch/arm64/kernel/vdso32/Makefile | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/arch/arm64/kernel/vdso32/Makefile b/arch/arm64/kernel/vdso32/Makefile
> > > index d88148bef6b0..5139a5f19256 100644
> > > --- a/arch/arm64/kernel/vdso32/Makefile
> > > +++ b/arch/arm64/kernel/vdso32/Makefile
> > > @@ -14,7 +14,7 @@ COMPAT_GCC_TOOLCHAIN_DIR := $(dir $(shell which $(CROSS_COMPILE_COMPAT)elfedit))
> > >  COMPAT_GCC_TOOLCHAIN := $(realpath $(COMPAT_GCC_TOOLCHAIN_DIR)/..)
> > >
> > >  CC_COMPAT_CLANG_FLAGS := --target=$(notdir $(CROSS_COMPILE_COMPAT:%-=%))
> > > -CC_COMPAT_CLANG_FLAGS += --prefix=$(COMPAT_GCC_TOOLCHAIN_DIR)
> > > +CC_COMPAT_CLANG_FLAGS += --prefix=$(COMPAT_GCC_TOOLCHAIN_DIR)$(notdir $(CROSS_COMPILE_COMPAT))
> > >  CC_COMPAT_CLANG_FLAGS += -no-integrated-as -Qunused-arguments
> > >  ifneq ($(COMPAT_GCC_TOOLCHAIN),)
> > >  CC_COMPAT_CLANG_FLAGS += --gcc-toolchain=$(COMPAT_GCC_TOOLCHAIN)
> > >
> > > base-commit: d15be546031cf65a0fc34879beca02fd90fe7ac7
> > > --
> > > 2.28.0.rc1
> > >
> > > --
> > > You received this message because you are subscribed to the Google Groups "Clang Built Linux" group.
> > > To unsubscribe from this group and stop receiving emails from it, send an email to clang-built-linux+unsubscribe@googlegroups.com.
> > > To view this discussion on the web visit https://groups.google.com/d/msgid/clang-built-linux/20200723041509.400450-1-natechancellor%40gmail.com.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] arm64: vdso32: Fix '--prefix=' value for newer versions of clang
  2020-07-23  4:15 [PATCH] arm64: vdso32: Fix '--prefix=' value for newer versions of clang Nathan Chancellor
  2020-07-23  4:45 ` Sedat Dilek
@ 2020-07-23 10:10 ` Will Deacon
  1 sibling, 0 replies; 5+ messages in thread
From: Will Deacon @ 2020-07-23 10:10 UTC (permalink / raw)
  To: Catalin Marinas, Nathan Chancellor
  Cc: kernel-team, Will Deacon, clang-built-linux, linux-arm-kernel,
	linux-kernel, stable

On Wed, 22 Jul 2020 21:15:10 -0700, Nathan Chancellor wrote:
> Newer versions of clang only look for $(COMPAT_GCC_TOOLCHAIN_DIR)as [1],
> rather than $(COMPAT_GCC_TOOLCHAIN_DIR)$(CROSS_COMPILE_COMPAT)as,
> resulting in the following build error:
> 
> $ make -skj"$(nproc)" ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- \
> CROSS_COMPILE_COMPAT=arm-linux-gnueabi- LLVM=1 O=out/aarch64 distclean \
> defconfig arch/arm64/kernel/vdso32/
> ...
> /home/nathan/cbl/toolchains/llvm-binutils/bin/as: unrecognized option '-EL'
> clang-12: error: assembler command failed with exit code 1 (use -v to see invocation)
> make[3]: *** [arch/arm64/kernel/vdso32/Makefile:181: arch/arm64/kernel/vdso32/note.o] Error 1
> ...
> 
> [...]

Applied to arm64 (for-next/fixes), thanks!

[1/1] arm64: vdso32: Fix '--prefix=' value for newer versions of clang
      https://git.kernel.org/arm64/c/7b7891c7bdfd

Cheers,
-- 
Will

https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-07-23 10:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-23  4:15 [PATCH] arm64: vdso32: Fix '--prefix=' value for newer versions of clang Nathan Chancellor
2020-07-23  4:45 ` Sedat Dilek
2020-07-23  4:51   ` Nathan Chancellor
2020-07-23  4:55     ` Sedat Dilek
2020-07-23 10:10 ` Will Deacon

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).