www.digitalmars.com         C & C++   DMDScript  

D.gnu - GDC for ARM MacOS / OSX

reply Cecil Ward <cecil cecilward.com> writes:
https://forum.dlang.org/post/mjnbswzizylffjyrigpw forum.dlang.org

On Thursday, 29 June 2023 at 17:16:42 UTC, Cecil Ward wrote:
 On Thursday, 29 June 2023 at 09:18:19 UTC, Iain Buclaw wrote:
 On Thursday, 29 June 2023 at 05:27:57 UTC, Cecil Ward wrote:
 I tried getting GCC on my ARM M2 Mac using the homebrew 
 package manager, which is how I got LDC. It gave me C++ and C 
 and FORTRAN, but no sign of any GDC.
How is GCC available when it has no support for aarch64-darwin2x? (Experimental support is available in [iains fork on github](https://github.com/iains/gcc-darwin-arm64) targeting the 14.x development branch) Iain and I have been going through arm64-darwin support in D run-time, mostly it's just getting cross bootstrap from gcc-11 done cleanly. Nothing that I expect to be made concretely available just yet, though I am hoping that GCC will finally get support for M1/M2 by the time 14.1 is released in May though.
Thankyou for your good work Iain. I don’t have a working GDC as the one on my Raspberry Pi AAarch64 Debian Buster dies with an error message ever time you try to compile. I have run GDC on 32-bit ARM on the Raspberry Pi and in godbolt.org on x86-64. I will get hold of an x86-64 box with Linux on it. Get round the problems that way.
If I understand Iain’s reply correctly, the showstopper was lack of support for AArch64 / MacOS in GCC at the time. Has that situation improved by now ? If the situation now makes either downloading or building GDC / AArch64 / MacOS from sources possible, would someone be kind enough to knock up a shell script for me ? NB I do have a working GDC/Linux on an x86/64 box now, so I can compile D programs on that machine, with GDC, and also to AArch64 using LDC on my Mac M2 machine.
Aug 22
parent reply Iain Buclaw <ibuclaw gdcproject.org> writes:
On Thursday, 22 August 2024 at 16:56:06 UTC, Cecil Ward wrote:
 If I understand Iain’s reply correctly, the showstopper was 
 lack of support for AArch64 / MacOS in GCC at the time. Has 
 that situation improved by now ?

 If the situation now makes either downloading or building GDC / 
 AArch64 / MacOS from sources possible, would someone be kind 
 enough to knock up a shell script for me ?

 NB I do have a working GDC/Linux on an x86/64 box now, so I can 
 compile D programs on that machine, with GDC, and also to 
 AArch64 using LDC on my Mac M2 machine.
I haven't seen anything being posted or committed to GCC mainline around aarch64-darwin support. Despite getting emails of recent activity coming from the fork in github, I suspect it won't be made available for review in time for the feature freeze in September/October. If Iain S. is attending the Cauldron this year, I'll catch up with him in 3 weeks to find out where GCC support is at. I know for at least the last two releases it's been possible to build GCC *on* a Mac M1/M2, just not *for* a Mac M1/M2.
Aug 22
parent Cecil Ward <cecil cecilward.com> writes:
On Thursday, 22 August 2024 at 17:34:58 UTC, Iain Buclaw wrote:
 On Thursday, 22 August 2024 at 16:56:06 UTC, Cecil Ward wrote:
 If I understand Iain’s reply correctly, the showstopper was 
 lack of support for AArch64 / MacOS in GCC at the time. Has 
 that situation improved by now ?

 If the situation now makes either downloading or building GDC 
 / AArch64 / MacOS from sources possible, would someone be kind 
 enough to knock up a shell script for me ?

 NB I do have a working GDC/Linux on an x86/64 box now, so I 
 can compile D programs on that machine, with GDC, and also to 
 AArch64 using LDC on my Mac M2 machine.
I haven't seen anything being posted or committed to GCC mainline around aarch64-darwin support. Despite getting emails of recent activity coming from the fork in github, I suspect it won't be made available for review in time for the feature freeze in September/October. If Iain S. is attending the Cauldron this year, I'll catch up with him in 3 weeks to find out where GCC support is at. I know for at least the last two releases it's been possible to build GCC *on* a Mac M1/M2, just not *for* a Mac M1/M2.
Thanks. A thought: Since I have an x86-64 box, could I cross-compile D programs for AArch64 output? (This might sound a bit mad, but my aim is to look at the quality of the code generated by GDC vs LDC, and also to learn a AArch64 asm.) And I am a true D convert. I would need the appropriate magic runes / switches for that kind of cross-code generation. Could someone perhaps help me with that? It would save me a lot of struggle.
Aug 24