mbox series

[0/3] Allow CONFIG_PPC64_BIG_ENDIAN_ELF_ABI_V2 with ld.lld 15+

Message ID 20230118-ppc64-elfv2-llvm-v1-0-b9e2ec9da11d@kernel.org (mailing list archive)
Headers show
Series Allow CONFIG_PPC64_BIG_ENDIAN_ELF_ABI_V2 with ld.lld 15+ | expand

Message

Nathan Chancellor Feb. 15, 2023, 6:41 p.m. UTC
Currently, CONFIG_PPC64_BIG_ENDIAN_ELF_ABI_V2 is not selectable with
ld.lld because of an explicit dependency on GNU ld, due to lack of
testing with LLVM.

Erhard was kind enough to test this option on his hardware with LLVM 15,
which ran without any issues. This should not be too surprising, as
ld.lld does not have support for the ELFv1 ABI, only ELFv2, so it should
have decent support. With this series, big endian kernels can be built
with LLVM=1.

This has seen our basic set of powerpc configurations with clang-15,
clang-16, and clang-17 but I will never be opposed to more testing :)

The first two patches fix a couple of issues I noticed while build
testing and the final patch actually allows the option to be selected.

---
Nathan Chancellor (3):
      powerpc/boot: Only use '-mabi=elfv2' with CONFIG_PPC64_BOOT_WRAPPER
      powerpc: Fix use of '-mabi=elfv2' with clang
      powerpc: Allow CONFIG_PPC64_BIG_ENDIAN_ELF_ABI_V2 with ld.lld 15+

 arch/powerpc/Kconfig       | 3 +--
 arch/powerpc/Makefile      | 4 +---
 arch/powerpc/boot/Makefile | 6 +++---
 3 files changed, 5 insertions(+), 8 deletions(-)
---
base-commit: 5dc4c995db9eb45f6373a956eb1f69460e69e6d4
change-id: 20230118-ppc64-elfv2-llvm-39edac67bf0a

Best regards,

Comments

Michael Ellerman Feb. 20, 2023, 6:11 a.m. UTC | #1
Nathan Chancellor <nathan@kernel.org> writes:
> Currently, CONFIG_PPC64_BIG_ENDIAN_ELF_ABI_V2 is not selectable with
> ld.lld because of an explicit dependency on GNU ld, due to lack of
> testing with LLVM.
>
> Erhard was kind enough to test this option on his hardware with LLVM 15,
> which ran without any issues. This should not be too surprising, as
> ld.lld does not have support for the ELFv1 ABI, only ELFv2, so it should
> have decent support. With this series, big endian kernels can be built
> with LLVM=1.
>
> This has seen our basic set of powerpc configurations with clang-15,
> clang-16, and clang-17 but I will never be opposed to more testing :)
>
> The first two patches fix a couple of issues I noticed while build
> testing and the final patch actually allows the option to be selected.

Thanks for this.

I thought about applying this last week but decided not to. I'll plan to
pick it up for 6.4.

cheers
Nathan Chancellor Feb. 20, 2023, 3:51 p.m. UTC | #2
On Mon, Feb 20, 2023 at 05:11:54PM +1100, Michael Ellerman wrote:
> Nathan Chancellor <nathan@kernel.org> writes:
> > Currently, CONFIG_PPC64_BIG_ENDIAN_ELF_ABI_V2 is not selectable with
> > ld.lld because of an explicit dependency on GNU ld, due to lack of
> > testing with LLVM.
> >
> > Erhard was kind enough to test this option on his hardware with LLVM 15,
> > which ran without any issues. This should not be too surprising, as
> > ld.lld does not have support for the ELFv1 ABI, only ELFv2, so it should
> > have decent support. With this series, big endian kernels can be built
> > with LLVM=1.
> >
> > This has seen our basic set of powerpc configurations with clang-15,
> > clang-16, and clang-17 but I will never be opposed to more testing :)
> >
> > The first two patches fix a couple of issues I noticed while build
> > testing and the final patch actually allows the option to be selected.
> 
> Thanks for this.
> 
> I thought about applying this last week but decided not to. I'll plan to
> pick it up for 6.4.

No worries, I sent this much later in the development cycle than I had
initially intended, so I figured that 6.3 was a long shot anyways. Plus
more soak time is never a bad thing :)

Thanks for taking the initial look, cheers!
Nathan
Michael Ellerman March 22, 2023, 12:25 p.m. UTC | #3
On Wed, 15 Feb 2023 11:41:14 -0700, Nathan Chancellor wrote:
> Currently, CONFIG_PPC64_BIG_ENDIAN_ELF_ABI_V2 is not selectable with
> ld.lld because of an explicit dependency on GNU ld, due to lack of
> testing with LLVM.
> 
> Erhard was kind enough to test this option on his hardware with LLVM 15,
> which ran without any issues. This should not be too surprising, as
> ld.lld does not have support for the ELFv1 ABI, only ELFv2, so it should
> have decent support. With this series, big endian kernels can be built
> with LLVM=1.
> 
> [...]

Applied to powerpc/next.

[1/3] powerpc/boot: Only use '-mabi=elfv2' with CONFIG_PPC64_BOOT_WRAPPER
      https://git.kernel.org/powerpc/c/d1c5accacb234c3a9f1609a73b4b2eaa4ef07d1a
[2/3] powerpc: Fix use of '-mabi=elfv2' with clang
      https://git.kernel.org/powerpc/c/7c3bd8362b06cff0a4044a4975adb7d71db2dfba
[3/3] powerpc: Allow CONFIG_PPC64_BIG_ENDIAN_ELF_ABI_V2 with ld.lld 15+
      https://git.kernel.org/powerpc/c/a11334d8327b3fd7987cbfb38e956a44c722d88f

cheers