Hi Paul,

> On 26 Nov 2022, at 15:48, Paul Koning via Gcc <gcc@gcc.gnu.org> wrote:

>> On Nov 25, 2022, at 3:46 PM, Iain Sandoe <idsan...@googlemail.com> wrote:
>> 

>>> On 25 Nov 2022, at 20:13, Andrew Pinski via Gcc <gcc@gcc.gnu.org> wrote:
>>> 
>>> On Fri, Nov 25, 2022 at 12:08 PM Paul Koning <paulkon...@comcast.net> wrote:
>>>> 
>>>>> On Nov 25, 2022, at 3:03 PM, Andrew Pinski <pins...@gmail.com> wrote:
>>>>> 
>>>>> On Fri, Nov 25, 2022 at 11:59 AM Paul Koning via Gcc <gcc@gcc.gnu.org> 
>>>>> wrote:
>>>>>> 
>>>>>> I'm trying to use fairly recent GCC sources (the gcc-darwin branch to be 
>>>>>> precise) to build Ada, starting with the latest (2020) release of Gnat 
>>>>>> from Adacore.
>>>>> 
>>>>> Are you building a cross compiler or a native compiler?
>>>>> If you are building a cross, you need to bootstrap a native compiler 
>>>>> first.
>>>> 
>>>> I'm not sure.  The installed Gnat is x86_64-darwin; I want to build 
>>>> aarch64-darwin.
>>> 
>>> You have to build a x86_64-darwin compiler first with the same sources
>>> as you are building for aarch64-darwin.
>> 
>> So .. 
>> 1/ if you are on arm64 Darwin, 
>> - the first step is to bootstrap the compiler using Rosetta 2 and the 
>> available x86_64 gnat.
>> 
>> 2/ if you are on x86_64 Darwin…
>> - the first step is to bootstrap the compiler using the available x86-64 
>> gnat.
> 
> Thanks all.
> 
> I tried that (#1) and got the same failure.  The trouble seems to be that the 
> current sources have Ada2020 constructs in them and the available Gnat 
> doesn't support that version.  The commit that introduces these (or some of 
> them at least) is 91d68769419b from Feb 4, 2022.

I am part way through the exercise on both macOS 11 (X86) and 12 (Arm64).

** However, I am using gcc-7.5 as the bootstrap compiler, not gcc-5.1.

You might find problems unless you actually start a Rosetta 2 shell - so 
“ arch -x86_64 bash “ 
and then go from there (this seems to ensure that sub-processes are started as 
x86_64)

(with this, bootstrap succeeded for both x86_64 Rosetta 2  and rebased Arm64 
branch native - r13-4309-g309e2d95e3b9)

I will push the rebased arm64 branch when testing is done.

> So I'm guessing I'll have to do this in two parts, first build a newer but 
> not-latest Gnat from a release that doesn't include the problematic 
> constructs, then follow that by using the intermediate to build the current 
> sources.
> 
> I wonder if this incompatibility was intentional.  If not it would be good 
> for the Ada maintainers to fix these and ensure that the current code can 
> still be built with the most recent public release of Gnat.  Conversely, if 
> it is intentional, the documentation should be updated to explain how to 
> build the current code.

The current statement  (https://gcc.gnu.org/install/prerequisites.html) is:

GNAT
In order to build GNAT, the Ada compiler, you need a working GNAT compiler (GCC 
version 5.1 or later).

so, if 5.1 is not working, then perhaps a PR is in order.

cheers
Iain

Reply via email to