瀏覽代碼

+ allow setting the stack size for the wasm32-embedded target

Nikolay Nikolov 3 年之前
父節點
當前提交
1bbd16d1b7
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      compiler/systems/t_embed.pas

+ 2 - 1
compiler/systems/t_embed.pas

@@ -2155,7 +2155,7 @@ constructor TLinkerEmbedded_Wasm.Create;
 
 procedure TLinkerEmbedded_Wasm.SetDefaultInfo;
   begin
-    Info.DllCmd[1] := 'wasm-ld $SONAME $GCSECTIONS -o $EXE';
+    Info.DllCmd[1] := 'wasm-ld $SONAME $GCSECTIONS -z stack-size=$STACKSIZE -o $EXE';
     //Info.DllCmd[2] := 'wasmtool --exportrename $INPUT $EXE';
   end;
 
@@ -2205,6 +2205,7 @@ function TLinkerEmbedded_Wasm.MakeSharedLibrary: boolean;
     //Replace(cmdstr,'$RES',maybequoted(outputexedir+Info.ResName));
     //Replace(cmdstr,'$INIT',InitStr);
     //Replace(cmdstr,'$FINI',FiniStr);
+    Replace(cmdstr,'$STACKSIZE',tostr(stacksize));
     Replace(cmdstr,'$SONAME',SoNameStr);
     //Replace(cmdstr,'$MAP',mapstr);
     //Replace(cmdstr,'$LTO',ltostr);