diff --git a/.gitattributes b/.gitattributes index e0c6677e35..a5509a1077 100644 --- a/.gitattributes +++ b/.gitattributes @@ -5254,6 +5254,7 @@ rtl/symbian/sysdir.inc svneol=native#text/plain rtl/symbian/sysfile.inc svneol=native#text/plain rtl/symbian/sysheap.inc svneol=native#text/plain rtl/symbian/sysos.inc svneol=native#text/plain +rtl/symbian/sysosh.inc svneol=native#text/plain rtl/symbian/system.pp svneol=native#text/plain rtl/symbian/systhrd.inc svneol=native#text/plain rtl/ucmaps/8859-1.txt svneol=native#text/plain diff --git a/compiler/systems/i_symbian.pas b/compiler/systems/i_symbian.pas index e544df17d4..f3797721ef 100644 --- a/compiler/systems/i_symbian.pas +++ b/compiler/systems/i_symbian.pas @@ -58,7 +58,7 @@ unit i_symbian; Cprefix : '_'; newline : #13#10; dirsep : '\'; - assem : as_i386_pecoff; + assem : as_gas; assemextern : as_gas; link : nil; linkextern : nil; diff --git a/rtl/symbian/sysosh.inc b/rtl/symbian/sysosh.inc new file mode 100644 index 0000000000..08a1dc523c --- /dev/null +++ b/rtl/symbian/sysosh.inc @@ -0,0 +1,34 @@ +{ + This file is part of the Free Pascal run time library. + Copyright (c) 2007 by contributors of the Free Pascal Compiler + + This file implements all the base types and limits required + for a minimal POSIX compliant subset required to port the compiler + to a new OS. + + See the file COPYING.FPC, included in this distribution, + for details about the copyright. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + **********************************************************************} + +{Platform specific information} +type + THandle = Longint; + TThreadID = THandle; + + { pthread_mutex_t } + PRTLCriticalSection = ^TRTLCriticalSection; + TRTLCriticalSection = record + __m_reserved: longint; + __m_count: longint; + __m_owner: pointer; + __m_kind: longint; + __m_lock: record + __status: sizeint; + __spinlock: longint; + end; + end; diff --git a/rtl/symbian/system.pp b/rtl/symbian/system.pp index c0f7f1cdcf..c53edc6a95 100644 --- a/rtl/symbian/system.pp +++ b/rtl/symbian/system.pp @@ -152,31 +152,39 @@ begin end; {***************************************************************************** - Exit code and Entry Point + System Dependent Exit code *****************************************************************************} -procedure PascalMain; stdcall; external name 'PASCALMAIN'; -procedure fpc_do_exit; stdcall; external name 'FPC_DO_EXIT'; +//procedure PascalMain; stdcall; external name 'PASCALMAIN'; +//procedure fpc_do_exit; stdcall; external name 'FPC_DO_EXIT'; + +Procedure system_exit; +begin + +end; + +var + { value of the stack segment + to check if the call stack can be written on exceptions } + _SS : Cardinal; + +function Pascal_E32Main: Integer; cdecl; [public, alias: '_Pascal_E32Main']; +var + ST : pointer; +begin + IsLibrary := false; + +// PascalMain; + + { if we pass here there was no error } + system_exit; +end; procedure SysInitStdIO; begin end; -procedure _E32Startup; stdcall; public name '_E32Startup'; -begin - IsLibrary:=false; - - PascalMain; - - { if we pass here there was no error } - fpc_do_exit; -end; - -{***************************************************************************** - Process routines -*****************************************************************************} - (* ProcessID cached to avoid repeated calls to GetCurrentProcess. *) var @@ -192,5 +200,11 @@ begin result := stklen; end; +{ +const + Exe_entry_code : pointer = @Exe_entry; + Dll_entry_code : pointer = @Dll_entry; +} + begin end.