Commit Graph

400 Commits

Author SHA1 Message Date
florian
1bf58c2a55 + introduce TExitCode
git-svn-id: trunk@47029 -
2020-10-01 20:33:02 +00:00
florian
1e4dc56155 * inlinable frame handling dummies for avr
* inline frame handler if possible

git-svn-id: trunk@47025 -
2020-09-30 21:18:33 +00:00
yury
aa633544f1 * Added a simple implementation of random. It is TP/Delphi compatible. Enabled it for 8/16 bit CPUs by default.
git-svn-id: trunk@46266 -
2020-08-05 16:29:07 +00:00
nickysn
5b24267529 * reduced the stack margin for stack checking to 64 bytes on the Z80
git-svn-id: trunk@45168 -
2020-04-29 01:22:22 +00:00
nickysn
9c7f1a7cab * synchronized with trunk
git-svn-id: branches/z80@45046 -
2020-04-24 03:30:29 +00:00
yury
8d95da3fea * Windows: Reworked handling of command line arguments to properly support Unicode:
- Use the CommandLineToArgvW API function to parse the Unicode command line (we can use it since Win9x is not supported anymore).
  - Implemented non-public functions ParamStrA and ParamStrU which are exposed in the objpas and uuchar units to provide correct AnsiString and UnicodeString versions of ParamStr(). 
  - The cleanup code is moved from InternalExit to the finalization section of the System unit.

git-svn-id: trunk@45037 -
2020-04-23 12:38:42 +00:00
nickysn
755fe97c51 * synchronize with trunk
git-svn-id: branches/z80@44397 -
2020-03-29 16:24:32 +00:00
florian
83a6efd759 + Xtensa: RTL skeleton
git-svn-id: trunk@44320 -
2020-03-20 22:35:43 +00:00
florian
a20209e691 + tf_init_final_units_by_calls
* arm-embedded generates direct calls for unit init/final now as well

git-svn-id: trunk@43771 -
2019-12-24 16:14:30 +00:00
florian
88648248ec * fix random(<int64>) for 32 Bit CPUs
git-svn-id: trunk@43194 -
2019-10-13 20:23:01 +00:00
pierre
5cc4f0be20 Fix bug report #36081: fix cycling starting with i386-linux 3.0.4 release compiler
git-svn-id: trunk@43029 -
2019-09-18 07:45:47 +00:00
florian
94832d5eea * fixed define
git-svn-id: trunk@43027 -
2019-09-17 18:42:40 +00:00
florian
1872bee116 * stack checking checks also proper alignment
git-svn-id: trunk@43011 -
2019-09-15 17:17:30 +00:00
svenbarth
0c46460548 * m68k has slightly different alignment requirements, so that aligntoptr might result in incorrect addresses for a record's element entries, thus we introduce a separate AlignTypeData function that handles this correctly
git-svn-id: trunk@42764 -
2019-08-22 20:45:45 +00:00
Jonas Maebe
b0683edfcb * simplified random(int64) code
git-svn-id: trunk@42513 -
2019-07-28 12:03:46 +00:00
Jonas Maebe
789f288771 * fixed distribution of random(int64) based on patch by Pangea
(mantis #35878)

git-svn-id: trunk@42508 -
2019-07-28 11:14:58 +00:00
svenbarth
55dfb59631 * TRttiDataCommon is required outside of the RTTI and DynArray include files as well
git-svn-id: trunk@42437 -
2019-07-13 14:38:20 +00:00
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
florian
fefe52327c * z80-embedded rtl skeleton continued
git-svn-id: branches/z80@35712 -
2017-04-02 12:59:24 +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