There is a powerpc llvm tack-handling ABI violation bugfix and a powerpc64 softfloat support addition (needed for libstand) that have yet to be merged into projects/clang390-import (if they reasonably fit). Both of these fixes are ones required for FreeBSD to support using clang for powerpc and powerpc64 targets. (llvm's bugzilla still has some of the C++ exception handling defects waiting for fixes. But the two fixes below should allow more testing and possibly finding of additional things that need to be worked on for FreeBSD to use clang for powerpc and/or powerpc64.) The llvm reports of fixes are: From: bugzilla-daemon[ at ]llvm.org Subject: [Bug 26519] Clang 3.8.0's "Target: powerpc-unknown-freebsd11.0" code generation is violating the SVR4 ABI (SEGV can result) Date: September 22, 2016 at 10:23:21 AM PDT To: <markmi[ at ]dsl-only.net> Krzysztof Parzyszek changed bug 26519 What Removed Added Status REOPENED RESOLVED Resolution --- FIXED Comment # 11 on bug 26519 from Krzysztof Parzyszek Committed in r282174. You are receiving this mail because: • You reported the bug. From: bugzilla-daemon[ at ]llvm.org Subject: [Bug 26970] clang 3.8.0 for powerpc64 vs. FreeBSD buildworld: error: invalid float ABI 'soft float is not supported for ppc64' Date: October 1, 2016 at 7:12:07 PM PDT To: <markmi[ at ]dsl-only.net> Hal Finkel changed bug 26970 What Removed Added Status NEW RESOLVED Resolution --- FIXED Comment # 1 on bug 26970 from Hal Finkel r283060/r283061 enables soft-float for PPC64. You are receiving this mail because: • You reported the bug.
A commit references this bug: Author: dim Date: Fri Nov 25 18:01:32 UTC 2016 New revision: 309147 URL: https://svnweb.freebsd.org/changeset/base/309147 Log: Pull in r282174 from upstream llvm trunk (by Krzysztof Parzyszek): [PPC] Set SP after loading data from stack frame, if no red zone is present Follow-up to r280705: Make sure that the SP is only restored after all data is loaded from the stack frame, if there is no red zone. This completes the fix for https://llvm.org/bugs/show_bug.cgi?id=26519. Differential Revision: https://reviews.llvm.org/D24466 Reported by: Mark Millard PR: 214433 Changes: head/contrib/llvm/lib/Target/PowerPC/PPCFrameLowering.cpp
A commit references this bug: Author: dim Date: Fri Nov 25 18:12:14 UTC 2016 New revision: 309149 URL: https://svnweb.freebsd.org/changeset/base/309149 Log: Pull in r283060 from upstream llvm trunk (by Hal Finkel): [PowerPC] Refactor soft-float support, and enable PPC64 soft float This change enables soft-float for PowerPC64, and also makes soft-float disable all vector instruction sets for both 32-bit and 64-bit modes. This latter part is necessary because the PPC backend canonicalizes many Altivec vector types to floating-point types, and so soft-float breaks scalarization support for many operations. Both for embedded targets and for operating-system kernels desiring soft-float support, it seems reasonable that disabling hardware floating-point also disables vector instructions (embedded targets without hardware floating point support are unlikely to have Altivec, etc. and operating system kernels desiring not to use floating-point registers to lower syscall cost are unlikely to want to use vector registers either). If someone needs this to work, we'll need to change the fact that we promote many Altivec operations to act on v4f32. To make it possible to disable Altivec when soft-float is enabled, hardware floating-point support needs to be expressed as a positive feature, like the others, and not a negative feature, because target features cannot have dependencies on the disabling of some other feature. So +soft-float has now become -hard-float. Fixes PR26970. Pull in r283061 from upstream clang trunk (by Hal Finkel): [PowerPC] Enable soft-float for PPC64, and +soft-float -> -hard-float Enable soft-float support on PPC64, as the backend now supports it. Also, the backend now uses -hard-float instead of +soft-float, so set the target features accordingly. Fixes PR26970. Reported by: Mark Millard PR: 214433 Changes: head/contrib/llvm/lib/Target/PowerPC/PPC.td head/contrib/llvm/lib/Target/PowerPC/PPCISelLowering.cpp head/contrib/llvm/lib/Target/PowerPC/PPCSubtarget.cpp head/contrib/llvm/lib/Target/PowerPC/PPCSubtarget.h head/contrib/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp head/contrib/llvm/tools/clang/lib/CodeGen/TargetInfo.cpp head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp
Both fixes have been applied to head.