gdc for rv32&64

Iain Buclaw ibuclaw at gdcproject.org
Mon Aug 16 08:43:40 UTC 2021


On Sunday, 15 August 2021 at 19:42:11 UTC, Mahdi wrote:
> On Sunday, 15 August 2021 at 17:22:28 UTC, max haughton wrote:
>> On Sunday, 15 August 2021 at 15:03:26 UTC, Mahdi wrote:
>>> Hi Iain Buclaw, we appreciate your efforts in the d for the 
>>> gnu ecosystem.
>>> but what is the status of gdc for risc-v architecture, 
>>> especially newlib?
>>
>> explore.dgnu.org
>>
>> Have a play with that, RISC-V should work perfectly fine for 
>> low level things like MCUs. Now, as for druntime and Phobos 
>> I'm not sure, you'll probably have to look at the source code.
>
> Thanks Max, I played with explore.dgnu.org and it doesn't seem 
> to have a problem with risc-v64&32-linux-gnu, but unfortunately 
> it still doesn't support riscv64-elf target.
> This target (elf) is much more suitable for writing metal-bare 
> or operation system goals.

The list of targets on that site is only what's present in 
[contrib/config-list.mk](https://github.com/gcc-mirror/gcc/blob/91292490d573f9f9e4f162d6d8c693a969197f2d/contrib/config-list.mk#L32-L105), which is just a bunch of configurations that try to cover the broadest test vectors of the compiler back-end, and is in no way the full range of supported targets of GDC.

There is no difference between the -linux and -elf sub-targets of 
RISC-V, other than one you can build Phobos with, and the other 
you can't.

As for Newlib, the predefined version condition exists (but only 
for Cygwin), but no one has yet ported Druntime to Newlib.

It might make sense to assume that Newlib will always be 
available on ELF/Fuchsia/RTEMS, but I haven't seen the need to 
build either Druntime/Phobos for any of the bare-metal targets, 
as you'll more likely be providing your own minimal Druntime, or 
using any of the existing ones, such as Minlibd or LWDR.


More information about the D.gnu mailing list