> On 24 Oct 2023, at 20:03, Marek Polacek <pola...@redhat.com> wrote:
> 
> On Tue, Oct 24, 2023 at 10:34:22AM +0100, Iain Sandoe wrote:
>> hi Marek,
>> 
>>> On 24 Oct 2023, at 08:44, Iain Sandoe <i...@sandoe.co.uk> wrote:
>>> On 23 Oct 2023, at 20:25, Marek Polacek <pola...@redhat.com> wrote:
>>>> 
>>>> On Thu, Oct 19, 2023 at 02:24:11PM +0200, Richard Biener wrote:
>>>>> On Wed, Oct 11, 2023 at 10:48 PM Marek Polacek <pola...@redhat.com> wrote:
>>>>>> 
>>>>>> On Tue, Sep 19, 2023 at 10:58:19AM -0400, Marek Polacek wrote:
>>>>>>> On Mon, Sep 18, 2023 at 08:57:39AM +0200, Richard Biener wrote:
>>>>>>>> On Fri, Sep 15, 2023 at 5:09 PM Marek Polacek via Gcc-patches
>>>>>>>> <gcc-patches@gcc.gnu.org> wrote:
>>>> 
>>> 
>>>> and I tried Darwin (104) and that fails with
>>>> 
>>>> *** Configuration aarch64-apple-darwin21.6.0 not supported
>>>> 
>>>> Is anyone else able to build gcc on those machines, or test the attached
>>>> patch?
>>> 
>>> We’re still working on upstreaming the aarch64 Darwin port - the devt. 
>>> branch
>>> is here; https://github.com/iains/gcc-darwin-arm64 (but it will be rebased 
>>> soon
>>> because we just upstreamed some dependencies).
>>> 
>>> In the meantime, I will put your patch into my test queue - hopefully before
>>> next week.
>> 
>> actually, I rebased already .. (but not pushed yet, pending testing).
>> 
>> aarch64-darwin21 bootstrapped fine with your patch (as did x86_64-darwin19)
> 
> Thank you so much Iain!
> 
>> ===
>> 
>> $ /opt/iains/aarch64-apple-darwin21/gcc-14-0-0/bin/gcc /source/test/hello.c 
>> -o hc -fhardened -Whardened
>> cc1: warning: ‘_FORTIFY_SOURCE’ is not enabled by ‘-fhardened’ because 
>> optimizations are turned off [-Whardened]
>> 
>> $ /opt/iains/aarch64-apple-darwin21/gcc-14-0-0/bin/gcc /source/test/hello.c 
>> -o hc -fhardened -Whardened -O
>> <no output>
> 
> That looks correct.
> 
>> I’m about to run the testsuite, but if there’s something else to be tested 
>> please let me know (NOTE: I have not read the patch, just applied it and 
>> built).
> 
> I am mostly curious about the fhardened* tests, if they all pass.

No, some that require __PIE__=2 fail.

That is because Darwin has to handle PIE and PIC locally, because the way in 
which those options interact is different from Linux.  I need to amend Darwin’s 
handling to work together with fhardening on platform versions tor which that’s 
relevant (but do not expect that to be too tricky).

For aarch64-darwin, PIE is mandatory so we had not even been considering it [we 
basically ignore the flag, because all it does is to create tool warnings] (I 
need to fix the ouput of the pp define tho).

For all x86_64  Darwin>=20 warns about no-PIE so we are also defaulting it on 
there.

Of course, none of this should affect these tests (it just means that 
fhardening will be a NOP for PIE on later Darwin).

I’ll look into these changes over the next few days, if I have a chance, in any 
case, they do not need to be relevant to your patch.

Iain

> 
> Thanks,
> Marek

Reply via email to