From 292e21df12eb1f9cb691b64d7ccc8abf8cf968e2 Mon Sep 17 00:00:00 2001 From: pierre Date: Mon, 30 Nov 1998 13:13:40 +0000 Subject: [PATCH] * needs asw to link correctly wprt0 or wdllprt0 file --- rtl/win32/Makefile | 9 ++++++++- rtl/win32/syswin32.pp | 18 ++++++++++++++---- rtl/win32/wdllprt0.as | 6 +++--- rtl/win32/wprt0.as | 12 ++++++------ 4 files changed, 31 insertions(+), 14 deletions(-) diff --git a/rtl/win32/Makefile b/rtl/win32/Makefile index 0a8c1d2c9e..27a78d6a47 100644 --- a/rtl/win32/Makefile +++ b/rtl/win32/Makefile @@ -137,6 +137,10 @@ clean : # # Base Units (System, strings, os-dependent-base-unit) # +ifneq ($(OS_SOURCE),win32) +override AS=asw +endif + wprt0$(OEXT) : wprt0.as $(AS) -o wprt0$(OEXT) wprt0.as @@ -393,7 +397,10 @@ include $(CFG)/makefile.def # # $Log$ -# Revision 1.13 1998-11-30 09:16:57 pierre +# Revision 1.14 1998-11-30 13:13:40 pierre +# * needs asw to link correctly wprt0 or wdllprt0 file +# +# Revision 1.13 1998/11/30 09:16:57 pierre # + added the changes from Pavel Ozerski after several modifications # to be able to create DLLs # diff --git a/rtl/win32/syswin32.pp b/rtl/win32/syswin32.pp index c848055cca..25b7736010 100644 --- a/rtl/win32/syswin32.pp +++ b/rtl/win32/syswin32.pp @@ -731,9 +731,9 @@ begin end; end; {$endif} -{$ASMMODE ATT} -procedure Exe_entry;[public, alias : 'FPC_EXE_Entry']; +{$ASMMODE DIRECT} +procedure Exe_entry;[public, alias : '_FPC_EXE_Entry']; begin IsLibrary:=false; asm @@ -743,7 +743,7 @@ procedure Exe_entry;[public, alias : 'FPC_EXE_Entry']; ExitProcess(0); end; -procedure Dll_entry;[public, alias : 'FPC_DLL_Entry']; +procedure Dll_entry;[public, alias : '_FPC_DLL_Entry']; begin IsLibrary:=true; case DLLreason of @@ -756,8 +756,15 @@ procedure Dll_entry;[public, alias : 'FPC_DLL_Entry']; end; end; end; + + const + Exe_entry_code : pointer = @Exe_entry; + Dll_entry_code : pointer = @Dll_entry; + {$endif def FPC_WIN32_DLL_SUPPORT} +{$ASMMODE ATT} + begin { get some helpful informations } GetStartupInfo(@startupinfo); @@ -792,7 +799,10 @@ end. { $Log$ - Revision 1.25 1998-11-30 09:16:58 pierre + Revision 1.26 1998-11-30 13:13:41 pierre + * needs asw to link correctly wprt0 or wdllprt0 file + + Revision 1.25 1998/11/30 09:16:58 pierre + added the changes from Pavel Ozerski after several modifications to be able to create DLLs diff --git a/rtl/win32/wdllprt0.as b/rtl/win32/wdllprt0.as index f689cbf14e..24395b40cf 100644 --- a/rtl/win32/wdllprt0.as +++ b/rtl/win32/wdllprt0.as @@ -4,11 +4,11 @@ .text .globl _mainCRTStartup _mainCRTStartup: - movl $1,U_SYSWIN32_ISCONSOLE + movb $1,U_SYSWIN32_ISCONSOLE jmp .LDLL_Entry .globl _WinMainCRTStartup _WinMainCRTStartup: - movl $0,U_SYSWIN32_ISCONSOLE + movb $0,U_SYSWIN32_ISCONSOLE .LDLL_Entry: pushl %ebp movl %esp,%ebp @@ -21,7 +21,7 @@ _WinMainCRTStartup: movl %edi,U_SYSWIN32_DLLREASON movl 16(%ebp),%edi movl %edi,U_SYSWIN32_DLLPARAM - call FPC_DLL_Entry + call _FPC_DLL_Entry popl %edi popl %esi popl %ebx diff --git a/rtl/win32/wprt0.as b/rtl/win32/wprt0.as index 0cf26017d4..5ab5b00661 100644 --- a/rtl/win32/wprt0.as +++ b/rtl/win32/wprt0.as @@ -3,12 +3,12 @@ //1998 // modified by Pierre Muller .text - .GLOBL _mainCRTStartup + .globl _mainCRTStartup _mainCRTStartup: - movl $1,U_SYSWIN32_ISCONSOLE - jmp FPC_EXE_Entry -.GLOBL _WinMainCRTStartup + movb $1,U_SYSWIN32_ISCONSOLE + call _FPC_EXE_Entry + .globl _WinMainCRTStartup _WinMainCRTStartup: - movl $0,U_SYSWIN32_ISCONSOLE - jmp FPC_EXE_Entry + movb $0,U_SYSWIN32_ISCONSOLE + call _FPC_EXE_Entry