FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

llvmdc builds on Sparc/Linux...sortof

 
Post new topic   Reply to topic     Forum Index -> LDC
View previous topic :: View next topic  
Author Message
wilsonk



Joined: 21 Apr 2006
Posts: 40

PostPosted: Tue Oct 30, 2007 2:58 am    Post subject: llvmdc builds on Sparc/Linux...sortof Reply with quote

Hey Tomas,

As the title suggests I have managed to build llvmdc on Sparc/Linux...but not phobos, as yet. Of course I don't have gdc/rebuild access on Sparc so I will have to build phobos by hand. I will let you know how it goes (there are bound to be some serious issues...but who knows).

I can see output from the 'llvmdc -vv' argument that seems mostly ok. There may be some alignment issues due to the fact that I just used the PPC32 data-layout Wink Sparc for llvm only supports 32-bit at this point, I believe, so I will shoot for that. I will change the data-layout to something more sane soon.

Just thought I would let you know. It only took about 4-5 changes to get this done.

Thanks,
K.Wilson
Back to top
View user's profile Send private message
wilsonk



Joined: 21 Apr 2006
Posts: 40

PostPosted: Tue Oct 30, 2007 10:24 am    Post subject: Reply with quote

Hey Tomas,

Of course not having gdc on Sparc (or dmd) is a show stopper, unless I want to convert phobos to c++ or something. I heard that gdc had a sparc version available at version 0.17...maybe I can find that.

Oh well, it was interesting to see that there aren't that many changes needed later for Sparc-llvmdc....if one can get phobos built!

Thanks,
K.Wilson
Back to top
View user's profile Send private message
lindquist



Joined: 14 Sep 2006
Posts: 55
Location: Copenhagen, Denmark

PostPosted: Wed Oct 31, 2007 3:05 pm    Post subject: Reply with quote

This is pretty cool Razz

You shouldn't need GDC or DSSS/Rebuild to build phobos, it's just the way I chose to do it (I was lazy). lphobos/build.sh could very well be rewritten as a plain script and/or Makefile(s).

GDC is only needed to build the runalltests.d driver as well as the tester.d driver.

If you come up with something to remove the need for rebuild to build lphobos, please send it here Smile
Back to top
View user's profile Send private message
wilsonk



Joined: 21 Apr 2006
Posts: 40

PostPosted: Thu Nov 01, 2007 12:59 am    Post subject: Reply with quote

Hey Tomas,

I managed to get llvmdcore.bc and lphobos.bc built on Sparc Wink

Seems like it worked OK since I managed to build test/a.d into an assembly file and a bitcode file. There is still a small error with llvm's output for saving registers in the assembly file on sparc that I had to change by hand (this is an old bug that I patched in llvm but it checks for gcc vs. native cc, if I remember correctly...I will modify it again for llvmdc).

The .bc file runs!!!! Haha, cool. (There is still some kind of error with the size of unsigned ints that stops other examples from running. I still have to change the data-layout I think).

The assembled 'a.out' file doesn't run though?!? Darnit. Bash says it 'cannot execute binary file' so there must be something wrong with the output. The a.s file LOOKS reasonable, though.

Ah well, I will look into it some more.

Thanks,
K.Wilson

P.S. I will probably need to write a script to automate the building of phobos...I will get it to you if/when I have one.
Back to top
View user's profile Send private message
wilsonk



Joined: 21 Apr 2006
Posts: 40

PostPosted: Thu Nov 01, 2007 1:20 am    Post subject: Reply with quote

It looks like the problem with the 'a.out' file comes from the assembler, because converting to C first and then using 'gcc file.c' actually works on Sparc!!!

So there is basically a small incomplete D compiler for Sparc sitting here (as complete as llvmdc is once I get the data-layout correct, anyways). I haven't tried any other files in the test suite since I have to fix the data-layout first but this is still news, I think.

Keep up the great work on llvmdc Wink

Thanks,
K.Wilson
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> LDC All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group