Sfoglia il codice sorgente

* win32 profiling updates

git-svn-id: trunk@1059 -
peter 20 anni fa
parent
commit
35ac5f133e
3 ha cambiato i file con 28 aggiunte e 40 eliminazioni
  1. 0 19
      compiler/ncgutil.pas
  2. 1 2
      compiler/systems/t_win.pas
  3. 27 19
      rtl/win32/gprt0.as

+ 0 - 19
compiler/ncgutil.pas

@@ -1595,25 +1595,6 @@ implementation
         { call startup helpers from main program }
         if (current_procinfo.procdef.proctypeoption=potype_proginit) then
          begin
-           { initialize profiling for win32 }
-           if (target_info.system in [system_i386_win32,system_i386_wdosx]) and
-              (cs_profile in aktmoduleswitches) then
-            begin
-              reference_reset_symbol(href,objectlibrary.newasmsymbol('etext',AB_EXTERNAL,AT_DATA),0);
-              paramanager.getintparaloc(pocall_default,1,paraloc1);
-              paramanager.getintparaloc(pocall_default,2,paraloc2);
-              paramanager.allocparaloc(list,paraloc2);
-              cg.a_paramaddr_ref(list,href,paraloc2);
-              reference_reset_symbol(href,objectlibrary.newasmsymbol('__image_base__',AB_EXTERNAL,AT_DATA),0);
-              paramanager.allocparaloc(list,paraloc1);
-              cg.a_paramaddr_ref(list,href,paraloc1);
-              paramanager.freeparaloc(list,paraloc2);
-              paramanager.freeparaloc(list,paraloc1);
-              cg.allocallcpuregisters(list);
-              cg.a_call_name(list,'_monstartup');
-              cg.deallocallcpuregisters(list);
-            end;
-
            if (target_info.system = system_powerpc_darwin) then
              begin
               { the parameters are already in the right registers }

+ 1 - 2
compiler/systems/t_win.pas

@@ -985,9 +985,8 @@ begin
      LinkRes.Add('GROUP(');
      if (cs_profile in aktmoduleswitches) then
        begin
+         LinkRes.Add('-lc');
          LinkRes.Add('-lgcc');
-         LinkRes.Add('-lmoldname');
-         LinkRes.Add('-lmsvcrt');
          LinkRes.Add('-lgmon');
          LinkRes.Add('-lkernel32');
        end;

+ 27 - 19
rtl/win32/gprt0.as

@@ -1,29 +1,46 @@
-// Startup code for WIN32 port of Free Pascal
-// with profiling enabled.
+//Startup code for WIN32 port of Free Pascal
+//Written by P.Ozerski 1998
+// modified by Pierre Muller
      .text
      .globl _mainCRTStartup
 _mainCRTStartup:
      movb   $1,U_SYSTEM_ISCONSOLE
-     call   _FPC_EXE_Entry
+     jmp    _start
+
      .globl _WinMainCRTStartup
 _WinMainCRTStartup:
      movb   $0,U_SYSTEM_ISCONSOLE
+_start:
+     subl   $0x8,%esp
+     andl   $0xfffffff0,%esp
+     push   $_cmain
+     call   _cygwin_crt0
+
+     .globl _cmain
+_cmain:
+     subl   $0x8,%esp
+     andl   $0xfffffff0,%esp
+     pushl  etext
+     pushl  __image_base__
+     call   _monstartup
+     call   ___main
      call   _FPC_EXE_Entry
-     
+     ret
+
      .globl asm_exit
-asm_exit:     
+asm_exit:
     pushl  %eax
     call   __mcleanup
     popl   %eax
-    pushl  %eax
-	call   exitprocess
-	
+    pushl   %eax
+    call    exitprocess
+
 .text
 .globl	exitprocess
 exitprocess:
 	jmp	*.L10
 	.balign 4,144
-	
+
 .text
 	.balign 4,144
 
@@ -40,7 +57,7 @@ exitprocess:
 
 .section .idata$5
 .L8:
-	
+
 
 .section .idata$5
 .L10:
@@ -56,12 +73,3 @@ exitprocess:
 .section .idata$7
 .L6:
 	.ascii	"kernel32.dll\000"
-     
-
-//
-
-// Revision 1.1  2002/11/30 18:17:35  carl
-//   + profiling support
-//
-//
-//