Browse Source

* palmos patch from mazen

git-svn-id: trunk@2400 -
peter 19 years ago
parent
commit
54d4e9e4b9

+ 3 - 0
compiler/arm/cputarg.pas

@@ -44,6 +44,9 @@ implementation
     {$ifndef NOTARGETGBA}
     {$ifndef NOTARGETGBA}
       ,t_gba
       ,t_gba
     {$endif}
     {$endif}
+    {$ifndef NOTARGETPALMOS}
+      ,t_palmos
+    {$endif}
 
 
 {**************************************
 {**************************************
              Assemblers
              Assemblers

+ 3 - 0
compiler/m68k/cputarg.pas

@@ -39,6 +39,9 @@ implementation
       ,t_linux
       ,t_linux
     {$endif}
     {$endif}
       ,t_amiga
       ,t_amiga
+    {$ifndef NOTARGETPALMOS}
+      ,t_palmos
+    {$endif}
 
 
 {**************************************
 {**************************************
           Assembler Readers
           Assembler Readers

+ 28 - 14
compiler/systems/i_palmos.pas

@@ -32,15 +32,12 @@ unit i_palmos;
             system       : system_m68k_PalmOS;
             system       : system_m68k_PalmOS;
             name         : 'PalmOS';
             name         : 'PalmOS';
             shortname    : 'PalmOS';
             shortname    : 'PalmOS';
-            flags        : [tf_code_small,tf_static_a5_based];
+            flags        : [tf_code_small,tf_static_reg_based,tf_smartlink_sections];
             cpu          : cpu_m68k;
             cpu          : cpu_m68k;
-            short_name   : 'PALMOS';
             unit_env     : 'PALMUNITS';
             unit_env     : 'PALMUNITS';
             extradefines : '';
             extradefines : '';
-            sharedlibext : '.so';
-            staticlibext : '.a';
             exeext       : '';
             exeext       : '';
-            defext       : '';
+            defext       : '.def';
             scriptext    : '.sh';
             scriptext    : '.sh';
             smartext     : '.sl';
             smartext     : '.sl';
             unitext      : '.ppu';
             unitext      : '.ppu';
@@ -49,27 +46,44 @@ unit i_palmos;
             objext       : '.o';
             objext       : '.o';
             resext       : '.res';
             resext       : '.res';
             resobjext    : '.or';
             resobjext    : '.or';
+            sharedlibext : '.so';
+            staticlibext : '.a';
             staticlibprefix : 'libp';
             staticlibprefix : 'libp';
             sharedlibprefix : 'lib';
             sharedlibprefix : 'lib';
-            p_ext_support : false;
+            sharedClibext : '.so';
+            staticClibext : '.a';
+            staticClibprefix : 'lib';
+            sharedClibprefix : 'lib';
             Cprefix      : '_';
             Cprefix      : '_';
             newline      : #10;
             newline      : #10;
             dirsep       : '/';
             dirsep       : '/';
-            files_case_relevent : true;
             assem        : as_gas;
             assem        : as_gas;
             assemextern  : as_gas;
             assemextern  : as_gas;
-            link         : ld_m68k_palmos;
-            linkextern   : ld_m68k_palmos;
-            ar           : ar_m68k_ar;
+            link         : nil;
+            linkextern   : nil;
+            ar           : ar_gnu_ar;
             res          : res_none;
             res          : res_none;
             dbg          : dbg_stabs;
             dbg          : dbg_stabs;
             script       : script_unix;
             script       : script_unix;
             endian       : endian_big;
             endian       : endian_big;
-            stackalignment : 2;
-            maxCrecordalignment : 4;
+            alignment    :
+              (
+                procalign       : 4;
+                loopalign       : 4;
+                jumpalign       : 0;
+                constalignmin   : 0;
+                constalignmax   : 4;
+                varalignmin     : 0;
+                varalignmax     : 4;
+                localalignmin   : 0;
+                localalignmax   : 4;
+                recordalignmin  : 0;
+                recordalignmax  : 2;
+                maxCrecordalign : 4
+              );
+            first_parm_offset : 8;
             stacksize    : 8192;
             stacksize    : 8192;
-            DllScanSupported:false;
-            use_function_relative_addresses : false
+            abi : abi_default;
           );
           );
 
 
        res_m68k_palmos_info : tresinfo =
        res_m68k_palmos_info : tresinfo =

+ 6 - 6
compiler/systems/t_palmos.pas

@@ -73,7 +73,7 @@ Function TLinkerPalmOS.WriteResponseFile : Boolean;
 Var
 Var
   linkres  : TLinkRes;
   linkres  : TLinkRes;
   i        : longint;
   i        : longint;
-  HPath    : PStringQueueItem;
+  HPath    : TStringListItem;
   s        : string;
   s        : string;
   linklibc : boolean;
   linklibc : boolean;
 begin
 begin
@@ -98,7 +98,7 @@ begin
 
 
   { add objectfiles, start with crt0 always  }
   { add objectfiles, start with crt0 always  }
   { using crt0, we should stick C compatible }
   { using crt0, we should stick C compatible }
-  LinkRes.AddFileName(FindObjectFile('crt0',''));
+  LinkRes.AddFileName(FindObjectFile('crt0','',false));
 
 
   { main objectfiles }
   { main objectfiles }
   while not ObjectFiles.Empty do
   while not ObjectFiles.Empty do
@@ -163,7 +163,7 @@ var
   i : longint;
   i : longint;
 begin
 begin
   if not(cs_link_extern in aktglobalswitches) then
   if not(cs_link_extern in aktglobalswitches) then
-    Message1(exec_i_linking,current_module^.exefilename^);
+    Message1(exec_i_linking,current_module.exefilename^);
 
 
   { Create some replacements }
   { Create some replacements }
   StripStr:='';
   StripStr:='';
@@ -180,9 +180,9 @@ begin
      SplitBinCmd(Info.ExeCmd[i],binstr,cmdstr);
      SplitBinCmd(Info.ExeCmd[i],binstr,cmdstr);
      if binstr<>'' then
      if binstr<>'' then
       begin
       begin
-        Replace(cmdstr,'$EXE',MaybeQuote(current_module.exefilename^));
+        Replace(cmdstr,'$EXE',MaybeQuoted(current_module.exefilename^));
         Replace(cmdstr,'$OPT',Info.ExtraOptions);
         Replace(cmdstr,'$OPT',Info.ExtraOptions);
-        Replace(cmdstr,'$RES',maybequoted(outputexedir+Info.ResName));
+        Replace(cmdstr,'$RES',MaybeQuoted(outputexedir+Info.ResName));
         Replace(cmdstr,'$STRIP',StripStr);
         Replace(cmdstr,'$STRIP',StripStr);
         Replace(cmdstr,'$SCRIPT',FindUtil('palm.ld'));
         Replace(cmdstr,'$SCRIPT',FindUtil('palm.ld'));
         Replace(cmdstr,'$APPNAME',palmos_applicationname);
         Replace(cmdstr,'$APPNAME',palmos_applicationname);
@@ -206,7 +206,7 @@ end;
 
 
 initialization
 initialization
 {$ifdef m68k}
 {$ifdef m68k}
-  RegisterTarget(target_m68k_palmos_info);
+  RegisterTarget(system_m68k_palmos_info);
   RegisterRes(res_m68k_palmos_info);
   RegisterRes(res_m68k_palmos_info);
 {$endif m68k}
 {$endif m68k}
 end.
 end.