DLL generation of the stdlib for unix

This commit is contained in:
Andreas Rumpf 2010-08-04 07:57:51 +02:00
commit c9e011e36c
9 changed files with 101 additions and 111 deletions

2
lib/system/cgprocs.nim Normal file → Executable file
View file

@ -21,6 +21,6 @@ proc nimGetProcAddr(lib: TLibHandle, name: cstring): TProcAddr {.compilerproc.}
proc nimLoadLibraryError(path: string) {.compilerproc, noinline.}
proc setStackBottom(theStackBottom: pointer) {.compilerRtl.}
proc setStackBottom(theStackBottom: pointer) {.compilerRtl, noinline.}

View file

@ -491,10 +491,11 @@ else:
const stackIncreases = false
proc setStackBottom(theStackBottom: pointer) =
#c_fprintf(c_stdout, "stack bottom: %p;\n", theStackBottom)
# the first init must be the one that defines the stack bottom:
if stackBottom == nil: stackBottom = theStackBottom
else:
var a = cast[TAddress](theStackBottom)
var a = cast[TAddress](theStackBottom) # and not PageMask - PageSize*2
var b = cast[TAddress](stackBottom)
when stackIncreases:
stackBottom = cast[pointer](min(a, b))