* Enabled -Xm switch for NDS and GBA and switched from abi_default to abi_eabi

* Fixed NDS libfat linking

git-svn-id: trunk@13664 -
This commit is contained in:
Legolas 2009-09-06 18:47:22 +00:00
parent 1e5b89049a
commit 00a3dae729
5 changed files with 39 additions and 28 deletions

View File

@ -34,8 +34,8 @@ unit i_gba;
system : system_arm_gba; system : system_arm_gba;
name : 'GameBoy Advance'; name : 'GameBoy Advance';
shortname : 'gba'; shortname : 'gba';
flags : [tf_needs_symbol_size,tf_files_case_sensitive,tf_use_function_relative_addresses flags : [tf_needs_symbol_size,tf_files_case_sensitive,
,tf_smartlink_sections,tf_requires_proper_alignment]; tf_use_function_relative_addresses,tf_requires_proper_alignment,tf_smartlink_sections];
cpu : cpu_arm; cpu : cpu_arm;
unit_env : ''; unit_env : '';
extradefines : ''; extradefines : '';
@ -88,7 +88,7 @@ unit i_gba;
); );
first_parm_offset : 8; first_parm_offset : 8;
stacksize : 16384; stacksize : 16384;
abi : abi_default abi : abi_eabi
); );
implementation implementation

View File

@ -1,5 +1,5 @@
{ {
This unit implements support information structures for GameBoy Advance This unit implements support information structures for Nintendo DS
Copyright (c) 1998-2002 by Peter Vreman Copyright (c) 1998-2002 by Peter Vreman
@ -34,8 +34,8 @@ unit i_nds;
system : system_arm_nds; system : system_arm_nds;
name : 'Nintendo DS'; name : 'Nintendo DS';
shortname : 'nds'; shortname : 'nds';
flags : [tf_needs_symbol_size,tf_files_case_sensitive,tf_use_function_relative_addresses flags : [tf_needs_symbol_size,tf_files_case_sensitive,
,tf_requires_proper_alignment,tf_smartlink_sections]; tf_use_function_relative_addresses,tf_requires_proper_alignment,tf_smartlink_sections];
cpu : cpu_arm; cpu : cpu_arm;
unit_env : ''; unit_env : '';
extradefines : ''; extradefines : '';
@ -88,7 +88,7 @@ unit i_nds;
); );
first_parm_offset : 8; first_parm_offset : 8;
stacksize : $3CFF; //15615? or 16384?; stacksize : $3CFF; //15615? or 16384?;
abi : abi_default abi : abi_eabi
); );
implementation implementation

View File

@ -30,6 +30,7 @@ interface
implementation implementation
uses uses
aasmbase,
SysUtils, SysUtils,
cutils,cfileutl,cclasses, cutils,cfileutl,cclasses,
globtype,globals,systems,verbose,script,fmodule,i_gba,link; globtype,globals,systems,verbose,script,fmodule,i_gba,link;
@ -554,14 +555,22 @@ var
StaticStr, StaticStr,
GCSectionsStr, GCSectionsStr,
DynLinkStr, DynLinkStr,
MapStr,
StripStr: string; StripStr: string;
begin begin
{ for future use } { for future use }
StaticStr:=''; StaticStr:='';
StripStr:=''; StripStr:='';
DynLinkStr:=''; DynLinkStr:='';
MapStr:='';
GCSectionsStr:='--gc-sections'; if (cs_link_strip in current_settings.globalswitches) and
not(cs_link_separate_dbg_file in current_settings.globalswitches) then
StripStr:='-s';
if (cs_link_map in current_settings.globalswitches) then
StripStr:='-Map '+maybequoted(ChangeFileExt(current_module.exefilename^,'.map'));
if create_smartlink_sections then
GCSectionsStr:='--gc-sections';
//if not(cs_link_extern in current_settings.globalswitches) then //if not(cs_link_extern in current_settings.globalswitches) then
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^);
@ -572,24 +581,15 @@ begin
{ Call linker } { Call linker }
SplitBinCmd(Info.ExeCmd[1],binstr,cmdstr); SplitBinCmd(Info.ExeCmd[1],binstr,cmdstr);
Replace(cmdstr,'$OPT',Info.ExtraOptions); Replace(cmdstr,'$OPT',Info.ExtraOptions);
if not(cs_link_on_target in current_settings.globalswitches) then
begin Replace(cmdstr,'$EXE',(maybequoted(ScriptFixFileName(ChangeFileExt(current_module.exefilename^,'.elf')))));
Replace(cmdstr,'$EXE',(maybequoted(ScriptFixFileName(ChangeFileExt(current_module.exefilename^,'.elf'))))); Replace(cmdstr,'$RES',(maybequoted(ScriptFixFileName(outputexedir+Info.ResName))));
Replace(cmdstr,'$RES',(maybequoted(ScriptFixFileName(outputexedir+Info.ResName)))); Replace(cmdstr,'$STATIC',StaticStr);
Replace(cmdstr,'$STATIC',StaticStr); Replace(cmdstr,'$STRIP',StripStr);
Replace(cmdstr,'$STRIP',StripStr); Replace(cmdstr,'$GCSECTIONS',GCSectionsStr);
Replace(cmdstr,'$GCSECTIONS',GCSectionsStr); Replace(cmdstr,'$MAP',MapStr);
Replace(cmdstr,'$DYNLINK',DynLinkStr); Replace(cmdstr,'$DYNLINK',DynLinkStr);
end
else
begin
Replace(cmdstr,'$EXE',maybequoted(ScriptFixFileName(ChangeFileExt(current_module.exefilename^,'.elf'))));
Replace(cmdstr,'$RES',maybequoted(ScriptFixFileName(outputexedir+Info.ResName)));
Replace(cmdstr,'$STATIC',StaticStr);
Replace(cmdstr,'$STRIP',StripStr);
Replace(cmdstr,'$GCSECTIONS',GCSectionsStr);
Replace(cmdstr,'$DYNLINK',DynLinkStr);
end;
success:=DoExec(FindUtil(utilsprefix+BinStr),cmdstr,true,false); success:=DoExec(FindUtil(utilsprefix+BinStr),cmdstr,true,false);
{ Remove ReponseFile } { Remove ReponseFile }

View File

@ -1,6 +1,6 @@
{ {
This unit implements support import,export,link routines This unit implements support import,export,link routines
for the (arm) GameBoy Advance target for the (arm) Nintendo DS target
Copyright (c) 2001-2002 by Peter Vreman Copyright (c) 2001-2002 by Peter Vreman
@ -30,6 +30,7 @@ interface
implementation implementation
uses uses
aasmbase,
SysUtils, SysUtils,
cutils,cfileutl,cclasses, cutils,cfileutl,cclasses,
globtype,globals,systems,verbose,script,fmodule,i_nds,link; globtype,globals,systems,verbose,script,fmodule,i_nds,link;
@ -705,19 +706,27 @@ var
StaticStr, StaticStr,
GCSectionsStr, GCSectionsStr,
DynLinkStr, DynLinkStr,
MapStr,
StripStr: string; StripStr: string;
preName: string; preName: string;
begin begin
{ for future use } { for future use }
StaticStr:=''; StaticStr:='';
StripStr:=''; StripStr:='';
MapStr:='';
DynLinkStr:=''; DynLinkStr:='';
case apptype of case apptype of
app_arm9: preName:='.nef'; app_arm9: preName:='.nef';
app_arm7: preName:='.nlf'; app_arm7: preName:='.nlf';
end; end;
GCSectionsStr:='--gc-sections'; if (cs_link_strip in current_settings.globalswitches) and
not(cs_link_separate_dbg_file in current_settings.globalswitches) then
StripStr:='-s';
if (cs_link_map in current_settings.globalswitches) then
StripStr:='-Map '+maybequoted(ChangeFileExt(current_module.exefilename^,'.map'));
if create_smartlink_sections then
GCSectionsStr:='--gc-sections';
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^);
@ -733,6 +742,7 @@ begin
Replace(cmdstr,'$STATIC',StaticStr); Replace(cmdstr,'$STATIC',StaticStr);
Replace(cmdstr,'$STRIP',StripStr); Replace(cmdstr,'$STRIP',StripStr);
Replace(cmdstr,'$GCSECTIONS',GCSectionsStr); Replace(cmdstr,'$GCSECTIONS',GCSectionsStr);
Replace(cmdstr,'$MAP',MapStr);
Replace(cmdstr,'$DYNLINK',DynLinkStr); Replace(cmdstr,'$DYNLINK',DynLinkStr);
success:=DoExec(FindUtil(utilsprefix+BinStr),cmdstr,true,false); success:=DoExec(FindUtil(utilsprefix+BinStr),cmdstr,true,false);

View File

@ -14,6 +14,7 @@ uses
ctypes, nds9; ctypes, nds9;
{$linklib filesystem} {$linklib filesystem}
{$linklib fat}
{$linklib nds9} {$linklib nds9}
{$linklib c} {$linklib c}