From llvm: Fwd: [Bug 26519] Clang 3.8.0's "Target: powerpc-unknown-freebsd11.0" code generation is violating the SVR4 ABI (SEGV can result) [fixed in llvm -r280705]

Mark Millard markmi at dsl-only.net
Thu Sep 8 10:22:16 UTC 2016


On 2016-Sep-7, at 7:42 PM, Mark Millard <markmi at dsl-only.net> wrote:
> 
> Krzysztof Parzyszek kristof at swissmail.org wrote on Wed Sep 7 23:03:03 UTC 2016
> 
>> What about this? https://reviews.llvm.org/D13351
>> 
>> 
>> -Krzysztof
>> 
>> On 9/7/2016 5:50 PM, Krzysztof Parzyszek wrote:
>>> What are the requirements for soft-float, i.e. what conditions exactly
>>> does the generated code need to meet? Is the purpose of it to eliminate
>>> the use of floating point registers?
>>> 
>>> Is there a library that implements the floating point operations? If
>>> not, that is going to be the main obstacle.
>>> 
>>> -Krzysztof
> 
> https://reviews.llvm.org/D13351 is for ppc32 (TARGET_ARCH=powerpc in FreeBSD terms), not ppc64 (TARGET_ARCH=powerpc64 in FreeBSD terms).
> 
> As Justin Hibbits wrote in answer to what soft-float is used for:
> 
>> Soft float is required when building the kernel to prevent the compiler from using floating point optimizations.
>> 
>> - - Justin
> 
> 
> I think that "optimizations" here means (in part?) avoiding the floating point hardware as the kernel need not save/restore the registers and the like for its own activities. Only user-space gets that service as I understand.

I should have also noted that "buildworld" tries to build libstand, even with no attempt to build the kernel. libstand allows for having "standalone applications, mimicking where possible the standard BSD programming environment". Lack of libstand powerpc64 completing blocks buildworld for that context.

But to you: Thanks much for updating clang/llvm to improve FreeBSD use for TARGET_ARCH=powerpc . It will be nice to remove the so-called "red-zone" code once FreeBSD has adopted the compiler changes (probably in current/12 ). (The changes are personal, not FreeBSD official. FreeBSD sticks to requiring ABI be followed.)

If the TARGET_ARCH=powerpc exception handling gets fully fixed I may then get to move from buildworld experiments to buildkernel experiments for TARGET_ARCH=powerpc. That depends on how well kyua testing goes: kyua requires C++ exceptions to work well to have any chance at completing a test pass as I understand.

(Right now TARGET_ARCH=powerpc is probably closer to working overall than TARGET_ARCH=powerpc64, although both tend to have similar exception handling problems as I remember. Hal Finkel has made some recent fixes to some of the reports in that area, spanning both powerpc64 and powerpc as I understand.)

As for when for me: It looks to be a few more weeks before I'll again have access to the powerpc's and powerpc64's. I'm not sure when FreeBSD will adopt the recent powerpc64 and powerpc related updates, including yours. Also it may take some time for me to update from where I left things in early June once I again have access.

> I have used clang/clang++ to do a partially-working FreeBSD buildworld for TARGET_ARCH=powerpc (ppc32) based on https://reviews.llvm.org/D13351 material having been included in clang 3.8.0. (I had to temporarily modify the kernel to have a so-called "red-zone" on the stack for signal delivery, effectively stepping outside FreeBSD's TARGET_ARCH=powerpc related ABI standard.)
> 
> But TARGET_ARCH=powerpc64 just reports that clang does not have softfloat and the build stops as things are.
> 
> ===
> Mark Millard
> markmi at dsl-only.net
> 

===
Mark Millard
markmi at dsl-only.net



More information about the freebsd-ppc mailing list