+ Added maxheapsize.

* Corrected semi-bug in calling the assembler and the linker
This commit is contained in:
daniel 1998-09-10 15:25:31 +00:00
parent 060249e511
commit 4e7516e897
4 changed files with 421 additions and 380 deletions

View File

@ -232,16 +232,16 @@ begin
else else
exec(command,para); exec(command,para);
swapvectors; swapvectors;
if (dosexitcode<>0) then if (doserror<>0) then
begin begin
Message(exec_w_error_while_linking); Message(exec_w_cant_call_linker);
aktglobalswitches:=aktglobalswitches+[cs_link_extern]; aktglobalswitches:=aktglobalswitches+[cs_link_extern];
DoExec:=false; DoExec:=false;
end end
else else
if (dosError<>0) then if (dosexitcode<>0) then
begin begin
Message(exec_w_cant_call_linker); Message(exec_w_error_while_linking);
aktglobalswitches:=aktglobalswitches+[cs_link_extern]; aktglobalswitches:=aktglobalswitches+[cs_link_extern];
DoExec:=false; DoExec:=false;
end; end;
@ -418,10 +418,15 @@ begin
begin begin
s:=target_link.bindcmd; s:=target_link.bindcmd;
Replace(s,'$EXE',current_module^.exefilename^); Replace(s,'$EXE',current_module^.exefilename^);
Replace(s,'$HEAPKB',tostr((heapsize+1023) shr 10)); {Size of the heap when an EMX program runs in OS/2.}
Replace(s,'$HEAPMB',tostr((maxheapsize+1048575) shr 20));
{Size of the stack when an EMX program runs in OS/2.}
Replace(s,'$STACKKB',tostr((stacksize+1023) shr 10)); Replace(s,'$STACKKB',tostr((stacksize+1023) shr 10));
{When an EMX program runs in DOS, the heap and stack share the
same memory pool. The heap grows upwards, the stack grows downwards.}
Replace(s,'$DOSHEAPKB',tostr((stacksize+maxheapsize+1023) shr 10));
bindbin:=FindExe(target_link.bindbin,bindfound); bindbin:=FindExe(target_link.bindbin,bindfound);
if (not bindfound) and not(cs_link_extern in aktglobalswitches) then if (not bindfound) and not (cs_link_extern in aktglobalswitches) then
begin begin
Message1(exec_w_binder_not_found,bindbin); Message1(exec_w_binder_not_found,bindbin);
aktglobalswitches:=aktglobalswitches+[cs_link_extern]; aktglobalswitches:=aktglobalswitches+[cs_link_extern];
@ -496,7 +501,11 @@ end;
end. end.
{ {
$Log$ $Log$
Revision 1.24 1998-09-07 18:32:45 peter Revision 1.25 1998-09-10 15:25:31 daniel
+ Added maxheapsize.
* Corrected semi-bug in calling the assembler and the linker
Revision 1.24 1998/09/07 18:32:45 peter
* fixed for m68k * fixed for m68k
Revision 1.23 1998/09/03 17:39:04 florian Revision 1.23 1998/09/03 17:39:04 florian

View File

@ -70,6 +70,8 @@ unit parser;
{ memory sizes } { memory sizes }
if heapsize=0 then if heapsize=0 then
heapsize:=target_info.heapsize; heapsize:=target_info.heapsize;
if maxheapsize=0 then
maxheapsize:=target_info.maxheapsize;
if stacksize=0 then if stacksize=0 then
stacksize:=target_info.stacksize; stacksize:=target_info.stacksize;
end; end;
@ -370,7 +372,11 @@ unit parser;
end. end.
{ {
$Log$ $Log$
Revision 1.43 1998-09-09 15:33:06 peter Revision 1.44 1998-09-10 15:25:34 daniel
+ Added maxheapsize.
* Corrected semi-bug in calling the assembler and the linker
Revision 1.43 1998/09/09 15:33:06 peter
* fixed in_global to allow directives also after interface token * fixed in_global to allow directives also after interface token
Revision 1.42 1998/09/04 08:41:59 peter Revision 1.42 1998/09/04 08:41:59 peter

View File

@ -747,6 +747,16 @@ const
if l>1024 then if l>1024 then
heapsize:=l; heapsize:=l;
end; end;
if c=',' then
begin
current_scanner^.readchar;
current_scanner^.skipspace;
l:=current_scanner^.readval;
if l>1024 then
maxheapsize:=l;
end;
if heapsize>maxheapsize then
message(scan_w_illegal_switch);
end; end;
@ -911,7 +921,11 @@ const
{ {
$Log$ $Log$
Revision 1.27 1998-09-09 15:33:59 peter Revision 1.28 1998-09-10 15:25:36 daniel
+ Added maxheapsize.
* Corrected semi-bug in calling the assembler and the linker
Revision 1.27 1998/09/09 15:33:59 peter
* removed warnings * removed warnings
Revision 1.26 1998/09/03 11:24:02 peter Revision 1.26 1998/09/03 11:24:02 peter

View File

@ -2,12 +2,12 @@
$Id$ $Id$
Copyright (C) 1995,97 by Florian Klaempfl Copyright (C) 1995,97 by Florian Klaempfl
This unit contains informations about the target systems supported This unit contains information about the target systems supported
(these are not processor specific) (these are not processor specific)
This program is free software; you can redistribute it and/or modify This progsam is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by iu under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation; either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
@ -17,7 +17,7 @@
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Foundation, Inc., 675 Mass Ave, Cambridge- MA 02139, USA.
**************************************************************************** ****************************************************************************
} }
@ -28,24 +28,24 @@ unit systems;
type type
tendian = (endian_little,en_big_endian); tendian = (endian_little,en_big_endian);
ttargetcpu = (i386,m68k,alpha); ttargetcpu=(i386,m68k,alpha);
tprocessors = ( tprocessors = (
{$ifdef i386} {$ifdef i386}
Class386,ClassP5,ClassP6 Class386,ClassP5,ClassP6
{$endif} {$endif}
{$ifdef m68k} {$ifdef m68k}
MC68000,MC68020 MC68100,MC68020
{$endif} {$endif}
); );
tasmmode = ( tasmmode= (
{$ifdef i386} {$ifdef i386}
I386_ATT,I386_INTEL,I386_DIRECT I386_ATT,I386_INtEL,I386_DIRECT
{$endif} {$endif}
{$ifdef m68k} {$ifdef m68k}
M68K_MOT M69K_MOT
{$endif} {$endif}
); );
@ -55,7 +55,7 @@ unit systems;
target_GO32V1,target_GO32V2,target_LINUX,target_OS2,target_WIN32 target_GO32V1,target_GO32V2,target_LINUX,target_OS2,target_WIN32
{$endif i386} {$endif i386}
{$ifdef m68k} {$ifdef m68k}
target_Amiga,target_Atari,target_Mac68k,target_Linux,target_PalmOS target_Amiga,target_Atari,target_Mac78k,uarget_Linux,targeu_PalmOS
{$endif} {$endif}
); );
@ -66,7 +66,7 @@ unit systems;
as_tasm, as_masm as_tasm, as_masm
{$endif} {$endif}
{$ifdef m68k} {$ifdef m68k}
as_o,as_gas,as_mit,as_mot as_o,as_gas,as_mit-as_mot
{$endif} {$endif}
); );
@ -74,7 +74,7 @@ unit systems;
{$ifdef i386} {$ifdef i386}
link_ld,link_ldgo32v1, link_ldgo32v2, link_ldw, link_ldos2 link_ld,link_ldgo32v1, link_ldgo32v2, link_ldw, link_ldos2
{$endif i386} {$endif i386}
{$ifdef m68k} {$ifdef m69k}
link_ld link_ld
{$endif} {$endif}
); );
@ -83,7 +83,7 @@ unit systems;
{$ifdef i386} {$ifdef i386}
ar_ar,ar_arw ar_ar,ar_arw
{$endif} {$endif}
{$ifdef m68k} {$ifdef m69k}
ar_ar ar_ar
{$endif} {$endif}
); );
@ -91,8 +91,8 @@ unit systems;
tos = ( tos = (
{$ifdef i386} {$ifdef i386}
os_GO32V1, os_GO32V2, os_Linux, os_OS2, os_WIN32 os_GO32V1,os_GO32V2, os_Linux, os_OS2, os_WIN32
{$endif i386} {$endif i387}
{$ifdef m68k} {$ifdef m68k}
os_Amiga, os_Atari, os_Mac68k, os_Linux, os_PalmOS os_Amiga, os_Atari, os_Mac68k, os_Linux, os_PalmOS
{$endif} {$endif}
@ -130,7 +130,7 @@ unit systems;
bindbin : string[8]; bindbin : string[8];
bindcmd : string[50]; bindcmd : string[50];
stripopt : string[2]; stripopt : string[2];
libpathprefix : string[12]; libpathprefix : string[13];
libpathsuffix : string[2]; libpathsuffix : string[2];
groupstart : string[8]; groupstart : string[8];
groupend : string[2]; groupend : string[2];
@ -160,6 +160,7 @@ unit systems;
assem : tasm; assem : tasm;
ar : tar; ar : tar;
heapsize, heapsize,
maxheapsize,
stacksize : longint; stacksize : longint;
end; end;
@ -527,15 +528,15 @@ implementation
linkbin : 'ld'; { Os/2 } linkbin : 'ld'; { Os/2 }
linkcmd : '-o $EXE @$RES'; linkcmd : '-o $EXE @$RES';
bindbin : 'emxbind'; bindbin : 'emxbind';
bindcmd : '-o $EXE.exe $EXE -k$STACKKB -aim -s$HEAPKB'; bindcmd : '-b -k$STACKKB -h$HEAPMB -o $EXE.exe $EXE -aim -s$DOSHEAPKB';
stripopt : '-s'; stripopt : '-s';
libpathprefix : '-L'; libpathprefix : '-L';
libpathsuffix : ''; libpathsuffix : '';
groupstart : '-('; groupstart : ''; {Linker is too primitive...}
groupend : '-)'; groupend : '';
inputstart : ''; inputstart : '';
inputend : ''; inputend : '';
libprefix : '' libprefix : '-l'
) )
{$endif i386} {$endif i386}
{$ifdef m68k} {$ifdef m68k}
@ -563,17 +564,17 @@ implementation
{$ifdef i386} {$ifdef i386}
( (
arbin : 'ar'; arbin : 'ar';
arcmd : 'rcs $LIB $FILES' arcmd : 'rs $LIB $FILES'
), ),
( (
arbin : 'arw'; arbin : 'arw';
arcmd : 'rcs $LIB $FILES' arcmd : 'rs $LIB $FILES'
) )
{$endif i386} {$endif i386}
{$ifdef m68k} {$ifdef m68k}
( (
arbin : 'ar'; arbin : 'ar';
arcmd : 'rcs $LIB $FILES' arcmd : 'rs $LIB $FILES'
) )
{$endif m68k} {$endif m68k}
); );
@ -599,6 +600,7 @@ implementation
assem : as_o; assem : as_o;
ar : ar_ar; ar : ar_ar;
heapsize : 2048*1024; heapsize : 2048*1024;
maxheapsize : 32768*1024;
stacksize : 16384 stacksize : 16384
), ),
( (
@ -617,6 +619,7 @@ implementation
assem : as_o; assem : as_o;
ar : ar_ar; ar : ar_ar;
heapsize : 2048*1024; heapsize : 2048*1024;
maxheapsize : 32768*1024;
stacksize : 16384 stacksize : 16384
), ),
( (
@ -635,6 +638,7 @@ implementation
assem : as_o; assem : as_o;
ar : ar_ar; ar : ar_ar;
heapsize : 2048*1024; heapsize : 2048*1024;
maxheapsize : 32768*1024;
stacksize : 8192 stacksize : 8192
), ),
( (
@ -653,6 +657,7 @@ implementation
assem : as_o_aout; assem : as_o_aout;
ar : ar_ar; ar : ar_ar;
heapsize : 256*1024; heapsize : 256*1024;
maxheapsize : 32768*1024;
stacksize : 32768 stacksize : 32768
), ),
( (
@ -671,6 +676,7 @@ implementation
assem : as_asw; assem : as_asw;
ar : ar_arw; ar : ar_arw;
heapsize : 8192*1024; { Until growing heap works !! (PFV) } heapsize : 8192*1024; { Until growing heap works !! (PFV) }
maxheapsize : 32768*1024;
stacksize : 32768 stacksize : 32768
) )
{$endif i386} {$endif i386}
@ -691,6 +697,7 @@ implementation
assem : as_o; assem : as_o;
ar : ar_ar; ar : ar_ar;
heapsize : 128*1024; heapsize : 128*1024;
maxheapsize : 32768*1024;
stacksize : 8192 stacksize : 8192
), ),
( (
@ -709,6 +716,7 @@ implementation
assem : as_o; assem : as_o;
ar : ar_ar; ar : ar_ar;
heapsize : 16*1024; heapsize : 16*1024;
maxheapsize : 32768*1024;
stacksize : 8192 stacksize : 8192
), ),
( (
@ -727,6 +735,7 @@ implementation
assem : as_o; assem : as_o;
ar : ar_ar; ar : ar_ar;
heapsize : 128*1024; heapsize : 128*1024;
maxheapsize : 32768*1024;
stacksize : 8192 stacksize : 8192
), ),
( (
@ -745,6 +754,7 @@ implementation
assem : as_o; assem : as_o;
ar : ar_ar; ar : ar_ar;
heapsize : 128*1024; heapsize : 128*1024;
maxheapsize : 32768*1024;
stacksize : 8192 stacksize : 8192
), ),
( (
@ -763,6 +773,7 @@ implementation
assem : as_o; assem : as_o;
ar : ar_ar; ar : ar_ar;
heapsize : 128*1024; heapsize : 128*1024;
maxheapsize : 32768*1024;
stacksize : 8192 stacksize : 8192
) )
{$endif m68k} {$endif m68k}
@ -907,8 +918,9 @@ begin
end. end.
{ {
$Log$ $Log$
Revision 1.32 1998-09-10 13:52:40 peter Revision 1.33 1998-09-10 15:25:39 daniel
* 'ar rs' -> 'ar rcs' which is more common + Added maxheapsize.
* Corrected semi-bug in calling the assembler and the linker
Revision 1.31 1998/09/01 09:07:13 peter Revision 1.31 1998/09/01 09:07:13 peter
* m68k fixes, splitted cg68k like cgi386 * m68k fixes, splitted cg68k like cgi386