* make sure that the stack size passed to emxbind is valid (override the value passed using $M if necessary)

git-svn-id: trunk@29573 -
This commit is contained in:
Tomas Hajny 2015-01-28 08:00:01 +00:00
parent 4cced1186d
commit 608b14ab4e

View File

@ -473,6 +473,7 @@ var
BaseFilename: TPathStr; BaseFilename: TPathStr;
RsrcStr : string; RsrcStr : string;
OutName: TPathStr; OutName: TPathStr;
StackSizeKB: cardinal;
begin begin
if not(cs_link_nolink in current_settings.globalswitches) then if not(cs_link_nolink in current_settings.globalswitches) then
Message1(exec_i_linking,current_module.exefilename); Message1(exec_i_linking,current_module.exefilename);
@ -513,6 +514,12 @@ begin
{ Is this really required? Not anymore according to my EMX docs } { Is this really required? Not anymore according to my EMX docs }
Replace(cmdstr,'$HEAPMB',tostr((1048575) shr 20)); Replace(cmdstr,'$HEAPMB',tostr((1048575) shr 20));
{Size of the stack when an EMX program runs in OS/2.} {Size of the stack when an EMX program runs in OS/2.}
StackSizeKB := (StackSize + 1023) shr 10;
(* Ensure a value which might work and is accepted by EMXBIND *)
if StackSizeKB < 64 then
StackSizeKB := 64
else if StackSizeKB > (512 shl 10) then
StackSizeKB := 512 shl 10;
Replace(cmdstr,'$STACKKB',tostr((stacksize+1023) shr 10)); Replace(cmdstr,'$STACKKB',tostr((stacksize+1023) shr 10));
{When an EMX program runs in DOS, the heap and stack share the {When an EMX program runs in DOS, the heap and stack share the
same memory pool. The heap grows upwards, the stack grows downwards.} same memory pool. The heap grows upwards, the stack grows downwards.}