On 5 May 2015 at 08:39, Dan Olson via Digitalmars-d <digitalmars-d@puremagic.com> wrote: > "Mike" <n...@none.com> writes: > >> Read on GitHub: https://github.com/JinShil/minimal_druntime_experiment >> >> There was recently a discussion about how we could create a portable, >> pay-as-you-go, D runtime to help bring the promise of D to >> free-standing platforms and devices with tight resource constraints >> (e.g. microcontrollers). Thread started here: >> http://forum.dlang.org/post/mhrs4p$31id$1...@digitalmars.com > > This is cool stuff. Embedded has been the bulk of my software life and > is most fun. I see there has been a lot of discussion that I'll have to > read up on before I say much more though. > >> * the newlib C library > > newlib has treated me well in the past, especially being so highly > customizable. I think it is a good choice. It would be fun to rewrite > it in D, but that perhaps is much work for little immediate benefit. > >> >> Plea to Compiler Implementers >> *********************************** >> We need better control over codegen. TypeInfo and dead-code removal >> is preventing me from making progress >> (http://forum.dlang.org/post/quemhwpgijwmqtpxu...@forum.dlang.org). I've >> resorted to compiling to assembly, using sed to hack the assembly, and >> then compiling the assembly. Things like that make me want to not use >> D at all. > > Yeah, this should be improved. > > How about a -disable-tls option so that when there are no threads and > thus no TLS, you can compile exising D code as-is. Otherwise you have > to rewrite normal variables to __gshared everywhere (I actually have this > option in a ldc fork). >
Configure GDC with --disable-tls --disable-threads to get the desired behaviour (disabling only TLS just makes codegen fallback to emulated thread support).