* just like Darwin and Classic Mac OS, AIX uses the system crt* files and

hence contains a dummy "main" that refers to the system unit
    FPC_SYSTEMMAIN, which in turn jumps to the main program's PASCALMAIN
  * we call FPC_SYSTEMMAIN instead of jumping to it like on Darwin, so that
    the TOC gets set correctly

git-svn-id: trunk@20792 -
This commit is contained in:
Jonas Maebe 2012-04-11 18:00:43 +00:00
parent 57908f528b
commit 481b3d99a9
2 changed files with 7 additions and 4 deletions

View File

@ -2373,14 +2373,17 @@ implementation
if (current_procinfo.procdef.proctypeoption=potype_proginit) then
begin
if (target_info.system in (systems_darwin+[system_powerpc_macos])) and
if (target_info.system in (systems_darwin+[system_powerpc_macos]+systems_aix)) and
not(current_module.islibrary) then
begin
new_section(list,sec_code,'',4);
list.concat(tai_symbol.createname_global(
target_info.cprefix+mainaliasname,AT_FUNCTION,0));
{ keep argc, argv and envp properly on the stack }
cg.a_jmp_name(list,target_info.cprefix+'FPC_SYSTEMMAIN');
if not(target_info.system in systems_aix) then
cg.a_jmp_name(list,target_info.cprefix+'FPC_SYSTEMMAIN')
else
cg.a_call_name(list,target_info.cprefix+'FPC_SYSTEMMAIN',false)
end;
end;
end;

View File

@ -2261,12 +2261,12 @@ implementation
begin
main_procinfo:=create_main_proc(make_mangledname('',current_module.localsymtable,mainaliasname),potype_proginit,current_module.localsymtable);
{ Win32 startup code needs a single name }
if not(target_info.system in systems_darwin) then
if not(target_info.system in (systems_darwin+systems_aix)) then
main_procinfo.procdef.aliasnames.insert('PASCALMAIN')
else
main_procinfo.procdef.aliasnames.insert(target_info.Cprefix+'PASCALMAIN')
end
else if (target_info.system in ([system_i386_netware,system_i386_netwlibc,system_powerpc_macos]+systems_darwin)) then
else if (target_info.system in ([system_i386_netware,system_i386_netwlibc,system_powerpc_macos]+systems_darwin+systems_aix)) then
begin
main_procinfo:=create_main_proc('PASCALMAIN',potype_proginit,current_module.localsymtable);
end