]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
build: set stack limit on Windows and Emscripten to match other platforms
authorbones_was_here <bones_was_here@xonotic.au>
Sun, 18 Aug 2024 20:12:07 +0000 (06:12 +1000)
committerbones_was_here <bones_was_here@xonotic.au>
Fri, 23 Aug 2024 10:15:41 +0000 (20:15 +1000)
Linux, FreeBSD, macOS all default to 8MB for the main thread. MSVC
defaulted to 1MB, MinGW GCC to 2MB.

Optimises Emscripten build slightly and replaces its deprecated
TOTAL_STACK setting.

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
darkplaces-sdl2-vs2019.vcxproj
makefile.inc

index f94592a577ef7ab37488a675c4ae16e78139d116..f68f7c973d563d0aca1db702b608584758db90e3 100644 (file)
@@ -99,6 +99,7 @@
       <TargetMachine>MachineX86</TargetMachine>\r
       <AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
       <LargeAddressAware>true</LargeAddressAware>\r
+      <StackReserveSize>8388608</StackReserveSize>\r
     </Link>\r
   </ItemDefinitionGroup>\r
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">\r
       <SubSystem>Windows</SubSystem>\r
       <TargetMachine>MachineX64</TargetMachine>\r
       <AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
+      <StackReserveSize>8388608</StackReserveSize>\r
     </Link>\r
   </ItemDefinitionGroup>\r
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
       <TargetMachine>MachineX86</TargetMachine>\r
       <AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
       <LargeAddressAware>true</LargeAddressAware>\r
+      <StackReserveSize>8388608</StackReserveSize>\r
     </Link>\r
   </ItemDefinitionGroup>\r
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">\r
       <EnableCOMDATFolding>true</EnableCOMDATFolding>\r
       <TargetMachine>MachineX64</TargetMachine>\r
       <AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
+      <StackReserveSize>8388608</StackReserveSize>\r
     </Link>\r
   </ItemDefinitionGroup>\r
   <ItemGroup>\r
index c0ec06fe3937a0626645c0fd348ba1f5f5b3ba53..9cfed413ec5fe295ed0054564e0c54bb1d470be5 100644 (file)
@@ -236,14 +236,14 @@ LDFLAGS_WASMJS=$(LDFLAGS_UNIXCOMMON) -s USE_SDL=2 \
                                    -s USE_LIBJPEG=1 \
                                    -s USE_ZLIB=1 \
                                    -s INITIAL_MEMORY=128mb \
-                                   -s MAXIMUM_MEMORY=1gb \
+                                   -s MAXIMUM_MEMORY=2gb \
                                    -s SINGLE_FILE \
                                    -s FULL_ES3 \
                                    -s MIN_WEBGL_VERSION=2 \
                                    -s MAX_WEBGL_VERSION=2 \
                                    -s ALLOW_MEMORY_GROWTH=1 \
-                                   -s ASSERTIONS=2 \
-                                   -s TOTAL_STACK=32mb \
+                                   -s ASSERTIONS=1 \
+                                   -s STACK_SIZE=8mb \
                                    -DUSE_GLES2 \
                                    -lidbfs.js \
                                    --pre-js ../../../wasm/pre.js \
@@ -254,14 +254,14 @@ LDFLAGS_WASM=$(LDFLAGS_UNIXCOMMON) -s USE_SDL=2 \
                                    -s USE_LIBJPEG=1 \
                                    -s USE_ZLIB=1 \
                                    -s INITIAL_MEMORY=128mb \
-                                   -s MAXIMUM_MEMORY=1gb \
+                                   -s MAXIMUM_MEMORY=2gb \
                                    -s SINGLE_FILE \
                                    -s FULL_ES3 \
                                    -s MIN_WEBGL_VERSION=2 \
                                    -s MAX_WEBGL_VERSION=2 \
                                    -s ALLOW_MEMORY_GROWTH=1 \
-                                   -s ASSERTIONS=2 \
-                                   -s TOTAL_STACK=32mb \
+                                   -s ASSERTIONS=1 \
+                                   -s STACK_SIZE=8mb \
                                    -DUSE_GLES2 \
                                    -lidbfs.js \
                                    --pre-js ../../../wasm/standaloneprejs.js \
@@ -299,8 +299,8 @@ WINDRES ?= windres
 
 # Link
 # see LDFLAGS_WINCOMMON in makefile
-LDFLAGS_WINSV=$(LDFLAGS_WINCOMMON) $(LIB_CRYPTO) $(LIB_CRYPTO_RIJNDAEL) -mconsole -lwinmm -lws2_32 $(LIB_Z) $(LIB_JPEG)
-LDFLAGS_WINSDL=$(LDFLAGS_WINCOMMON) $(LIB_CRYPTO) $(LIB_CRYPTO_RIJNDAEL) $(LDFLAGS_UNIXSDL) -lwinmm -lws2_32 $(LIB_Z) $(LIB_JPEG) $(LIB_SND_XMP)
+LDFLAGS_WINSV=$(LDFLAGS_WINCOMMON) $(LIB_CRYPTO) $(LIB_CRYPTO_RIJNDAEL) -mconsole -lwinmm -lws2_32 -Wl,--stack=0x800000 $(LIB_Z) $(LIB_JPEG)
+LDFLAGS_WINSDL=$(LDFLAGS_WINCOMMON) $(LIB_CRYPTO) $(LIB_CRYPTO_RIJNDAEL) $(LDFLAGS_UNIXSDL) -lwinmm -lws2_32 -Wl,--stack=0x800000 $(LIB_Z) $(LIB_JPEG) $(LIB_SND_XMP)
 EXE_WINSV=darkplaces-dedicated.exe
 EXE_WINSDL=darkplaces-sdl.exe
 EXE_WINSVNEXUIZ=nexuiz-dedicated.exe