Commit Graph

382 Commits

Author SHA1 Message Date
svenbarth
3ad24c9db8 * as attributes can be part of any type they are best suited in a common part of TTypeData
git-svn-id: trunk@42375 -
2019-07-12 22:06:09 +00:00
Jeppe Johansen
2f501be2a0 Fixed stack checking for embedded target. Based on work by Christo Crause
git-svn-id: trunk@42157 -
2019-06-01 19:18:31 +00:00
Jonas Maebe
aad87820e6 * abstracted registration of library init/fini routines (to be able to add
LLVM support)

git-svn-id: trunk@42104 -
2019-05-19 19:20:47 +00:00
pierre
902ef73c7c Allways use local pt variable to ameliorate readability of code
git-svn-id: trunk@42082 -
2019-05-16 08:24:45 +00:00
pierre
3a52fdf997 Add FPC_SYSTEM_EXIT_NO_RETURN macro for embedded target
git-svn-id: trunk@40801 -
2019-01-07 21:41:18 +00:00
florian
72416edcc4 + support for tlsm_general on i386-linux
git-svn-id: trunk@40281 -
2018-11-11 17:32:20 +00:00
yury
a077e0dd90 * Fixed comparison.
git-svn-id: trunk@40186 -
2018-11-02 19:04:26 +00:00
florian
a34d4e715c Merged riscv_new branch
git-svn-id: trunk@39813 -
2018-09-26 19:49:08 +00:00
pierre
16e2bdad5a Avoid wrap on 32-bit system for StackTop calculation
git-svn-id: trunk@39735 -
2018-09-11 13:10:59 +00:00
Jeppe Johansen
ceb38833f2 Added RiscV32/64 target, from a cleaned up version of branches/laksen/riscv/trunk.
git-svn-id: branches/laksen/riscv_new@39474 -
2018-07-20 08:21:15 +00:00
svenbarth
b75324a4f2 * move RTTI declarations to their own header file
git-svn-id: trunk@39248 -
2018-06-20 18:59:57 +00:00
svenbarth
44b15350fb * disable RTTI declarations if RTTI feature is disabled
git-svn-id: trunk@39247 -
2018-06-20 18:59:54 +00:00
pierre
5f8f00dcd3 Allow to use CPU specific code for move procedure for systems using libc code with -dUSE_CPU_MOVE (allows easier testing for AIX, no effect by default)
git-svn-id: trunk@38976 -
2018-05-11 15:52:48 +00:00
pierre
250e924ad3 + Add RTE 236 for thread errors:
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 -
2018-03-21 10:19:04 +00:00
florian
22df9cde3e * halt and runerror never return
git-svn-id: trunk@38202 -
2018-02-11 10:21:16 +00:00
Károly Balogh
07513150e0 * make StdOut/StdErr optionally a true alias of Output/ErrOutput, so they share the same underlying TextRec. this reduces data segment usage on small systems by more than 1K.
git-svn-id: trunk@38196 -
2018-02-10 22:45:51 +00:00
svenbarth
e09ec0e36b + add ability to have explicitely implemented Pointer overloads of the Interlocked* routines instead of forwarding them to the ones with suitable size.
git-svn-id: trunk@38052 -
2018-01-26 21:36:35 +00:00
florian
b086b10adf * enable more features for avr6
* ifdef'ed uncompilable procedures

git-svn-id: trunk@37584 -
2017-11-12 22:14:21 +00:00
svenbarth
8b5461367b * move TTypeKind from TypInfo unit to System unit as it's necessary for the future GetTypeKind() intrinsic
* also adjust (P)Byte usages to (P/T)TypeKind where necessary/approbiate

git-svn-id: trunk@36873 -
2017-08-11 20:37:36 +00:00
florian
cd70098b84 + SPARC64 support for the system unit
git-svn-id: trunk@36431 -
2017-06-05 21:33:59 +00:00
pierre
d5f2c58d32 Fix bug report 34320, about random returning two same values at start
git-svn-id: trunk@35259 -
2017-01-08 09:19:50 +00:00
Károly Balogh
233185a4e5 rtti: make aligntoqword to always align to the same size as typinfo/AlignTypeData. this fixes m68k crashes in RTTI after r35218
git-svn-id: trunk@35228 -
2017-01-04 05:01:53 +00:00
florian
0b82f71e8d * take care of the fact that there are 32 bit abis (e.g. ARMHF) which align qword on 8 byte boundaries, resolves issue #31132
git-svn-id: trunk@35218 -
2016-12-30 15:32:56 +00:00
marco
7ef8f00100 * more occured -> occurred spelling fixes.
git-svn-id: trunk@35130 -
2016-12-14 20:05:21 +00:00
nickysn
e1792e712a * changed the 'size' parameter of fpc_zeromem and fpc_fillmem from ptruint to sizeuint
git-svn-id: trunk@34741 -
2016-10-18 15:42:29 +00:00
pierre
b9e336dcbe Fix for trwsync.pp sporadic failure that appeared in trunk.
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 -
2016-08-16 11:59:33 +00:00
svenbarth
25c4a5c986 Fix usage of external resources on systems besides Darwin by moving the variable referencing FPC_RESLOCATION fon non-indirect entry information systems from system.inc back into intres.inc
git-svn-id: trunk@33984 -
2016-06-14 12:18:36 +00:00
svenbarth
7f079ff58a Fix compilation of Win64 and WinCE as those don't have indirect entry information yet and thus they'd require FPC_RESLOCATION which is not available for those platforms... Fixes Mantis #30264.
git-svn-id: trunk@33982 -
2016-06-13 07:55:45 +00:00
svenbarth
f8ff8eca4d Fix non-Windows resources since me and merging without TortoiseSVN don't go along that well :/
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 -
2016-06-12 10:57:15 +00:00
svenbarth
3f45860cf9 Use constref instead of const when passing TEntryInformation along
git-svn-id: trunk@33951 -
2016-06-11 20:45:47 +00:00
svenbarth
535621faaa Rename FPC_HAS_INDIRECT_MAIN_INFORMATION to FPC_HAS_INDIRECT_ENTRY_INFORMATION which is more logical considering the record's name
git-svn-id: trunk@33950 -
2016-06-11 20:38:22 +00:00
svenbarth
f406867100 Merged revision(s) 31929-31931,32547 from branches/svenbarth/packages:
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 -
2016-06-11 20:29:51 +00:00
pierre
06b0bb56c1 Disable SysFreeMem call for argv for win16 OS, which does not use SysFreeMem
git-svn-id: trunk@33715 -
2016-05-20 15:19:18 +00:00
svenbarth
6afda909d4 Rework TlsKey handling on Windows so that it works as intended with indirect main information
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 -
2016-02-12 17:03:52 +00:00
svenbarth
1951b8aaaa Fix threadvar handling. Basically a merge of r31913 of my packages branch.
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 -
2016-01-30 23:10:35 +00:00
Jonas Maebe
9c3cab8224 * replaced pure LGPL Mersenne Twister implementation with a public domain
version

git-svn-id: trunk@33029 -
2016-01-29 18:03:14 +00:00
svenbarth
e3060130a4 Adjustments so that the resource string related tables are provided inside the system unit (both for indirect and direct entry targets).
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 -
2016-01-29 17:19:33 +00:00
svenbarth
0491bca72a inc/system.inc:
+ 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 -
2016-01-29 16:24:53 +00:00
Jeppe Johansen
5ec4d38231 Add support for ram-less AVR chips and simultanously optimize flash/ram size the initfinal calling sequence.
git-svn-id: trunk@32448 -
2015-11-22 00:37:10 +00:00
nickysn
0f6b5161e6 * the 'count' parameter of Move and FillChar on i8086 made 16-bit unsigned,
instead of signed (BP7 compatibility)

git-svn-id: trunk@32443 -
2015-11-21 17:55:47 +00:00
nickysn
e2ed8f2251 * fixed various procvars being casted to pointer instead of codepointer in the rtl
git-svn-id: trunk@32167 -
2015-10-27 17:25:27 +00:00
Jonas Maebe
80902035e0 * moved excepth.inc include from the system unit implementation to interface
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 -
2015-10-25 19:21:54 +00:00
yury
7c62aadf65 * Fixed string conversion warnings in RTL.
git-svn-id: trunk@31752 -
2015-09-17 17:25:57 +00:00
Jonas Maebe
c7aabaa3b6 - removed FPC_OBJFPC_EXTENDED_IF-related code, FPC 2.6.4 has it
git-svn-id: trunk@31696 -
2015-09-15 11:52:02 +00:00
Jonas Maebe
3f736f6114 * handle the loading of VMT entries at the node level, so it's done in a
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 -
2015-05-31 16:50:47 +00:00
florian
10dc944d35 * disable some function using ansistrings if the ansistring feature is turned off
git-svn-id: trunk@30630 -
2015-04-17 20:12:36 +00:00
michael
81fa382c42 * Rename WriteExceptionToStdErr -> WriteErrorsToStdErr
git-svn-id: trunk@30555 -
2015-04-12 15:37:46 +00:00
michael
94e57aa463 * Moved WriteExceptionToStdErr to system unit, so it is observed even in absence of sysutils (bug ID 27708)
git-svn-id: trunk@30551 -
2015-04-12 13:58:49 +00:00
florian
9ab9e03650 * limit number of possible units with initialization/finalization for a certain architecture to high(aint)
+ give an error if the number of possible units is exceeded

git-svn-id: trunk@30450 -
2015-04-05 21:06:58 +00:00
Jonas Maebe
67b8aceaee * synchronized with privatetrunk till r30095
git-svn-id: branches/hlcgllvm@30101 -
2015-03-05 20:32:15 +00:00