mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-06-04 04:38:27 +02:00
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:
parent
a85bb98aa6
commit
1cec09f979
@ -327,7 +327,7 @@ interface
|
||||
{ parameter switches }
|
||||
debugstop : boolean;
|
||||
{$EndIf EXTDEBUG}
|
||||
{ Application type (platform specific)
|
||||
{ Application type (platform specific)
|
||||
see globtype.pas for description }
|
||||
apptype : tapptype;
|
||||
|
||||
@ -915,7 +915,7 @@ implementation
|
||||
{$undef GETENVOK}
|
||||
{$else}
|
||||
GetEnvPchar:=StrPNew(GetEnvironmentVariable(envname));
|
||||
if (length(GetEnvPChar)=0) then
|
||||
if (length(GetEnvPChar)=0) then
|
||||
begin
|
||||
FreeEnvPChar(GetEnvPChar);
|
||||
GetEnvPChar:=nil;
|
||||
@ -1106,7 +1106,9 @@ implementation
|
||||
(abiinfo[t].name=hs) then
|
||||
begin
|
||||
a:=t;
|
||||
result:=true;
|
||||
{ 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;
|
||||
break;
|
||||
end;
|
||||
end;
|
||||
|
@ -380,7 +380,8 @@ unit cgcpu;
|
||||
{ but not on win32 }
|
||||
{ and not for safecall with hidden exceptions, because the result }
|
||||
{ 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
|
||||
(tf_safecall_exceptions in target_info.flags)) and
|
||||
paramanager.ret_in_param(current_procinfo.procdef.returndef,
|
||||
|
@ -93,7 +93,8 @@ implementation
|
||||
it is always the first parameter (apart from hidden parentfp,
|
||||
but this one is never put into a register (vs_nonregable set)
|
||||
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
|
||||
not ((procdefinition.proccalloption=pocall_register) or
|
||||
((procdefinition.proccalloption=pocall_internproc) and
|
||||
|
@ -263,6 +263,7 @@
|
||||
tabi = (abi_default
|
||||
,abi_powerpc_sysv,abi_powerpc_aix
|
||||
,abi_eabi,abi_armeb,abi_eabihf
|
||||
,abi_old_win32_gnu
|
||||
);
|
||||
|
||||
|
||||
|
@ -204,7 +204,7 @@ interface
|
||||
end;
|
||||
|
||||
tabiinfo = record
|
||||
name: string[10];
|
||||
name: string[11];
|
||||
supported: boolean;
|
||||
end;
|
||||
|
||||
@ -344,7 +344,8 @@ interface
|
||||
(name: 'AIX' ; supported:{$if defined(powerpc) or defined(powerpc64)}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: '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
|
||||
|
Loading…
Reference in New Issue
Block a user