Page 5 of 6
Re: OS in D language
Posted: Sun May 17, 2009 6:11 am
by AndreaOrru
Does LDC support D 2.0?
Re: OS in D language
Posted: Mon May 18, 2009 12:27 pm
by steveklabnik
I'm pretty sure that it doesn't currently.
Re: OS in D language
Posted: Mon May 18, 2009 12:57 pm
by AndreaOrru
You are right. I have tried to compile LDC with the D 2.0 option enabled, and the compilation failed pretty soon.
EDIT:
In fact, it failed even with the D 1.0 option!
Code: Select all
[ 74%] Building CXX object CMakeFiles/ldc.dir/gen/tollvm.cpp.o
/home/andrew/ldc/ldc/gen/tollvm.cpp: In function ‘size_t getTypePaddedSize(const llvm::Type*)’:
/home/andrew/ldc/ldc/gen/tollvm.cpp:723: error: ‘const class llvm::TargetData’ has no member named ‘getTypePaddedSize’
make[2]: *** [CMakeFiles/ldc.dir/gen/tollvm.cpp.o] Error 1
make[1]: *** [CMakeFiles/ldc.dir/all] Error 2
make: *** [all] Error 2
Re: OS in D language
Posted: Fri May 22, 2009 9:14 pm
by steveklabnik
Strange? Did you follow the steps outlined exactly? wilkie just did it (strange coincidence) and the latest version compiled on his machine.
Re: OS in D language
Posted: Sun May 24, 2009 12:40 am
by Wilkie
That I did... several times.
Follow the instructions
here. Do not deviate.
You will need the LLVM from source control. (
not LLVM 2.5). That has been tripping people up the last few weeks. If you have further trouble, refer to #ldc on irc.freenode.net.
Any D 2 stuff will be mostly experimental. Give it a few more months. D 1.0 is much much more stable and has a lot more support. If you need something kernel-like to refer to or to test LDC, you can look at our kernel bare bones, on-topic
here and #xomb on irc.freenode.net.
Re: OS in D language
Posted: Sun May 24, 2009 9:41 am
by AndreaOrru
Thank you very much!
Re: OS in D language
Posted: Sat Jun 06, 2009 10:51 am
by AndreaOrru
I'd want to use llvm-ld as linker, but it seems that it can't be configured through linker scripts. So is it useless for OSdev?
Re: OS in D language
Posted: Sun Jun 07, 2009 10:55 pm
by Wilkie
Here is a manual for llvm-ld. It takes LLVM bitcode, which LDC should (?) produce, but I am not completely sure. LDC should have a linker, itself, though, but it will probably just use ld in the background. Considering LDC produces native executables from source, I'm sure it has a linking stage.
Re: OS in D language
Posted: Sat Jun 20, 2009 10:53 pm
by wilsonk
Hey Wilkie et al.,
LDC is pretty stable now on x86 (x86-64) and should be able to compile most programs. The devs are mostly working on optimizations for speed and code size during compilation (heavily templated code can be a problem for using a lot of memory). There are the odd errors now but half the time those end up being bad code that dmd lets through
LDC does output llvm bitcode but it usually uses ld to link after getting an object file from gcc. You can stop at most stages like outputting LLVM_IR (output-ll), bitcode (output-bc), assembly (output-s) or object code (output-o)...whichever you prefer.
Please, please, if anyone his having trouble building LDC, direct them to #ldc on irc.freenode.net, because there have been some issues with a changing cmake environment and whether someone uses Tango0.99.8 or not.
There is a stable release of ldc that is statically linked here:
http://www.digitalmars.com/d/archives/d ... 16110.html
in case someone can't build it. Ubuntu and a couple other OS's, I think, have nightly builds available somewhere.
Thanks,
K.Wilson
Re: OS in D language
Posted: Sun Jun 21, 2009 9:12 am
by steveklabnik
Good to see you here, wilsonk!
For those of you who don't know (or couldn't tell), he's one of the ldc devs, and has been very helpful over the last few months.
Re: OS in D language
Posted: Sun Jun 21, 2009 9:28 am
by Zenith
Congrats to the LDC devs! Proper support for x86-64 is what I've been waiting for before switching to LDC from GDC for my OS. Though to be honest, the only really compelling reason for me to switch is the lack of maintainers and development for GDC (though the last commit was "only" five months ago).
But I'm wondering, is LDC buildable on Cygwin/Windows as it is? If not, will it ever be supported in the future?
Re: OS in D language
Posted: Fri Jul 17, 2009 3:07 pm
by wilsonk
Hey Zenith,
Sorry to take so long answering this...I am not really a regular here
Yes LDC builds on mingw, but it is still missing exceptions on windows. This means that it isn't totally useful yet. We have been trying to get exceptions working, but there is no support for sjlj (setjump/longjump) on x86 and no support for windows SEH (Structured Exception Handling) at all.
Hang in there to all those waiting for mingw/LDC...we are trying to get exceptions working (we have even tried the newest gcc-4.4 with dwarf2 exceptions but that may be just as difficult as SEH...darnit!!!).
Thanks,
K.Wilson
Re: OS in D language
Posted: Fri Jul 17, 2009 3:43 pm
by Zenith
Awesome! I only use GDC for my OS right now under Cygwin/Windows for targeting the x86-64, and DMD 2.* for userspace development. I guess soon I can switch both of them to LDC.
Though I'm sorry to bug you a bit more, but I was really specifically wondering about future support with
Cygwin as opposed to Mingw? IIRC the build script for LDC actually detects the Cygwin installation and explicitly stops the build.
Re: OS in D language
Posted: Sat Jul 18, 2009 4:26 pm
by wilsonk
Sorry Zenith,
No cygwin support is in the works here. We'll see if someone steps up to do it soon....
Thanks,
K.Wilson
Re: OS in D language
Posted: Thu Aug 06, 2009 11:20 am
by BuRnEr
I have been trying to get the D Barebone from the wiki to run, using the ldc compiler.
Linking failed, due to the fact that ldc always imports object.d at compile-time even with -nodefaultlib -noruntime.
So I joined the irc channel of the ldc project to asked for advice. I seems ldc imports object.d by default and there is nothing you can do about it.
Unwilling to import object from XOmb or even tango, I tried to write one my own.
Code: Select all
module object;
class Object {}
class ClassInfo : Object{}
gave me a seg. fault with both ldc and dmd.
So I was wondering if, somebody knows how to write a really small object.d so linking doesn't fail?