D for embedded system

Johannes Pfau nospam at example.com
Sat Oct 20 11:40:50 PDT 2012


Am Sat, 20 Oct 2012 17:27:33 +0200
schrieb "Timo Sintonen" <t.sintonen at luukku.com>:

> On Saturday, 20 October 2012 at 14:35:44 UTC, Martin Nowak wrote:
> > I recently did a project on the STM32F0-Discovery board.
> > After having used a nice arm-none-eabi-*/openocd toolchain I 
> > wonder what is needed to build a cross-gdc.
> > As these devices are really short on Flash and RAM I would've 
> > only translated the peripheral headers
> > without using any runtime.
> > Not sure though if you can get classes without full typeinfos 
> > support.
> >
> Object is a parent for all classes so nothing can be compiled 
> without it. One test I made shows that object and typeinfo would 
> take 16-20 kb flash. In addition we need some libc code and 
> application code. STM32F0 may be too small. My target is STM32F4
> 
> 

It's sad that we don't have a documentation about features which
require runtime support. If you manage to get this working please make
some notes about what features need the runtime (You can use the gdc
wiki, gdcproject.org/wiki or the d wiki:
http://prowiki.org/wiki4d/wiki.cgi?FrontPage )

BTW: Here's the dmd commit which introduced betterc:
https://github.com/D-Programming-Language/dmd/commit/707949edc30f245a68145bef619f6f02b85e39ab

but right now it only disables moduleinfo generation, afaics.

You probably already noticed that you can compile stuff without druntime
support just fine (compile with -nophoboslib), as long as you only use c
functions:
-----------------------------
import core.stdc.stdio;

extern(C) in main(int argc, const char* argv[])
{
    printf("Hello World!\n".ptr);
    return 0;
}
-----------------------------

As soon as a feature requires runtime support you'll get linker errors.


More information about the D.gnu mailing list