ソースを参照

* Enabled safecall on x86_64-linux

git-svn-id: trunk@17629 -
joost 14 年 前
コミット
45bc3fcae0

+ 1 - 1
compiler/pdecsub.pas

@@ -184,7 +184,7 @@ implementation
              paranr:=paranr_result_leftright
              paranr:=paranr_result_leftright
            else
            else
 {$elseif defined(x86) or defined(arm)}
 {$elseif defined(x86) or defined(arm)}
-           if (target_info.system in systems_all_windows) and
+           if (tf_safecall_exceptions in target_info.flags) and
               (pd.proccalloption = pocall_safecall)  then
               (pd.proccalloption = pocall_safecall)  then
              paranr:=paranr_result_leftright
              paranr:=paranr_result_leftright
            else
            else

+ 1 - 1
compiler/systems/i_linux.pas

@@ -414,7 +414,7 @@ unit i_linux;
             shortname    : 'Linux';
             shortname    : 'Linux';
             flags        : [tf_needs_symbol_size,tf_needs_dwarf_cfi,tf_smartlink_library,
             flags        : [tf_needs_symbol_size,tf_needs_dwarf_cfi,tf_smartlink_library,
                             tf_library_needs_pic,tf_needs_symbol_type,tf_files_case_sensitive,
                             tf_library_needs_pic,tf_needs_symbol_type,tf_files_case_sensitive,
-                            tf_has_winlike_resources];
+                            tf_has_winlike_resources,tf_safecall_exceptions,tf_safecall_clearstack];
             cpu          : cpu_x86_64;
             cpu          : cpu_x86_64;
             unit_env     : 'LINUXUNITS';
             unit_env     : 'LINUXUNITS';
             extradefines : 'UNIX;HASUNIX';
             extradefines : 'UNIX;HASUNIX';

+ 6 - 3
compiler/x86_64/cpupara.pas

@@ -598,9 +598,12 @@ unit cpupara;
         classes: tx64paraclasses;
         classes: tx64paraclasses;
         numclasses: longint;
         numclasses: longint;
       begin
       begin
-        if ((target_info.system=system_x86_64_win64) and
-            (calloption=pocall_safecall)) then
-          exit(true);
+        if (tf_safecall_exceptions in target_info.flags) and
+            (calloption=pocall_safecall) then
+          begin
+          result := true;
+          exit;
+          end;
         case def.typ of
         case def.typ of
           { for records it depends on their contents and size }
           { for records it depends on their contents and size }
           recorddef,
           recorddef,

+ 1 - 1
tests/test/tsafecall1.pp

@@ -1,4 +1,4 @@
-{ %TARGET=win32,win64,wince}
+{ %TARGET=win32,win64,wince,linux}
 {$ifdef fpc}
 {$ifdef fpc}
 {$mode objfpc}
 {$mode objfpc}
 {$endif}
 {$endif}

+ 1 - 1
tests/test/tsafecall2.pp

@@ -1,4 +1,4 @@
-{ %TARGET=win32,win64,wince}
+{ %TARGET=win32,win64,wince,linux}
 program tsafecall2;
 program tsafecall2;
 
 
 {$mode objfpc}{$H+}
 {$mode objfpc}{$H+}

+ 1 - 1
tests/test/tsafecall3.pp

@@ -1,4 +1,4 @@
-{ %TARGET=win32,win64,wince}
+{ %TARGET=win32,win64,wince,linux}
 program tsafecall3;
 program tsafecall3;
 
 
 {$mode objfpc}{$H+}
 {$mode objfpc}{$H+}

+ 1 - 1
tests/test/tsafecall4.pp

@@ -1,4 +1,4 @@
-{ %TARGET=win32,win64,wince}
+{ %TARGET=win32,win64,wince,linux}
 program tsafecall4;
 program tsafecall4;
 
 
 {$mode objfpc}{$H+}
 {$mode objfpc}{$H+}