Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 8 Sep 2016 02:22:11 -0700
From:      Mark Millard <markmi@dsl-only.net>
To:        FreeBSD PowerPC ML <freebsd-ppc@freebsd.org>
Subject:   Re: 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]
Message-ID:  <48B39DDE-CD64-49A0-8D8E-CFBEE862B41A@dsl-only.net>
In-Reply-To: <BF0692B3-495A-42A5-B37E-55E1CD7F16AD@dsl-only.net>
References:  <BF0692B3-495A-42A5-B37E-55E1CD7F16AD@dsl-only.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2016-Sep-7, at 7:42 PM, Mark Millard <markmi at dsl-only.net> wrote:
>=20
> Krzysztof Parzyszek kristof at swissmail.org wrote on Wed Sep 7 =
23:03:03 UTC 2016
>=20
>> What about this? https://reviews.llvm.org/D13351
>>=20
>>=20
>> -Krzysztof
>>=20
>> 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?
>>>=20
>>> Is there a library that implements the floating point operations? If
>>> not, that is going to be the main obstacle.
>>>=20
>>> -Krzysztof
>=20
> https://reviews.llvm.org/D13351 is for ppc32 (TARGET_ARCH=3Dpowerpc in =
FreeBSD terms), not ppc64 (TARGET_ARCH=3Dpowerpc64 in FreeBSD terms).
>=20
> As Justin Hibbits wrote in answer to what soft-float is used for:
>=20
>> Soft float is required when building the kernel to prevent the =
compiler from using floating point optimizations.
>>=20
>> - - Justin
>=20
>=20
> 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=3Dpowerpc . 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=3Dpowerpc exception handling gets fully fixed I may =
then get to move from buildworld experiments to buildkernel experiments =
for TARGET_ARCH=3Dpowerpc. 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=3Dpowerpc is probably closer to working overall =
than TARGET_ARCH=3Dpowerpc64, 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=3Dpowerpc (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=3Dpowerpc related ABI standard.)
>=20
> But TARGET_ARCH=3Dpowerpc64 just reports that clang does not have =
softfloat and the build stops as things are.
>=20
> =3D=3D=3D
> Mark Millard
> markmi at dsl-only.net
>=20

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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?48B39DDE-CD64-49A0-8D8E-CFBEE862B41A>