Fix tests crash caused by insufficient stack size (NT_MAKEFILE)
authorIvan Maidanski <ivmai@mail.ru>
Sat, 22 Apr 2017 06:32:17 +0000 (09:32 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Sat, 22 Apr 2017 06:32:17 +0000 (09:32 +0300)
(fix commit 8312098)

* NT_MAKEFILE: Refine title comment (list the variables affecting
build configuration).
* NT_MAKEFILE (CPU): Define (uncomment) variable.
* NT_MAKEFILE (LINK_DLL_FLAGS): Remove uuid.lib (not needed).
* NT_MAKEFILE (gctest.exe, cord\de.exe, test_cpp.exe): Remove -stack
option (to use the default stack size); add /MACHINE:$(CPU) option.

NT_MAKEFILE

index d5d5443..6c2224a 100644 (file)
@@ -1,44 +1,48 @@
 # Makefile for Windows NT.  Assumes Microsoft compiler.
 # Use "nmake -f NT_MAKEFILE nodebug=1 all" for optimized versions of library,
-# gctest and editor.
+# gctest and editor.  Please adjust/uncomment CPU, CVTRES_CPU, GC_DLL, GC_LIB,
+# CFLAGS_SPECIFIC, LINK_GC variables below for the desired configuration.
 
 # For building x86 (32-bit) library:
+CPU=i386
 CVTRES_CPU=X86
 #
 # For building x64 (amd64) library:
+#CPU=AMD64
 #CVTRES_CPU=X64
 
-#CPU=$(CVTRES_CPU)
-
 !include <ntwin32.mak>
 
-# For static single-threaded collector library:
+# For static single-threaded collector library:
 #CFLAGS_SPECIFIC=$(cvars) -DGC_NOT_DLL
 #GC_DLL=
 #GC_LIB=gc.lib
+#LINK_GC=lib /out:$(GC_LIB)
 #
-# For static multi-threaded collector library:
+# For static multi-threaded collector library:
 #CFLAGS_SPECIFIC=$(cvarsmt) -DGC_NOT_DLL -DGC_THREADS -DTHREAD_LOCAL_ALLOC -DPARALLEL_MARK
 #GC_DLL=
 #GC_LIB=gc.lib
+#LINK_GC=lib /out:$(GC_LIB)
 #
-# For dynamic multi-threaded collector library:
+# For a dynamic 32-bit multi-threaded collector library:
 CFLAGS_SPECIFIC=$(cvarsmt) -DGC_DLL -DGC_THREADS -DTHREAD_LOCAL_ALLOC -DPARALLEL_MARK
 GC_DLL=gc.dll
 GC_LIB=gc_dll.lib
+#
+# For a dynamic 64-bit multi-threaded collector library:
+#CFLAGS_SPECIFIC=$(cvarsmt) -DGC_DLL -DGC_THREADS -DTHREAD_LOCAL_ALLOC -DPARALLEL_MARK
 #GC_DLL=gc64.dll
 #GC_LIB=gc64_dll.lib
 
-LINK_DLL_FLAGS=kernel32.lib user32.lib uuid.lib \
+LINK_DLL_FLAGS=kernel32.lib user32.lib \
   /nologo /subsystem:windows /dll /incremental:no /pdb:"gc.pdb" \
   /out:$(GC_DLL) /implib:$(GC_LIB)
 
-# For static collector library:
-#LINK_GC=lib /out:$(GC_LIB)
-#
-# For dynamic multi-threaded collector library:
+# For a dynamic 32- or 64-bit multi-threaded collector library:
 LINK_GC=link $(ldebug) $(LINK_DLL_FLAGS)
 
+
 # Make sure that .cc is not viewed as a suffix.  It is for VC++2005, but
 # not earlier versions.  We can deal with either, but not inconsistency.
 .SUFFIXES:
@@ -68,7 +72,7 @@ $(GC_LIB): $(OBJS)
        $(LINK_GC) /MACHINE:$(CPU) $(OBJS)
 
 gctest.exe: tests\test.obj $(GC_LIB)
-       $(link) $(ldebug) $(guiflags) -stack:131072 -out:$*.exe tests\test.obj $(guilibs) $(GC_LIB)
+       $(link) /MACHINE:$(CPU) $(ldebug) $(guiflags) -out:$*.exe tests\test.obj $(guilibs) $(GC_LIB)
 #      mapsympe -n -o gctest.sym gctest.exe
 # This produces a GUI app that opens no window and writes to gctest.gc.log.
 
@@ -82,7 +86,7 @@ cord\de_win.res: cord\tests\de_win.rc cord\tests\de_win.h cord\tests\de_cmds.h
 
 # Cord/de is a real win32 GUI app.
 cord\de.exe: cord\cordbscs.obj cord\cordxtra.obj cord\tests\de.obj cord\tests\de_win.obj cord\de_win.rbj $(GC_LIB)
-       $(link) $(ldebug) $(guiflags) -stack:16384 -out:cord\de.exe cord\cordbscs.obj cord\cordxtra.obj cord\tests\de.obj cord\tests\de_win.obj cord\de_win.rbj $(GC_LIB) $(guilibs)
+       $(link) /MACHINE:$(CPU) $(ldebug) $(guiflags) -out:cord\de.exe cord\cordbscs.obj cord\cordxtra.obj cord\tests\de.obj cord\tests\de_win.obj cord\de_win.rbj $(GC_LIB) $(guilibs)
 
 gc_cpp.obj: include\gc_cpp.h include\gc.h
 
@@ -93,7 +97,7 @@ test_cpp.cpp: tests\test_cpp.cc
 # a single numeric argument, which is the number of iterations.
 # The output appears in test_cpp.gc.log file.
 test_cpp.exe: test_cpp.obj include\gc_cpp.h include\gc.h $(GC_LIB)
-       $(link) $(ldebug) $(guiflags) -stack:16384 -out:test_cpp.exe test_cpp.obj $(GC_LIB) $(guilibs)
+       $(link) /MACHINE:$(CPU) $(ldebug) $(guiflags) -out:test_cpp.exe test_cpp.obj $(GC_LIB) $(guilibs)
 
 $(AO_SRC_DIR):
        tar xvfz $(AO_SRC_DIR).tar.gz