apple silicon fortran

Iain Sandoe idsandoe@googlemail.com
Sat Jan 9 19:30:53 GMT 2021


Hi Jim,

James Secan <james.secan@gmail.com> wrote:
>> On Jan 9, 2021, at 11:07 AM, Iain Sandoe via Fortran  
>> <fortran@gcc.gnu.org> wrote:

>> I am testing out the Rosetta 2 alternative (which is, AFAIU, a  
>> binary-conversion done at install-time native on macOS).
>>
>> Useful to have some fall-back solutions in the short-term, but a native  
>> compiler is still the eventual objective.
>

> I would think that running the compiler under Rosetta 2 would still  
> produce a binary that is not compatible with the M1 processor (would it  
> run on a Mac Intel box?).

Yes, that’s right - it would be an x86_64 compiler, running via Rosetta on  
Arm64, producing X86_64 object ...

>  Can you run the binary on M1 using Rosetta 2 again?

… it would seem to defeat some use-case if not - given that the bootstrap  
succeeded, evidently yes (but perhaps using the JIT mechanism, which might  
not perform so well)..

> And my admittedly-shallow understanding of Rosetta 2, isn’t it supposed  
> to generate a new binary the first time a code is run using it, said new  
> binary then being run directly in a subsequent invocation of  
> Rosetta2+userApp?

Actually, (from limited reading, and likely equally shallow understaning),  
it seems that this operates two ways;  a one-off when something is  
installed (so that from then-on one is running native code, with no  
translation phase).  That’s different from the Rosetta 1 (PowerPC=>X86).

The second mode is more akin to the Rosetta 1 case, a JIT that is run as  
needed...

> I am interested to hear the results of your testing with Rosetta 2.

I bootstrapped x86_64-apple-darwin20 on aarch64-darwin20.3, and currently  
running the Fortran testsuite - it’s not clear to me if some of the issues  
(PIE and no-executable stack) will be sidestepped or not.  We shall see.

Iain



More information about the Fortran mailing list