POD
Aleksey S. Skidan
al.skidan at gmail.com
Fri Dec 29 12:48:40 PST 2006
== Quote from Frits van Bommel (fvbommel at REMwOVExCAPSs.nl)'s article
> Aleksey S. Skidan wrote:
> > What it's all about is that I wanted to port my kernel from C++ into D. With C++
> > it's an easy task. Just turn off ABI-dependent stuff. With D it's not that story.
> > I can't turn off RTTI for ex. Thus I can't compile my kernel not implementing
> > object.d from ABI. And that's not good. I don't want to have extra needless data
> > in my data section. The data I will never use!
> As I've said before, object.d isn't hard to port. The version for my
> kernel has minimal modifications.
> If you're using ld, just pass --gc-sections on the command line to
> remove unreferenced data and code[1]...
> [1]: Caveat: you may need to modify your linker script to use KEEP()
> around sections containing any multiboot headers or other things not
> referenced directly from the code, to make sure they don't get thrown away.
> That includes .ctor* and .dtor* sections, if you use static this(),
> static ~this() or unittest{} blocks in your code and expect the
> ModuleInfo linked list with their info to be built like in Phobos on Linux.
Great thanks I'll try it. Though IMHO it's not a convinient way (more C-lysh is
more convinient as for me [the KISS rule]).
But as the language is young...
More information about the Digitalmars-d
mailing list