Page MenuHomeFreeBSD

[PowerPC64] LLVM as default toolchain for PowerPC and PowerPC64
ClosedPublic

Authored by alfredo on May 23 2019, 2:09 PM.

Details

Summary

**Warning: to be commited on "flag day"

This enables LLVM as default toolchain/compiler/linker for PowerPC, PowerPCSPE and PowerPC64 platforms.

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

alfredo edited the summary of this revision. (Show Details)

All known outstanding issues are recorded as parents of this review?

share/mk/src.opts.mk
273 ↗(On Diff #57765)

Should this part be committed independently now? (I.e., this should be applied regardless of what the default is?)

326 ↗(On Diff #57765)

I suppose we cannot turn LLVM_LIBUNWIND on in advance (with gcc 4.2.1)

share/mk/src.opts.mk
273 ↗(On Diff #57765)

Actually this is just a preparation for the flag day, marking this as "Plan Changes" to avoid accidental commit.
This shouldn't be commited now, but reviews are welcome.

326 ↗(On Diff #57765)

True. This need to wait for the flag day.

share/mk/src.opts.mk
273 ↗(On Diff #57765)

I mean, it seems this specific __LLVM_TARGET_FILT change is a bug fix that should go in before the flag day? Any use of Clang on powerpc64 is inherently not the default but needs this change? It doesn't really matter if this doesn't go in until later, just something I wondered about.

alfredo added inline comments.
share/mk/src.opts.mk
273 ↗(On Diff #57765)

oh yeah, this is bug fix! I guess it could go in before, but I personally didn't verified for undesired side effects with current default ABI.
If you prefer to split this part, just let me know.

Moved _LLVM_TARGET_FILT change to D20756

Can't this be done for powerpc*? powerpcspe is probably the only thing that doesn't fully work upstream yet, but I have patches in-flight that might land in LLVM9 before too long.

Can't this be done for powerpc*? powerpcspe is probably the only thing that doesn't fully work upstream yet, but I have patches in-flight that might land in LLVM9 before too long.

Sure, this would require changes in D20261 as well since base LLD is not ready

alfredo retitled this revision from [PowerPC64] LLVM is now the default toolchain for PowerPC64 target binutils BFD linker is kept for compiling 32 bit binaries such as LIB32 and stand/slof to [PowerPC64] LLVM as default toolchain for PowerPC and PowerPC64.
alfredo edited the summary of this revision. (Show Details)
  • Includes PowerPC 32 bit in the list.
  • removes LLDB for PowerPC64, since it expects "powerpc64le" and we are in BE.
alfredo added a reviewer: bdragon.

Patch updated to resolve conflict with current HEAD, and also makes LLD as LD in powerpc (thanks to @bdragon)

Changes to share/man/man5/src.conf.5 are also necessary.

ObsoleteFiles.inc will also need updates since we switch from ld.bfd for 32-bits after all.

You will also need updates to share/man/man7/arch.7 to account for default compiler and linker changes.

Is this blocked on anything now?

AFAIK the plan is to switch all three powerpc* at once and there are currently problems on powerpc64 with linuxkpi (https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=241728) and on powerpc with PF kernel module.

alfredo edited the summary of this revision. (Show Details)

enables clang on powerpcspe
disable lld on powerpc and powerpcspe

share/man/man7/arch.7
347 ↗(On Diff #64095)

minor nit: "mips or sparc64" is a bit tidier than "mips, nor sparc64", English wise.

alfredo edited the summary of this revision. (Show Details)

update man file with @bdragon's comment

share/mk/src.opts.mk
309 ↗(On Diff #65560)

I think this can be ${__T:Mpowerpc*}, but needs to be tested.

332 ↗(On Diff #65560)

Same here. libunwind needs a little love for powerpcspe, but I won't hold up the move.

share/mk/src.opts.mk
309 ↗(On Diff #65560)

Actually, this can be ${TT} == "powerpc", because ${TT} is ${MACHINE}

This revision was not accepted when it landed; it landed in state Needs Review.Dec 27 2019, 3:54 AM
This revision was automatically updated to reflect the committed changes.