On Friday, 6 July 2012 at 09:38:13 UTC, Jacob Carlborg wrote:
On 2012-07-06 08:53, BLM768 wrote:
I've been trying to write an OS kernel in D, and I'm having
issues with
the runtime. I'm trying to use LDC's -noruntime option, which
is
_supposed_ to prevent any runtime calls from being generated,
but the
linker keeps complaining about unresolved references to
_d_assert_msg
and other runtime functions. It seems that LDC is ignoring the
switch
and is generating runtime references anyway. Is there some
other way to
force it to stop trying to pull in the runtime? I'd rather not
have to
create/link a custom runtime at this point; I don't even have
a memory
allocator written, so I really don't want to mess with a
runtime yet.
I'm pretty sure that the only thing the -noruntime flag does is
preventing the runtime from being linked. It will not prevent
the compiler for generating calls to the runtime.
So if you see calls to runtime functions you need to stub them
out as Alex suggested or try to find a way to avoid them. Note
that the compiler will link with the standard library by
default as well. I don't know if the -noruntime flag prevents
that.
The output of the --help switch suggested that it would actually
keep LDC from generating the calls, but I guess not. Looks like
I've got a rumtime to stub out. At least I'll understand it
better when I'm done.