www.digitalmars.com         C & C++   DMDScript  

D.gnu - mingw, cygwin, Linux (& the memory problem)

reply bug d.com writes:
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 02 2005
parent reply David Friedman <d3rdclsmail_a_ _t_earthlink_d_._t_net> writes:
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 04 2005
parent bug d.com writes:
 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.
May 04 2005