View previous topic :: View next topic |
Author |
Message |
wilsonk
Joined: 21 Apr 2006 Posts: 40
|
Posted: Tue Oct 30, 2007 2:58 am Post subject: llvmdc builds on Sparc/Linux...sortof |
|
|
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 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 |
|
|
wilsonk
Joined: 21 Apr 2006 Posts: 40
|
Posted: Tue Oct 30, 2007 10:24 am Post subject: |
|
|
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 |
|
|
lindquist
Joined: 14 Sep 2006 Posts: 55 Location: Copenhagen, Denmark
|
Posted: Wed Oct 31, 2007 3:05 pm Post subject: |
|
|
This is pretty cool
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 |
|
Back to top |
|
|
wilsonk
Joined: 21 Apr 2006 Posts: 40
|
Posted: Thu Nov 01, 2007 12:59 am Post subject: |
|
|
Hey Tomas,
I managed to get llvmdcore.bc and lphobos.bc built on Sparc
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 |
|
|
wilsonk
Joined: 21 Apr 2006 Posts: 40
|
Posted: Thu Nov 01, 2007 1:20 am Post subject: |
|
|
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
Thanks,
K.Wilson |
|
Back to top |
|
|
|