inc/systemh.inc and java/jsystemh.inc:
+ Add reThreadError (and also reNoDynLibsSupport) to TRuntimeError.
* Add new values to RuntimeErrorExitCodes after extension of TRuntimeError
inc/system.inc and java/jsystem.inc:
* use RTE 236 in fpc_threaderror.
objpas/sysconst.pp and objpas/sysutils/stre.inc:
+ Add SThreadError string constant.
objpas/sysutils/sysutilh.inc:
+ Add EThreadError class.
objpas/sysutils/sysutils.inc
+ Add 236 to EThreadError conversion to exeptmap.
git-svn-id: trunk@38584 -
The problem was in the source of random related functions,
which are used in this test by several thread in parallel,
while this code is known and advertised as non-thread safe.
The access by multiple threads led to multiple increments of the
mt_index static variable, which was then never reset to zero and
led to all successive calls to random function to return zero.
This fix simply insures that the mt_state array is never
accessed past its end, and that mt_index is reset correctly even
if multiple increments do happen.
It does not make the random function thread-safe.
* Use local variable l_index to avoid accessing mt_state array past last element.
* Change mt_index=MTWIST_N+1 into l_index>=MTWIST_N+1
to insure that mt_init will be called again if index is past end.
git-svn-id: trunk@34320 -
rtl/inc/system.inc:
+ ResHeader variable that provides the public _FPC_ResLocation symbol used by intres.inc; this variable will always be available and without indirect entry information it will simply hook up to FPC_RESLOCATION itself
* SetupEntryInformation: setup FPCResLocation
rtl/inc/intres.inc:
* no need to cater for indirect entry or not anymore
git-svn-id: trunk@33964 -
Switch Mac OS X to indirect entry information.
compiler/systems/t_bsd.pas, TLinkerBSD:
+ implement InitSysInitUnitName
compiler/system.pas:
* systems_internal_sysinit: add Darwin systems
compiler/hlcgobj.pas, thlcgobj:
* gen_proc_symbol_end: for Darwin systems don't directly call PascalMain for libraries, but FPC_LIBMAIN instead
rtl/darwin:
+ add sysinit.pas unit which contains the executable and library entry points for Darwin
rtl/darwin/Makefile.fpc:
* add sysinit unit
rtl/bsd/sysosh.inc:
+ add a Darwin specific TPlatformEntryInformation (could probably be used for all Unix systems...)
rtl/bsd/system.pp:
* define FPC_HAS_INDIRECT_MAIN_INFORMATION for Darwin systems once we're no longer bootstrapping with 2.6.x
+ add EntryInformation variable (this could maybe moved to system.inc...)
+ add new procedure SysEntry that is called from the entrypoint and which sets up necessary information required by other parts of the RTL
* the old FPC_SYSTEMMAIN is still in place for bootstrapping
rtl/inc/systemh.inc, TEntryInformation:
* PascalMain is cdecl on non-Windows systems (ToDo: really?)
rtl/inc/system.inc:
* initialstklen is provided by the indirect entry information, so no external here
........
Fix bootstrapping.
rtl/darwin/sysinit.pas:
* enable the code only when no longer bootstrapping with 2.6.x
........
Fix bootstrapping.
rtl/objpas/objpas.pp:
* define FPC_HAS_INDIRECT_MAIN_INFORMATION for Darwin only while not bootstrapping with 2.6.x
........
rtl/darwin/sysinit.pas:
* reference PASCALMAIN correctly (I wonder how this even worked previously :/ )
git-svn-id: trunk@33949 -
rtl/inc/system.inc:
* SetupEntryInformation: call new, optional function OSSetupEntryInformation to handle platform specific entry information initialization
rtl/win/sysosh.inc, TEntryInformationOS:
+ new field TlsKeyAddr which will hold the address to the main binary's TlsKey variable
win32/sysinit.inc:
+ provide the variable holding the TlsKey and pass that on to the entry information record
win32/system.pp:
+ new OS specific entry information initialization (currently only the TlsKey)
win/systhrd.inc:
* declare TlsKey as a pointer to a DWord value instead of a DWord; on non-indirect entry platforms this is initialized with the address of new variable TlsKeyVar, on indirect entry platforms it will be initialized by the entry information initialization
* adjust usages of TlsKey from DWord to PDWord
win/systlsdir.inc:
* TlsKey is now a PDWord and (in sysinit) points to TlsKeyVar
win/syswin.inc:
* adjust TlsKey usage
inc/heaptrc.pp:
* TlsKey is now a PDWord, thus adjust the import and the usage
git-svn-id: trunk@33091 -
rtl/inc/system.inc:
* provide a public alias for SetupEntryInformation so that it can be used in SysInit as well without globally exporting it
rtl/win/systlsdir.inc:
* Exec_tls_callback: call SetupEntryInformation before initalizing the heap and multithreading so that the threadvar tables can be referenced correctly
git-svn-id: trunk@33035 -
rtl/inc/system.inc:
+ new variables that hold pointers to the tables
+ new procedure SetupEntryInformation() that should be used in the entry points of indirect entry targets to setup cross target fields
+ for direct entry targets the two resource string tables are imported here and supplied as initialization to the table pointers
objpas/objpas.pp:
* adjust table declarations so that the pointers provided from the System unit are used
* adjust usages of the tables as they are now pointers
win32/system.pp:
* Exe_Entry: use SetupEntryInformation()
win/syswin.inc:
* Dll_Entry: use SetupEntryInformation()
git-svn-id: trunk@33028 -
+ add (uninitialized) global variable EntryInformation for systems that use indirect main information
win32/system.pp:
- remove initialized EntryInformation and instead rely on the one passed by the sysinit* units
git-svn-id: trunk@33026 -
so that we can still find the type definitions in it once we don't store
the entire implementation symtable to the ppu anymore
git-svn-id: trunk@32151 -
type-safe way (for LLVM, and also internal consistency checking between
the VMT as generated in nobj.pas and ncgvmt.pas)
o also converted the VMT validity checking to the node level
git-svn-id: trunk@30950 -