Răsfoiți Sursa

* Riscv32 and Riscv64 on linux: enable safecall support

florian 3 ani în urmă
părinte
comite
19ad26afd8

+ 2 - 0
compiler/fpcdefs.inc

@@ -348,6 +348,7 @@
   {$define cpuneedsdivhelper}
   {$define cpucapabilities}
   {$define cpurequiresproperalignment}
+  {$define SUPPORT_SAFECALL}
 {$endif riscv32}
 
 {$ifdef z80}
@@ -374,6 +375,7 @@
   {$define cpuneedsdivhelper}
   {$define cpucapabilities}
   {$define cpurequiresproperalignment}
+  {$define SUPPORT_SAFECALL}
 {$endif riscv64}
 
 {$ifdef xtensa}

+ 1 - 0
compiler/riscv32/cpuinfo.pas

@@ -137,6 +137,7 @@ Const
    { calling conventions supported by the code generator }
    supported_calling_conventions : tproccalloptions = [
      pocall_internproc,
+     pocall_safecall,
      pocall_stdcall,
      { the difference to stdcall is only the name mangling }
      pocall_cdecl,

+ 1 - 0
compiler/riscv64/cpuinfo.pas

@@ -75,6 +75,7 @@ Const
   { calling conventions supported by the code generator }
   supported_calling_conventions: tproccalloptions = [
     pocall_internproc,
+    pocall_safecall,
     pocall_stdcall,
     { the difference to stdcall is only the name mangling }
     pocall_cdecl,

+ 2 - 0
compiler/systems/i_linux.pas

@@ -1250,6 +1250,7 @@ unit i_linux;
             flags        : [tf_needs_symbol_size,tf_smartlink_sections,tf_needs_dwarf_cfi,
                             tf_needs_symbol_type,tf_files_case_sensitive,
                             tf_requires_proper_alignment,tf_has_winlike_resources,
+                            tf_safecall_exceptions,
                             tf_supports_hidden_symbols];
             cpu          : cpu_riscv32;
             unit_env     : 'LINUXUNITS';
@@ -1320,6 +1321,7 @@ unit i_linux;
             flags        : [tf_needs_symbol_size,tf_library_needs_pic,tf_smartlink_sections,tf_needs_dwarf_cfi,
                             tf_needs_symbol_type,tf_files_case_sensitive,
                             tf_requires_proper_alignment,tf_has_winlike_resources,
+                            tf_safecall_exceptions,
                             tf_supports_hidden_symbols
                             ];
             cpu          : cpu_riscv64;