Add -Caoldwin32gnu ABI option to cope with 'ret $4' issues in old GNU mingw32 C compiler (version below 4.7)

git-svn-id: trunk@26536 -
This commit is contained in:
pierre 2014-01-20 22:47:46 +00:00
parent a85bb98aa6
commit 1cec09f979
5 changed files with 13 additions and 7 deletions

View File

@ -1106,6 +1106,8 @@ implementation
(abiinfo[t].name=hs) then (abiinfo[t].name=hs) then
begin begin
a:=t; a:=t;
{ abi_old_win32_gnu is a win32 i386 specific "feature" }
if (t<>abi_old_win32_gnu) or (target_info.system=system_i386_win32) then
result:=true; result:=true;
break; break;
end; end;

View File

@ -380,7 +380,8 @@ unit cgcpu;
{ but not on win32 } { but not on win32 }
{ and not for safecall with hidden exceptions, because the result } { and not for safecall with hidden exceptions, because the result }
{ wich contains the exception is passed in EAX } { wich contains the exception is passed in EAX }
if (target_info.system <> system_i386_win32) and if ((target_info.system <> system_i386_win32) or
(target_info.abi=abi_old_win32_gnu)) and
not ((current_procinfo.procdef.proccalloption = pocall_safecall) and not ((current_procinfo.procdef.proccalloption = pocall_safecall) and
(tf_safecall_exceptions in target_info.flags)) and (tf_safecall_exceptions in target_info.flags)) and
paramanager.ret_in_param(current_procinfo.procdef.returndef, paramanager.ret_in_param(current_procinfo.procdef.returndef,

View File

@ -93,7 +93,8 @@ implementation
it is always the first parameter (apart from hidden parentfp, it is always the first parameter (apart from hidden parentfp,
but this one is never put into a register (vs_nonregable set) but this one is never put into a register (vs_nonregable set)
so funcret is always in EAX for register calling } so funcret is always in EAX for register calling }
if (target_info.system = system_i386_win32) and if ((target_info.system = system_i386_win32) and
not (target_info.abi=abi_old_win32_gnu)) and
paramanager.ret_in_param(procdefinition.returndef,procdefinition) and paramanager.ret_in_param(procdefinition.returndef,procdefinition) and
not ((procdefinition.proccalloption=pocall_register) or not ((procdefinition.proccalloption=pocall_register) or
((procdefinition.proccalloption=pocall_internproc) and ((procdefinition.proccalloption=pocall_internproc) and

View File

@ -263,6 +263,7 @@
tabi = (abi_default tabi = (abi_default
,abi_powerpc_sysv,abi_powerpc_aix ,abi_powerpc_sysv,abi_powerpc_aix
,abi_eabi,abi_armeb,abi_eabihf ,abi_eabi,abi_armeb,abi_eabihf
,abi_old_win32_gnu
); );

View File

@ -204,7 +204,7 @@ interface
end; end;
tabiinfo = record tabiinfo = record
name: string[10]; name: string[11];
supported: boolean; supported: boolean;
end; end;
@ -344,7 +344,8 @@ interface
(name: 'AIX' ; supported:{$if defined(powerpc) or defined(powerpc64)}true{$else}false{$endif}), (name: 'AIX' ; supported:{$if defined(powerpc) or defined(powerpc64)}true{$else}false{$endif}),
(name: 'EABI' ; supported:{$ifdef FPC_ARMEL}true{$else}false{$endif}), (name: 'EABI' ; supported:{$ifdef FPC_ARMEL}true{$else}false{$endif}),
(name: 'ARMEB' ; supported:{$ifdef FPC_ARMEB}true{$else}false{$endif}), (name: 'ARMEB' ; supported:{$ifdef FPC_ARMEB}true{$else}false{$endif}),
(name: 'EABIHF' ; supported:{$ifdef FPC_ARMHF}true{$else}false{$endif}) (name: 'EABIHF' ; supported:{$ifdef FPC_ARMHF}true{$else}false{$endif}),
(name: 'OLDWIN32GNU'; supported:{$ifdef CPUI386}true{$else}false{$endif})
); );
var var