Преглед на файлове

* 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 -

Jonas Maebe преди 13 години
родител
ревизия
481b3d99a9
променени са 2 файла, в които са добавени 7 реда и са изтрити 4 реда
  1. 5 2
      compiler/ncgutil.pas
  2. 2 2
      compiler/pmodules.pas

+ 5 - 2
compiler/ncgutil.pas

@@ -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;

+ 2 - 2
compiler/pmodules.pas

@@ -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