瀏覽代碼

--- Merging r43650 into '.':
U compiler/i386/cpupi.pas
U compiler/ncgcal.pas
U compiler/ncgutil.pas
U compiler/systems/i_bsd.pas
U compiler/systems/i_linux.pas
U compiler/systems.inc

git-svn-id: branches/fixes_3_2@43683 -

Jonas Maebe 5 年之前
父節點
當前提交
c4bcb45fea
共有 6 個文件被更改,包括 11 次插入7 次删除
  1. 1 1
      compiler/i386/cpupi.pas
  2. 1 1
      compiler/ncgcal.pas
  3. 1 1
      compiler/ncgutil.pas
  4. 5 1
      compiler/systems.inc
  5. 2 2
      compiler/systems/i_bsd.pas
  6. 1 1
      compiler/systems/i_linux.pas

+ 1 - 1
compiler/i386/cpupi.pas

@@ -92,7 +92,7 @@ unit cpupi;
           from the stack at the end of the procedure (in the "ret $xx").
           from the stack at the end of the procedure (in the "ret $xx").
           If the stack is fixed, nothing has to be removed by the callee, except
           If the stack is fixed, nothing has to be removed by the callee, except
           if a 16 byte aligned stack on i386-linux is used     }
           if a 16 byte aligned stack on i386-linux is used     }
-        if paramanager.use_fixed_stack and not(target_info.abi=abi_linux386_sysv) then
+        if paramanager.use_fixed_stack and not(target_info.abi=abi_i386_dynalignedstack) then
           para_stack_size := 0;
           para_stack_size := 0;
       end;
       end;
 
 

+ 1 - 1
compiler/ncgcal.pas

@@ -1198,7 +1198,7 @@ implementation
            This does not apply to interrupt procedures, their ret statment never clears any stack parameters }
            This does not apply to interrupt procedures, their ret statment never clears any stack parameters }
          else if paramanager.use_fixed_stack and
          else if paramanager.use_fixed_stack and
                  not(po_interrupt in procdefinition.procoptions) and
                  not(po_interrupt in procdefinition.procoptions) and
-                 (target_info.abi=abi_linux386_sysv) then
+                 (target_info.abi=abi_i386_dynalignedstack) then
            begin
            begin
              { however, a delphi style frame pointer for a nested subroutine
              { however, a delphi style frame pointer for a nested subroutine
                is not cleared by the callee, so we have to compensate for this
                is not cleared by the callee, so we have to compensate for this

+ 1 - 1
compiler/ncgutil.pas

@@ -1394,7 +1394,7 @@ implementation
             parasize:=current_procinfo.para_stack_size;
             parasize:=current_procinfo.para_stack_size;
             { the parent frame pointer para has to be removed always by the caller in
             { the parent frame pointer para has to be removed always by the caller in
               case of Delphi-style parent frame pointer passing }
               case of Delphi-style parent frame pointer passing }
-            if (not(paramanager.use_fixed_stack) or (target_info.abi=abi_linux386_sysv)) and
+            if (not(paramanager.use_fixed_stack) or (target_info.abi=abi_i386_dynalignedstack)) and
                (po_delphi_nested_cc in current_procinfo.procdef.procoptions) then
                (po_delphi_nested_cc in current_procinfo.procdef.procoptions) then
               dec(parasize,sizeof(pint));
               dec(parasize,sizeof(pint));
           end;
           end;

+ 5 - 1
compiler/systems.inc

@@ -316,7 +316,11 @@
             ,abi_eabi,abi_armeb,abi_eabihf
             ,abi_eabi,abi_armeb,abi_eabihf
             ,abi_old_win32_gnu
             ,abi_old_win32_gnu
             ,abi_aarch64_darwin
             ,abi_aarch64_darwin
-            ,abi_linux386_sysv
+            { stack is aligned and all room for parameters is reserved on
+              entry, but depending on the calling convention, the parameters
+              may still be removed by the callee (and then the stack needs to
+              be restored by the caller) }
+            ,abi_i386_dynalignedstack
        );
        );
 
 
      const
      const

+ 2 - 2
compiler/systems/i_bsd.pas

@@ -832,7 +832,7 @@ unit i_bsd;
             first_parm_offset : 8;
             first_parm_offset : 8;
             stacksize   : 262144;
             stacksize   : 262144;
             stackalign   : 16;
             stackalign   : 16;
-            abi         : abi_default;
+            abi         : abi_i386_dynalignedstack;
             llvmdatalayout : 'e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128-n8:16:32-S128';
             llvmdatalayout : 'e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128-n8:16:32-S128';
           );
           );
 
 
@@ -897,7 +897,7 @@ unit i_bsd;
             first_parm_offset : 8;
             first_parm_offset : 8;
             stacksize   : 262144;
             stacksize   : 262144;
             stackalign   : 16;
             stackalign   : 16;
-            abi         : abi_default;
+            abi         : abi_i386_dynalignedstack;
             llvmdatalayout : 'e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128-n8:16:32-S128';
             llvmdatalayout : 'e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128-n8:16:32-S128';
           );
           );
 
 

+ 1 - 1
compiler/systems/i_linux.pas

@@ -94,7 +94,7 @@ unit i_linux;
             first_parm_offset : 8;
             first_parm_offset : 8;
             stacksize    : 8*1024*1024;
             stacksize    : 8*1024*1024;
             stackalign   : 16;
             stackalign   : 16;
-            abi : abi_linux386_sysv;
+            abi : abi_i386_dynalignedstack;
             { note: default LLVM stack alignment is 16 bytes for this target }
             { note: default LLVM stack alignment is 16 bytes for this target }
             llvmdatalayout : 'e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32-S32';
             llvmdatalayout : 'e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32-S32';
           );
           );