On 10 January 2017 at 19:04, Iain Buclaw via Digitalmars-d <digitalmars-d@puremagic.com> wrote:
On 10 January 2017 at 09:22, Manu via Digitalmars-d
<digitalmars-d@puremagic.com> wrote:
> Can any of the GDC guys comment on how difficult it would be to get this
> toolchain build script to include building GDC?
>
> https://github.com/SaturnSDK/Saturn-SDK-GCC-SH2
>
> I have a mate who's hacking on the Saturn and wants to build one of my
> projects.
> It'd be a really great test for embedded D; fairly small realtime target. I
> expect binary size to be a problem ;)

Debian already has builds for SH4, there's just no druntime support.

Cool. Obviously, this is an SH2 toolchain, and it's baremetal, not linux. Not sure what c-runtime it uses, but probably not glibc.

https://goo.gl/dznZIF

But getting druntime working on it should be trivial enough.

I'm looking for just the BetterC experience, but druntime still seems somewhat necessary... what parts need to be implemented for BetterC to work well?

- Fix core.stdc.* to handle the arch-specific bits for SH (just copy
from C headers).
- There's threadasm.S if you want to implement native fiber support,
otherwise you can fall back to ucontext_t.

I expect existing SH4 code should be mostly compatible, and a good headstart.
Doesn't sound too bad. I'm not using fibers though.

Does double == float on this platform?  That might be interesting...

I think SH2 supports double, but it would be terminally slow... Is there a way to force double == float? What would that do to D?