OSDev.org

The Place to Start for Operating System Developers
It is currently Fri Mar 29, 2024 6:09 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 77 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6  Next
Author Message
 Post subject: Re: OS in D language
PostPosted: Sun May 17, 2009 6:11 am 
Offline
Member
Member
User avatar

Joined: Fri Apr 25, 2008 2:50 pm
Posts: 50
Location: New York
Does LDC support D 2.0?

_________________
Close the world, txEn eht nepO


Top
 Profile  
 
 Post subject: Re: OS in D language
PostPosted: Mon May 18, 2009 12:27 pm 
Offline
Member
Member
User avatar

Joined: Wed Jan 28, 2009 4:30 pm
Posts: 72
I'm pretty sure that it doesn't currently.


Top
 Profile  
 
 Post subject: Re: OS in D language
PostPosted: Mon May 18, 2009 12:57 pm 
Offline
Member
Member
User avatar

Joined: Fri Apr 25, 2008 2:50 pm
Posts: 50
Location: New York
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:
[ 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

_________________
Close the world, txEn eht nepO


Top
 Profile  
 
 Post subject: Re: OS in D language
PostPosted: Fri May 22, 2009 9:14 pm 
Offline
Member
Member
User avatar

Joined: Wed Jan 28, 2009 4:30 pm
Posts: 72
Strange? Did you follow the steps outlined exactly? wilkie just did it (strange coincidence) and the latest version compiled on his machine.


Top
 Profile  
 
 Post subject: Re: OS in D language
PostPosted: Sun May 24, 2009 12:40 am 
Offline
Member
Member
User avatar

Joined: Tue Aug 26, 2008 10:02 pm
Posts: 44
Location: Land of the Dead
That I did... several times. :D

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.


Top
 Profile  
 
 Post subject: Re: OS in D language
PostPosted: Sun May 24, 2009 9:41 am 
Offline
Member
Member
User avatar

Joined: Fri Apr 25, 2008 2:50 pm
Posts: 50
Location: New York
Thank you very much!

_________________
Close the world, txEn eht nepO


Top
 Profile  
 
 Post subject: Re: OS in D language
PostPosted: Sat Jun 06, 2009 10:51 am 
Offline
Member
Member
User avatar

Joined: Fri Apr 25, 2008 2:50 pm
Posts: 50
Location: New York
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?

_________________
Close the world, txEn eht nepO


Top
 Profile  
 
 Post subject: Re: OS in D language
PostPosted: Sun Jun 07, 2009 10:55 pm 
Offline
Member
Member
User avatar

Joined: Tue Aug 26, 2008 10:02 pm
Posts: 44
Location: Land of the Dead
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.


Top
 Profile  
 
 Post subject: Re: OS in D language
PostPosted: Sat Jun 20, 2009 10:53 pm 
Offline

Joined: Sat Jun 20, 2009 10:34 pm
Posts: 3
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


Top
 Profile  
 
 Post subject: Re: OS in D language
PostPosted: Sun Jun 21, 2009 9:12 am 
Offline
Member
Member
User avatar

Joined: Wed Jan 28, 2009 4:30 pm
Posts: 72
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.


Top
 Profile  
 
 Post subject: Re: OS in D language
PostPosted: Sun Jun 21, 2009 9:28 am 
Offline
Member
Member
User avatar

Joined: Tue Apr 10, 2007 4:42 pm
Posts: 224
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). :lol:

But I'm wondering, is LDC buildable on Cygwin/Windows as it is? If not, will it ever be supported in the future?

_________________
"Sufficiently advanced stupidity is indistinguishable from malice."


Top
 Profile  
 
 Post subject: Re: OS in D language
PostPosted: Fri Jul 17, 2009 3:07 pm 
Offline

Joined: Sat Jun 20, 2009 10:34 pm
Posts: 3
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


Top
 Profile  
 
 Post subject: Re: OS in D language
PostPosted: Fri Jul 17, 2009 3:43 pm 
Offline
Member
Member
User avatar

Joined: Tue Apr 10, 2007 4:42 pm
Posts: 224
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. :D

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. :?

_________________
"Sufficiently advanced stupidity is indistinguishable from malice."


Top
 Profile  
 
 Post subject: Re: OS in D language
PostPosted: Sat Jul 18, 2009 4:26 pm 
Offline

Joined: Sat Jun 20, 2009 10:34 pm
Posts: 3
Sorry Zenith,

No cygwin support is in the works here. We'll see if someone steps up to do it soon....

Thanks,
K.Wilson


Top
 Profile  
 
 Post subject: Re: OS in D language
PostPosted: Thu Aug 06, 2009 11:20 am 
Offline

Joined: Wed Aug 05, 2009 2:40 pm
Posts: 2
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:
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?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 77 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6  Next

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 32 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group