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

Getting MiniD to compile on GDC, GNU/Linux

 
Post new topic   Reply to topic     Forum Index -> MiniD
View previous topic :: View next topic  
Author Message
Gregor



Joined: 05 May 2006
Posts: 72
Location: Portland, OR

PostPosted: Tue Aug 15, 2006 11:42 pm    Post subject: Getting MiniD to compile on GDC, GNU/Linux Reply with quote

GDC has finally been updated to 0.20, which corresponds to DMD 0.177. This means that theoretically, MiniD can be compiled with GDC. There are still issues with bugzilla 282 (and what are we at now? 700 some?), however, but these can be solved with the -fonly flag. I'm working on making a makefile that will make it possible to easily compile MiniD under GDC.

There is a bug in DMD and GDC which causes the compiler to spit out a worthless bunch of bogus errors regarding not being able to access minid.types.MM and sometimes minid.types.MDValue.Type. As of DMD 0.177 / GDC 0.20, this still has not been fixed. In order to get it to work with DMD, you have to compile the files in a particular order on the command line -- this order is specified in both the compile.bat and makefile in the repo. Under GDC, however, it takes a little more work, and this thread documents how to do it.

Original post by Gregor:
Quote:
I've been working on getting MiniD to compile under GDC on GNU/Linux. Mind you, I had to hack GDC up to 0.164 ...

I'm getting a rather strange issue, which almost certainly has nothing to do with you, but thought you might want to know:

Code:

minid/state.d:42: no property 'Type' for type 'MDValue'
minid/state.d:42: MDValue.Type is used as a type
minid/state.d:42: cannot have parameter of type void
minid/state.d:47: no property 'Type' for type 'MDValue'
minid/state.d:47: MDValue.Type is used as a type
minid/state.d:47: cannot have parameter of type void
minid/types.d:73: enum MM is forward referenced
minid/state.d:42: no property 'Type' for type 'MDValue'
minid/state.d:42: MDValue.Type is used as a type
minid/state.d:42: cannot have parameter of type void
minid/state.d:47: no property 'Type' for type 'MDValue'
minid/state.d:47: MDValue.Type is used as a type
minid/state.d:47: cannot have parameter of type void
minid/types.d:73: enum MM is forward referenced
Back to top
View user's profile Send private message AIM Address
Gregor



Joined: 05 May 2006
Posts: 72
Location: Portland, OR

PostPosted: Tue Aug 15, 2006 11:49 pm    Post subject: Reply with quote

I believe this is being caused by the import of .state in .types. I think if I move it elsewhere it'll help.
Back to top
View user's profile Send private message AIM Address
Gregor



Joined: 05 May 2006
Posts: 72
Location: Portland, OR

PostPosted: Wed Aug 16, 2006 12:45 am    Post subject: Reply with quote

I made it work by combining types and state ... not a clean solution.

cat types.d state.d > types_state.d
vim types_state.d
<manual fixes go here Razz >
Back to top
View user's profile Send private message AIM Address
Gregor



Joined: 05 May 2006
Posts: 72
Location: Portland, OR

PostPosted: Wed Aug 16, 2006 12:50 am    Post subject: Reply with quote

(Sooooo many posts)

Another fix I had to make (fairly docile one):

Code:
Index: types.d
===================================================================
--- types.d     (revision 52)
+++ types.d     (working copy)
@@ -4,6 +4,7 @@
 import string = std.string;
 import format = std.format;
 import std.c.string;
+import std.stdarg;

 import minid.opcodes;
 import minid.state;
@@ -22,7 +23,7 @@
                utf.encode(s, c);
        }

-       format.doFormat(&putc, arguments, argptr);
+       format.doFormat(&putc, arguments, cast(va_list) argptr);

        return s;
 }
@@ -1056,4 +1057,4 @@
        }

        package SwitchTable[] mSwitchTables;
-}
\ No newline at end of file
+}
Back to top
View user's profile Send private message AIM Address
JarrettBillingsley



Joined: 20 Jun 2006
Posts: 457
Location: Pennsylvania!

PostPosted: Wed Aug 16, 2006 11:04 am    Post subject: Reply with quote

This is bugzilla 282 and also happens in DMD. It can also be solved by changing the order of the compilation on the command line (thanks to Derek Parnell):

gdc state.d types.d compiler.d opcodes.d -ofcompiler

Try that Smile
Back to top
View user's profile Send private message
Gregor



Joined: 05 May 2006
Posts: 72
Location: Portland, OR

PostPosted: Wed Aug 16, 2006 1:38 pm    Post subject: Reply with quote

No luck. My suspicion is that DMD and GDC are far, far too different in their postcompilation stage for that to change it.
Back to top
View user's profile Send private message AIM Address
Gregor



Joined: 05 May 2006
Posts: 72
Location: Portland, OR

PostPosted: Wed Aug 16, 2006 1:52 pm    Post subject: Reply with quote

I made a shell script (compile.sh) to automate the combination necessary for GDC to compile it. It at least makes it easy, even if it's still nasty Smile

Code:
#!/bin/bash
cd "`dirname $0`"

export DFLAGS="-debug -g -ofcompiler"
export DPROG=compiler
export DFILES="minid/types_state.d minid/$DPROG.d minid/opcodes.d minid/types.d minid/state.d"
export DLIBS=

if [ ! -e types.d.orig ]
then
    for i in types state
    do
        mv $i.d $i.d.orig
        echo 'public import minid.types_state;' > $i.d
    done
fi

( echo > nl ;
  echo 'module minid.types_state;' ;
  cat types.d.orig nl nl state.d.orig |
  grep -vE 'import minid\.types;|import minid\.state;|^module.*' ) > types_state.d

cd ..
gdmd $DFILES
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> MiniD 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