Thread overview
mingw, cygwin, Linux (& the memory problem)
May 02, 2005
bug
May 04, 2005
David Friedman
May 05, 2005
bug
May 02, 2005
After some hacking, I was able to build gdc on both MinGW and Cygwin.

The hacks on MinGW are:

1) MinGW donesn't support symlink.  Can David remove the symlink: d/root -> dmd, and  d/phobos/boehm-gc -> ../../../boehm-gc, and maybe also fix some makefile?

2) MinGW desn't have <alloca.h>, use <malloc.h> instead.

3) looks like the converted path name by MinGW's shell cause some confusion in module.c.  Suppose a file foo.d don't have module declaration, if the compilation command is issued at the parent dir of foo.d, it will error out: e.g.

gdc subdir/foo.d

"module ... has non-identifier characters in filename, use module declaration instead"

On Linux and Cygwin, there's no such problem.


The hacks on Cygwin are:

In the makefile, the version string "cygwin" is not defined, so d/phobos/internal/gc/gcgcc.d will error out, saying "FM" is missing, which is defined in gcgccextern.d in version (cygwin) section.


The memory problem reported earlier disappeared on both MinGW/Cygwin (cc1d takes about 252,000K memory).  It only happens on Linux (Gentoo).  This surprised me a little bit, MinGW/Cygwin is more usable memory-wise than Linux itself!



May 04, 2005
bug@d.com wrote:
> After some hacking, I was able to build gdc on both MinGW and Cygwin.
> 
> The hacks on MinGW are:
> 
> 1) MinGW donesn't support symlink.  Can David remove the symlink: d/root -> dmd,
> and  d/phobos/boehm-gc -> ../../../boehm-gc, and maybe also fix some makefile?
> 
> 2) MinGW desn't have <alloca.h>, use <malloc.h> instead.
> 
> 3) looks like the converted path name by MinGW's shell cause some confusion in
> module.c.  Suppose a file foo.d don't have module declaration, if the
> compilation command is issued at the parent dir of foo.d, it will error out:
> e.g.
> 
> gdc subdir/foo.d
> 
> "module ... has non-identifier characters in filename, use module declaration
> instead"
> 
> On Linux and Cygwin, there's no such problem.
> 
> 
> The hacks on Cygwin are:
> 
> In the makefile, the version string "cygwin" is not defined, so
> d/phobos/internal/gc/gcgcc.d will error out, saying "FM" is missing, which is
> defined in gcgccextern.d in version (cygwin) section.

Could you explain this on a bit more?  For MinGW, gcgcc.d is not used. For Cygwin, "cygwin" should be defined by the compiler itself.

> 
> 
> The memory problem reported earlier disappeared on both MinGW/Cygwin (cc1d takes
> about 252,000K memory).  It only happens on Linux (Gentoo).  This surprised me a
> little bit, MinGW/Cygwin is more usable memory-wise than Linux itself!
> 
> 
> 

I know you said your boss would kill you :-), but is there anyway I could get the source file that is doing this?  Maybe remove all the function bodies?

David
May 05, 2005
>> In the makefile, the version string "cygwin" is not defined, so d/phobos/internal/gc/gcgcc.d will error out, saying "FM" is missing, which is defined in gcgccextern.d in version (cygwin) section.
>
>Could you explain this on a bit more?  For MinGW, gcgcc.d is not used. For Cygwin, "cygwin" should be defined by the compiler itself.

It's just standard error when the compiler didn't see the declaration of FM.xxx. I just add "-version=cygwin" into the Makefile, then the compilation go through smoothly.  Looks like "cygwin" is not defined by the compiler in my case, uname: CYGWIN_NT_5.1

>> The memory problem reported earlier disappeared on both MinGW/Cygwin.

Don't worry about the memory problem any more.  After this hint, I suspect it's not GDC's problem, but the problem of my Linux (Gentoo).  So I tried FreeBSD next, and there's no memory problem there either.  So I'm now dumping Gentoo Linux.