www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - How to build the druntime (Windows)?

reply Andre Tampubolon <andre lc.vlsm.org> writes:
This is my situation: I put all the git stuffs in C:\dmd-dev.
There are 2 subdirectories in it: dmd and druntime

I managed to build dmd by "make -f win32.mak"

Trying the same thing for druntime:
dmd -c -d -o- -Isrc -Iimport -Hfimport\core\atomic.di src\core\atomic.d
dmd -c -d -o- -Isrc -Iimport -Hfimport\core\bitop.di src\core\bitop.d
dmd -c -d -o- -Isrc -Iimport -Hfimport\core\cpuid.di src\core\cpuid.d
dmd -c -d -o- -Isrc -Iimport -Hfimport\core\demangle.di src\core\demangle.d
dmd -c -d -o- -Isrc -Iimport -Hfimport\core\dll_helper.di 
src\core\dll_helper.d
dmd -c -d -o- -Isrc -Iimport -Hfimport\core\exception.di 
src\core\exception.d
dmd -c -d -o- -Isrc -Iimport -Hfimport\core\memory.di src\core\memory.d
dmd -c -d -o- -Isrc -Iimport -Hfimport\core\runtime.di src\core\runtime.d
dmd -c -d -o- -Isrc -Iimport -Hfimport\core\thread.di src\core\thread.d
src\core\thread.d(1601): Error: undefined identifier malloc

--- errorlevel 1

Any idea?

-- 
- Andre Tampubolon -
Feb 03 2011
parent reply Don <nospam nospam.com> writes:
Andre Tampubolon wrote:
 This is my situation: I put all the git stuffs in C:\dmd-dev.
 There are 2 subdirectories in it: dmd and druntime
 
 I managed to build dmd by "make -f win32.mak"
 
 Trying the same thing for druntime:
 dmd -c -d -o- -Isrc -Iimport -Hfimport\core\atomic.di src\core\atomic.d
 dmd -c -d -o- -Isrc -Iimport -Hfimport\core\bitop.di src\core\bitop.d
 dmd -c -d -o- -Isrc -Iimport -Hfimport\core\cpuid.di src\core\cpuid.d
 dmd -c -d -o- -Isrc -Iimport -Hfimport\core\demangle.di src\core\demangle.d
 dmd -c -d -o- -Isrc -Iimport -Hfimport\core\dll_helper.di 
 src\core\dll_helper.d
 dmd -c -d -o- -Isrc -Iimport -Hfimport\core\exception.di 
 src\core\exception.d
 dmd -c -d -o- -Isrc -Iimport -Hfimport\core\memory.di src\core\memory.d
 dmd -c -d -o- -Isrc -Iimport -Hfimport\core\runtime.di src\core\runtime.d
 dmd -c -d -o- -Isrc -Iimport -Hfimport\core\thread.di src\core\thread.d
 src\core\thread.d(1601): Error: undefined identifier malloc
 
 --- errorlevel 1
 
 Any idea?
 
You're not doing anything wrong. It fails on the autotester as well: http://d.puremagic.com/test-results/index.ghtml This commit broke it: https://github.com/D-Programming-Language/druntime/commit/1449d7bd75c656cb0215d73077549c896c10163f
Feb 03 2011
parent reply Sean Kelly <sean invisibleduck.org> writes:
Don Wrote:

 Andre Tampubolon wrote:
 This is my situation: I put all the git stuffs in C:\dmd-dev.
 There are 2 subdirectories in it: dmd and druntime
 
 I managed to build dmd by "make -f win32.mak"
 
 Trying the same thing for druntime:
 dmd -c -d -o- -Isrc -Iimport -Hfimport\core\atomic.di src\core\atomic.d
 dmd -c -d -o- -Isrc -Iimport -Hfimport\core\bitop.di src\core\bitop.d
 dmd -c -d -o- -Isrc -Iimport -Hfimport\core\cpuid.di src\core\cpuid.d
 dmd -c -d -o- -Isrc -Iimport -Hfimport\core\demangle.di src\core\demangle.d
 dmd -c -d -o- -Isrc -Iimport -Hfimport\core\dll_helper.di 
 src\core\dll_helper.d
 dmd -c -d -o- -Isrc -Iimport -Hfimport\core\exception.di 
 src\core\exception.d
 dmd -c -d -o- -Isrc -Iimport -Hfimport\core\memory.di src\core\memory.d
 dmd -c -d -o- -Isrc -Iimport -Hfimport\core\runtime.di src\core\runtime.d
 dmd -c -d -o- -Isrc -Iimport -Hfimport\core\thread.di src\core\thread.d
 src\core\thread.d(1601): Error: undefined identifier malloc
 
 --- errorlevel 1
 
 Any idea?
 
You're not doing anything wrong. It fails on the autotester as well: http://d.puremagic.com/test-results/index.ghtml This commit broke it: https://github.com/D-Programming-Language/druntime/commit/1449d7bd75c656cb0215d73077549c896c10163f
Sorry about that. It should be fixed now.
Feb 03 2011
parent reply Andre Tampubolon <andre lc.vlsm.org> writes:
Thanks. Now I managed to succesfully build dmd and druntime.
The next is phobos. I got this:

make -f win32.mak
dmd -c -O -release -nofloat -w -d etc\c\zlib.d -ofCzlib.obj
object.d: Error: module object is in file 'object.d' which cannot be read
Specify path to file 'object.d' with -I switch

--- errorlevel 1



On 04-Feb-11 6:11 AM, Sean Kelly wrote:
 Don Wrote:

 Andre Tampubolon wrote:
 This is my situation: I put all the git stuffs in C:\dmd-dev.
 There are 2 subdirectories in it: dmd and druntime

 I managed to build dmd by "make -f win32.mak"

 Trying the same thing for druntime:
 dmd -c -d -o- -Isrc -Iimport -Hfimport\core\atomic.di src\core\atomic.d
 dmd -c -d -o- -Isrc -Iimport -Hfimport\core\bitop.di src\core\bitop.d
 dmd -c -d -o- -Isrc -Iimport -Hfimport\core\cpuid.di src\core\cpuid.d
 dmd -c -d -o- -Isrc -Iimport -Hfimport\core\demangle.di src\core\demangle.d
 dmd -c -d -o- -Isrc -Iimport -Hfimport\core\dll_helper.di
 src\core\dll_helper.d
 dmd -c -d -o- -Isrc -Iimport -Hfimport\core\exception.di
 src\core\exception.d
 dmd -c -d -o- -Isrc -Iimport -Hfimport\core\memory.di src\core\memory.d
 dmd -c -d -o- -Isrc -Iimport -Hfimport\core\runtime.di src\core\runtime.d
 dmd -c -d -o- -Isrc -Iimport -Hfimport\core\thread.di src\core\thread.d
 src\core\thread.d(1601): Error: undefined identifier malloc

 --- errorlevel 1

 Any idea?
You're not doing anything wrong. It fails on the autotester as well: http://d.puremagic.com/test-results/index.ghtml This commit broke it: https://github.com/D-Programming-Language/druntime/commit/1449d7bd75c656cb0215d73077549c896c10163f
Sorry about that. It should be fixed now.
-- - Andre Tampubolon -
Feb 04 2011
next sibling parent reply Jonathan M Davis <jmdavisProg gmx.com> writes:
On Friday 04 February 2011 00:23:05 Andre Tampubolon wrote:
 Thanks. Now I managed to succesfully build dmd and druntime.
 The next is phobos. I got this:
 
 make -f win32.mak
 dmd -c -O -release -nofloat -w -d etc\c\zlib.d -ofCzlib.obj
 object.d: Error: module object is in file 'object.d' which cannot be read
 Specify path to file 'object.d' with -I switch
Is druntime one directory below Phobos? That is, are the phobos and druntime directories in the same directory? If not, the phobos build will fail to find druntime - which would include object.d - and then it can't build. - Jonathan M Davis
Feb 04 2011
parent Andre Tampubolon <andre lc.vlsm.org> writes:
Well previously phobos and druntime directories were in the same directory.
So I move druntime directory into phobos', and the layout looks like this:
04-Feb-11  09:22 PM    <DIR>          .
04-Feb-11  09:22 PM    <DIR>          ..
04-Feb-11  08:28 AM             3,918 crc32.d
04-Feb-11  09:22 PM                 0 dirr.txt
04-Feb-11  03:20 PM    <DIR>          druntime
04-Feb-11  08:28 AM    <DIR>          etc
04-Feb-11  08:28 AM             8,400 index.d
04-Feb-11  08:28 AM             1,361 LICENSE_1_0.txt
04-Feb-11  08:28 AM             9,523 posix.mak
04-Feb-11  08:28 AM    <DIR>          std
04-Feb-11  08:28 AM            14,464 std.ddoc
04-Feb-11  08:28 AM             3,498 unittest.d
04-Feb-11  08:28 AM            30,394 win32.mak

Still fail to build, though...

On 04-Feb-11 3:33 PM, Jonathan M Davis wrote:
 On Friday 04 February 2011 00:23:05 Andre Tampubolon wrote:
 Thanks. Now I managed to succesfully build dmd and druntime.
 The next is phobos. I got this:

 make -f win32.mak
 dmd -c -O -release -nofloat -w -d etc\c\zlib.d -ofCzlib.obj
 object.d: Error: module object is in file 'object.d' which cannot be read
 Specify path to file 'object.d' with -I switch
Is druntime one directory below Phobos? That is, are the phobos and druntime directories in the same directory? If not, the phobos build will fail to find druntime - which would include object.d - and then it can't build. - Jonathan M Davis
-- - Andre Tampubolon -
Feb 04 2011
prev sibling parent reply Sean Kelly <sean invisibleduck.org> writes:
On Feb 4, 2011, at 12:23 AM, Andre Tampubolon wrote:

 Thanks. Now I managed to succesfully build dmd and druntime.
 The next is phobos. I got this:
=20
 make -f win32.mak
 dmd -c -O -release -nofloat -w -d etc\c\zlib.d -ofCzlib.obj
 object.d: Error: module object is in file 'object.d' which cannot be =
read
 Specify path to file 'object.d' with -I switch
You need the druntime header files in your import path, which is = specified in sc.ini. Then, assuming druntime.lib is in \druntime\lib, = build phobos via: make -fwin32.mak DRUNTIME=3D\druntime By default the phobos makefile assumes a directory structure matching = the DMD distro, which probably isn't what you have if you're building = from a repository.=
Feb 04 2011
parent Rainer Schuetze <r.sagitario gmx.de> writes:
Sean Kelly wrote:
 On Feb 4, 2011, at 12:23 AM, Andre Tampubolon wrote:
 
 Thanks. Now I managed to succesfully build dmd and druntime.
 The next is phobos. I got this:

 make -f win32.mak
 dmd -c -O -release -nofloat -w -d etc\c\zlib.d -ofCzlib.obj
 object.d: Error: module object is in file 'object.d' which cannot be read
 Specify path to file 'object.d' with -I switch
You need the druntime header files in your import path, which is specified in sc.ini. Then, assuming druntime.lib is in \druntime\lib, build phobos via: make -fwin32.mak DRUNTIME=\druntime By default the phobos makefile assumes a directory structure matching the DMD distro, which probably isn't what you have if you're building from a repository.
The current phobos makefile does not specify an import path to druntime, i.e. it expects a dmd installation. Chances are that its imports don't match the druntime sources you've just compiled and want to link against. Also, if you just build dmd and the library from scratch, as the OP does, there is no installation yet. In summary, DFLAGS in the phobos makefiles should include -I$(DRUNTIME)/import.
Feb 04 2011