Commit Graph

14735 Commits

Author SHA1 Message Date
Nikolay Nikolov
30b503abc4 * instead of using the 'throw' intrinsic, set a boolean flag, in the branchful
exceptions support code
2021-10-05 00:49:29 +03:00
Nikolay Nikolov
5124ab2521 * cloned the WebAssembly native exceptions code generation and rtl support into
the branchful exceptions (which will be modified later, but we're using this
  as their starting point, because we can get a snapshot built, without compiler
  internal errors)
2021-10-05 00:37:20 +03:00
Nikolay Nikolov
be90ad1672 + enabled compilation of unit heaptrc for the WASI target 2021-10-03 03:29:54 +03:00
Nikolay Nikolov
77ca8ba16d * always return error in SysUtils.FindFirst and .FindNext on the WASI platform,
in order to prevent infinite loops in tests
2021-10-03 01:08:52 +03:00
Nikolay Nikolov
c450b63f1c + enabled compilation of the fpintres unit for the WASI target and enabled tf_has_winlike_resources for the target 2021-10-02 22:43:05 +03:00
Nikolay Nikolov
3258937d97 + implemented move() for WebAssembly via the memory.copy instruction 2021-10-02 21:33:28 +03:00
Nikolay Nikolov
2e3e3edb5f + implemented FillChar for WebAssembly via the memory.fill instruction 2021-10-02 20:31:37 +03:00
Nikolay Nikolov
85207e94f8 + added inline numbers for a memory.copy and a memory.fill intrinsic 2021-10-02 19:40:36 +03:00
Nikolay Nikolov
02745b0b83 + implemented GetDate, GetTime and WeekDay in the WASI dos unit. They return
UTC time (I don't know how to obtain the local time zone from within WASI).
2021-10-01 06:34:52 +03:00
flyingsheep
6c6cb13a5e * Fix for issue #39379 by bart broersma 2021-09-29 17:21:57 +02:00
Nikolay Nikolov
3836b0be04 * longjmp in fpc_reraise changed to a throw instruction intrinsic in wasm native exceptions mode 2021-09-28 04:02:52 +03:00
Nikolay Nikolov
0c3e179652 - get rid of fpc_PushExceptAddr and fpc_PopAddrStack entirely, when compiling in
wasm native exceptions mode - these helper routines aren't necessary in this
  mode
2021-09-28 03:59:38 +03:00
Nikolay Nikolov
91f0f1a86c * don't include except.inc if wasm32 native exception is turned on, instead
replace it with except_native.inc
2021-09-28 03:46:30 +03:00
Nikolay Nikolov
73bc8edef3 + RTL support for raising exceptions in native wasm exceptions mode 2021-09-28 03:31:04 +03:00
Nikolay Nikolov
33e25a3dfe + added except_native.inc include file (empty for now, but will provide RTL
support for the native wasm exceptions in the future)
2021-09-18 03:08:48 +03:00
Nikolay Nikolov
c2754eac3f + introduced the wasm32_throw_fpcexception inline function, that emits a
'throw' instruction. This way we'll be able to emit this instruction from
  RTL code (i.e. from fpc_raiseexception, when that is implemented for
  WebAssembly)
2021-09-18 02:39:16 +03:00
florian
f8c92914c2 * indention fixed 2021-09-06 23:05:35 +02:00
florian
a5f6505edc * fix range checking for zero based strings, resolves #39323 2021-09-05 21:03:31 +02:00
florian
396a030fc2 + debugging statement 2021-09-04 19:12:04 +02:00
Bernd Kreuss
2210143239 fix wording of error message when field not found during reading of lfm file 2021-09-02 11:16:56 +02:00
Ondrej Pokorny
bce2f26234 * TEncoding.GetEncoding - create unicode encodings, not only MBCS 2021-09-01 09:31:50 +02:00
florian
d354428f42 * moved fwait 2021-09-01 09:29:51 +02:00
Michaël Van Canneyt
52c8ac0ca0 * Fix by Mark Paley to add IfThen for StringList and TStringDynArray. Issue #39314 2021-09-01 09:29:50 +02:00
Michaël Van Canneyt
c587f5a681 * fix compilation 2021-09-01 09:29:50 +02:00
Michaël Van Canneyt
c4069b5fe8 * Remove spurious var, prevents fpdoc from handling record 2021-09-01 09:29:50 +02:00
florian
777d536d9b * extended routines int/frac/trunc shouldn't mess with precision or exception flags, should fix #39275 2021-08-12 21:20:30 +02:00
Ondrej Pokorny
a55794d80d DateTimeToString: do not write #0 separators 2021-08-11 12:22:29 +00:00
Ondrej Pokorny
0ae0e741cf win: fix default ShortDateFormat and LongDateFormat 2021-08-11 11:37:43 +00:00
Ondrej Pokorny
2c81b44b1c win: fix default ShortDateFormat and LongDateFormat 2021-08-11 11:37:43 +00:00
marcoonthegit
37863a6166 * Add skeleton for TPoint3D 2021-08-05 17:17:29 +02:00
nickysn
b878d461c8 * fixed compilation for i8086 and 8-bit targets after r49622. The conditional
ifdef checks for the ordinal helpers rewritten to be less dependendant on
  defines, such as CPU16/CPU32/CPU64 and instead use sizeof(integer),
  sizeof(nativeint) and sizeof(nativeuint)

git-svn-id: trunk@49634 -
2021-07-23 23:23:47 +00:00
florian
f0d92b74c1 - x86_64: some more fwaits removed
git-svn-id: trunk@49633 -
2021-07-23 20:50:39 +00:00
florian
cebf880df9 * x86-64: fpc_frac_real further improved: memory loads of extendeds are expensive
git-svn-id: trunk@49632 -
2021-07-22 21:15:03 +00:00
florian
fafee8b85b * x86-64: removed some fwait instructions from fpc_frac_real, they shouldn't be necessary
git-svn-id: trunk@49626 -
2021-07-21 20:41:31 +00:00
michael
e6a593c5fa * Patch from Zeljko Avramovic to extend ordinal/float helpers
git-svn-id: trunk@49622 -
2021-07-21 11:36:05 +00:00
florian
1c13db554c * patch by Christo Crause: Xtensa [patch] Use syscall 0 to spill registers on ESP32, resolves #39221
git-svn-id: trunk@49609 -
2021-07-14 21:47:29 +00:00
florian
6c0b79c258 + AVX512*Support functions
* call cpuid with eax=7 only if it is supported by the CPU

git-svn-id: trunk@49601 -
2021-07-11 20:09:57 +00:00
florian
5ca73c61f4 + CPU.BMI1Support and CPU.BMI2Support
git-svn-id: trunk@49582 -
2021-07-07 20:26:59 +00:00
svenbarth
229506acd0 * fix for Mantis #39147: apply adjusted patch (especially more paranoid checks) from Serge Anvarov
git-svn-id: trunk@49581 -
2021-07-06 21:16:04 +00:00
nickysn
f0543ad8d5 * use -1 instead of 0 for indicating empty DirFD
git-svn-id: trunk@49574 -
2021-07-01 01:48:25 +00:00
nickysn
0219b4018c + initial working implementation of FindFirst/FindNext
git-svn-id: trunk@49573 -
2021-07-01 01:34:07 +00:00
florian
49ff6f5126 * patch by Alfred to fix cross building to darwin, resolves #39109
git-svn-id: trunk@49572 -
2021-06-30 21:01:48 +00:00
michael
1e6952264b * BitSizeOf Documentation sub (issue #39110)
git-svn-id: trunk@49571 -
2021-06-30 10:10:38 +00:00
florian
aca327d787 + added baud rate constants for arm as proposed by Piotr Kardasz in #39101
git-svn-id: trunk@49570 -
2021-06-29 21:09:31 +00:00
marco
98d35bb8cb * redo psd constants, mantis #39022
git-svn-id: trunk@49565 -
2021-06-26 18:36:37 +00:00
florian
4236bee6f1 * win64: factored out cpu specific code
git-svn-id: trunk@49561 -
2021-06-25 21:15:08 +00:00
nickysn
5eac35664f + started working on DOS.FindFirst
git-svn-id: trunk@49555 -
2021-06-24 01:35:24 +00:00
nickysn
433050a2c4 * set EXEEXT to .wasm for the WASI target in fpcmake
git-svn-id: trunk@49552 -
2021-06-24 00:16:00 +00:00
nickysn
afb9c2ae94 + implemented environment variables support in the DOS unit for the WASI target
git-svn-id: trunk@49551 -
2021-06-23 23:15:15 +00:00
nickysn
c275c3c7f2 + implemented Randomize
git-svn-id: trunk@49550 -
2021-06-23 22:11:11 +00:00
nickysn
4240279a84 + always request pollfd_readwrite rights, when opening a file
git-svn-id: trunk@49549 -
2021-06-23 21:48:10 +00:00
nickysn
ca3f1d7b6d + always request FD_ADVISE rights, when opening a file
git-svn-id: trunk@49548 -
2021-06-23 21:45:52 +00:00
nickysn
5ff2af5176 + always request FD_FDSTAT_SET_FLAGS rights
git-svn-id: trunk@49547 -
2021-06-23 21:44:19 +00:00
nickysn
90eb1351dc + request FD_DATASYNC and FD_SYNC rights when a file is opened for writing
git-svn-id: trunk@49546 -
2021-06-23 21:42:49 +00:00
nickysn
67c1520928 * changed the formatting of the setting of fs_rights_base in Do_Open. No functional changes.
git-svn-id: trunk@49545 -
2021-06-23 21:41:12 +00:00
nickysn
9efcd4e554 + request fd_allocate rights when opening a file for writing
git-svn-id: trunk@49544 -
2021-06-23 21:39:10 +00:00
nickysn
3fd6704582 + request the rights to set size (truncate) and set times, when a file is opened for writing
git-svn-id: trunk@49543 -
2021-06-23 21:36:22 +00:00
nickysn
a5309a5d0c + request fd_seek and fd_tell rights when opening a file
git-svn-id: trunk@49542 -
2021-06-23 21:31:55 +00:00
nickysn
720068360e + workaround for newer wasmtime versions that don't report the fd type of
stdin/stdout/stderr. Always assume handles 0..2 are a device, so that
  standard input and output are flushed.

git-svn-id: trunk@49541 -
2021-06-23 21:22:15 +00:00
nickysn
827f543289 * fixed date calculation in WasiDateToDT
git-svn-id: trunk@49540 -
2021-06-23 21:01:30 +00:00
nickysn
c48f27225e + request the FD_FILESTAT_GET capability when opening files
git-svn-id: trunk@49539 -
2021-06-23 20:58:10 +00:00
nickysn
25a9843ea4 * also set doserror to 5 for access denied in dos.getfattr
git-svn-id: trunk@49538 -
2021-06-23 20:57:50 +00:00
nickysn
953893267b + initial WASI implementation of DOS.GetFTime. Not working yet, due to a
compiler bug, related to the import of fd_filestat_get from the wasiapi unit.

git-svn-id: trunk@49536 -
2021-06-23 20:04:03 +00:00
nickysn
ba1dcfc6a4 + also resolve absolute paths in ConvertToFdRelativePath
git-svn-id: trunk@49535 -
2021-06-23 15:44:17 +00:00
nickysn
125dbdc21c + implemented Do_Rename for the WASI target
git-svn-id: trunk@49532 -
2021-06-23 00:30:47 +00:00
nickysn
539ea53bab + implemented Do_Seek and Do_Seekend for the WASI target
git-svn-id: trunk@49531 -
2021-06-23 00:20:48 +00:00
nickysn
17fac45ddc + implemented Do_FileSize for the WASI target
git-svn-id: trunk@49530 -
2021-06-23 00:12:22 +00:00
nickysn
5718b33dd8 + implemented Do_FilePos for the WASI target
git-svn-id: trunk@49529 -
2021-06-23 00:03:44 +00:00
nickysn
5ee902800c + implemented do_truncate for the WASI target
git-svn-id: trunk@49528 -
2021-06-22 23:57:39 +00:00
nickysn
a7b3747b7b + implemented Erase() for the WASI target
git-svn-id: trunk@49527 -
2021-06-22 23:52:22 +00:00
nickysn
0af333bd0f + implemented RmDir for the WASI target
git-svn-id: trunk@49526 -
2021-06-22 23:36:30 +00:00
nickysn
144d7ed978 + implemented MkDir for the WASI target
git-svn-id: trunk@49525 -
2021-06-22 23:33:54 +00:00
nickysn
bc08af99b0 + initial implementation of resolving relative paths
git-svn-id: trunk@49524 -
2021-06-22 23:14:33 +00:00
nickysn
ba3383f7e3 + keep also the fds for the current dirs
git-svn-id: trunk@49523 -
2021-06-22 22:44:20 +00:00
nickysn
d3ce008cd3 + initial implementation of GetDir() for WASI
git-svn-id: trunk@49522 -
2021-06-22 22:35:32 +00:00
nickysn
0a384b0905 * enumerate preopened dirs on startup and store them in a list, accessible via global vars in the system unit
git-svn-id: trunk@49521 -
2021-06-22 20:51:19 +00:00
florian
c193551980 * HaltProc does not return
git-svn-id: trunk@49504 -
2021-06-15 19:34:39 +00:00
florian
4e159b3d45 * set no result in NoBeginThread, it never returns
git-svn-id: trunk@49502 -
2021-06-14 21:32:35 +00:00
florian
2e086a2570 + skeleton of an embedded thread manager
git-svn-id: trunk@49501 -
2021-06-14 21:24:18 +00:00
svenbarth
2b3edb2c53 * in the default exception handler add the captured exception to the exception object stack as well
+ added test (needs to work with any exception handling mechanism; currently tested with SetJmp/LongJmp, SEH 32-bit and SEH 64-bit based exception handling)

git-svn-id: trunk@49486 -
2021-06-06 17:06:24 +00:00
marco
c8be89c7fa * fix from Sebastian Hellwig for writeunicodestring bytes number, mantis 0038963
git-svn-id: trunk@49478 -
2021-06-05 15:42:34 +00:00
nickysn
e00dca1448 + enabled compilation of unit extpas for the WASI target
git-svn-id: trunk@49455 -
2021-06-01 22:43:01 +00:00
nickysn
e830ed6cbc + compile the unit dos (OS-specific functions are dummies for now) for the WASI target
git-svn-id: trunk@49454 -
2021-06-01 22:38:54 +00:00
nickysn
de7ebe219c + enabled compilation of unit uuchar for the WASI platform
git-svn-id: trunk@49453 -
2021-06-01 22:22:45 +00:00
nickysn
fa7444a0d8 + enabled compilation of unit classes for the WASI target
git-svn-id: trunk@49452 -
2021-06-01 22:16:16 +00:00
nickysn
c69649782a + added tthread.inc rtl include file for WASI
git-svn-id: trunk@49450 -
2021-06-01 21:58:02 +00:00
nickysn
84b3036574 + added classes unit for the WASI target (not yet enabled in the makefiles)
git-svn-id: trunk@49446 -
2021-06-01 20:32:10 +00:00
nickysn
9bebe9bcb7 + enabled compilation of unit fpwidestring for the WASI target
git-svn-id: trunk@49445 -
2021-06-01 20:19:16 +00:00
nickysn
3d56f75ba7 + enabled compilation of units unicodedata and unicodenumtable for the WASI target
* fixed the dependencies of unit character

git-svn-id: trunk@49444 -
2021-06-01 20:14:58 +00:00
nickysn
d6fc3129b3 + enabled compilation of unit character for the WASI target
git-svn-id: trunk@49443 -
2021-06-01 20:02:36 +00:00
nickysn
cf857a22ee + enabled compilation of unit cpall for the WASI target
git-svn-id: trunk@49442 -
2021-06-01 19:38:02 +00:00
nickysn
47b664ba92 + enabled compilation of unit charset for the WASI target
git-svn-id: trunk@49441 -
2021-06-01 19:34:31 +00:00
nickysn
2a688eb948 + enabled compilation of unit getopts for the WASI target
git-svn-id: trunk@49440 -
2021-06-01 19:30:23 +00:00
nickysn
a7dfbf0124 + enabled compilation of unit iso7185 for the WASI target
git-svn-id: trunk@49439 -
2021-06-01 19:25:42 +00:00
nickysn
1e34f04729 + enabled compilation of unit macpas for the WASI target
git-svn-id: trunk@49438 -
2021-06-01 19:20:40 +00:00
nickysn
d0b3a599a3 + enabled compilation of unit fgl for the WASI target
git-svn-id: trunk@49437 -
2021-06-01 19:15:41 +00:00
nickysn
08520e032a + enabled compilation of unit typinfo for the WASI target
git-svn-id: trunk@49436 -
2021-06-01 19:11:54 +00:00
nickysn
27ff471ff4 + enabled compilation of unit types for the WASI target
git-svn-id: trunk@49433 -
2021-06-01 17:14:24 +00:00
nickysn
390be44cce + enable compilation of unit rtlconsts for the WASI target
git-svn-id: trunk@49432 -
2021-06-01 17:06:14 +00:00
nickysn
45620b11c0 + enabled compilation of unit math for the WASI target
git-svn-id: trunk@49431 -
2021-06-01 16:56:55 +00:00
nickysn
87111246ca + enabled compilation of unit sortbase for the WASI target
git-svn-id: trunk@49429 -
2021-06-01 15:53:22 +00:00
nickysn
93fea6de3a + enabled compilation of unit SysUtils for the WASI target. Note that WASI
snapshot building fails, when compiler is built with -CR, because of a
  use-after-free bug in the compiler, related to generics. A fix for this bug
  is currently being worked on.

git-svn-id: trunk@49416 -
2021-05-30 20:52:21 +00:00
pierre
0ed69fc662 Fix compilation with 3.2.2 release for arm and i386 CPUs
git-svn-id: trunk@49411 -
2021-05-29 21:25:16 +00:00
svenbarth
cb953f68c2 * as 3.2.0 is now the oldest compiler we support we can now use {$push} {$pop} to reset the $minenumsize in the RTTI header
git-svn-id: trunk@49403 -
2021-05-27 05:43:01 +00:00
yury
73448deda6 * Windows: Prevent removal of the TLS directory by the linker when RTL is compiled with -O4 or when inlining is enabled.
git-svn-id: trunk@49400 -
2021-05-25 16:03:34 +00:00
Károly Balogh
94693e5f70 sinclairql: make sure smsfuncs.inc is in sync with the one in packages
git-svn-id: trunk@49394 -
2021-05-22 09:43:31 +00:00
michael
61cd38e6db * Fixed Issue ID38920: twriter crashes on readonly nil component
git-svn-id: trunk@49389 -
2021-05-22 07:54:30 +00:00
Károly Balogh
12a0083c59 sinclairql: return true as default for do_isdevice to work around weird console flushing issues.
git-svn-id: trunk@49381 -
2021-05-19 07:45:04 +00:00
michael
59d4aaf5ec * Fix issue ID #38900: union wrongly implemented
git-svn-id: trunk@49376 -
2021-05-17 14:56:09 +00:00
florian
90afbc8114 * RiscV: unified cpu initialization and FPU exception handling, resolves #38893
git-svn-id: trunk@49374 -
2021-05-15 20:53:56 +00:00
Károly Balogh
13f3cd2ae3 sinclairql: for setting the exit message of the default console, use a helper function instead.
git-svn-id: trunk@49365 -
2021-05-14 17:32:40 +00:00
Károly Balogh
6fbf4dfd90 sinclairql: introduce a way to override the system unit's console opening/closing and exit message via weakexternals
git-svn-id: trunk@49364 -
2021-05-14 15:26:31 +00:00
florian
bc21634b46 * AVR: made avr_des intrinsic more usefull
git-svn-id: trunk@49362 -
2021-05-13 18:59:28 +00:00
florian
022a9b210f + AVR: avr_des intrinsic
git-svn-id: trunk@49353 -
2021-05-13 09:26:53 +00:00
florian
4de8ca8393 * fpcr and fpsr are 64 bit on aarch64
git-svn-id: trunk@49346 -
2021-05-08 20:10:14 +00:00
Jonas Maebe
3c205f895c * LLVM does not have an intrinsic for int/frac, so don't replace frac with
a call to runerror(207) there

git-svn-id: trunk@49337 -
2021-05-04 19:56:22 +00:00
florian
1e1848da92 * fix exception generation in ln(...), resolves #38832
git-svn-id: trunk@49328 -
2021-05-02 19:45:09 +00:00
Tomas Hajny
9f6651fdb7 + added Get/SetTextAutoFlush feature
git-svn-id: trunk@49324 -
2021-05-02 14:59:21 +00:00
svenbarth
d0b1402e10 * fix for Mantis #37252: apply patch by Bi0T1N to implement TThread.NameThreadForDebugging for Mac OS X 10.6 and newer (older versions don't provide the required functions)
git-svn-id: trunk@49323 -
2021-05-02 12:46:39 +00:00
Károly Balogh
53674e387f sinclairql: include qdosh.inc directly. this will allow easier sharing of qdosfuncs.inc with the qlunits package
git-svn-id: trunk@49308 -
2021-05-01 11:48:39 +00:00
Károly Balogh
394fd2037a sinclairql: sysdeps must include qdosh.inc too
git-svn-id: trunk@49307 -
2021-05-01 11:32:13 +00:00
Károly Balogh
02e6341161 sinclairql: implemented a selection of I/O functions, patch by Norman Dunbar
git-svn-id: trunk@49306 -
2021-05-01 09:59:31 +00:00
michael
5cde6facdb * Patch from Werner Pamler to fix count of digits in periods
git-svn-id: trunk@49299 -
2021-05-01 06:32:48 +00:00
Károly Balogh
c9b90ccde0 m68k: sinclair ql now requires vlink 0.16h or newer.
git-svn-id: trunk@49296 -
2021-04-29 22:23:58 +00:00
florian
822b460096 * fix bootstrapping on aarch64-linux with 3.2.x
git-svn-id: trunk@49264 -
2021-04-25 19:24:18 +00:00
florian
5557dbedf2 + Aarch64: directly inline code for frac(...)
git-svn-id: trunk@49261 -
2021-04-25 09:26:47 +00:00
florian
cd3570caf1 + Aarch64: use frintz for int(...) instead of creating a helper call
git-svn-id: trunk@49260 -
2021-04-25 08:53:12 +00:00
florian
047d13e7e1 * fpsr and fpcr are 64 bit on aarch64
git-svn-id: trunk@49257 -
2021-04-24 14:06:36 +00:00
florian
c3f95f65ed * improved system unit dependencies
git-svn-id: trunk@49251 -
2021-04-23 21:16:16 +00:00
marco
8ad6271fa1 * avoid rangecheck mantis 0038791
git-svn-id: trunk@49250 -
2021-04-23 19:06:18 +00:00
florian
dbee3bcc0d * fixed MSecsToTimeStamp by Lagunov Aleksey, resolves #38631
git-svn-id: trunk@49247 -
2021-04-22 20:14:00 +00:00
marco
e31923c290 * use W variant to get localestrs.
git-svn-id: trunk@49244 -
2021-04-22 14:00:51 +00:00
Károly Balogh
b149718566 sinclairql: added an entirely stub (for now) sysutils unit. added a classes unit. enabled building the whole rtl
git-svn-id: trunk@49239 -
2021-04-20 10:02:39 +00:00
Károly Balogh
6dbcd17f54 sinclairql: hopefully fix off-by-one processing in the packed relocs code
git-svn-id: trunk@49232 -
2021-04-19 05:42:18 +00:00
michael
fe78829b99 * Fix issue ID #38772
git-svn-id: trunk@49225 -
2021-04-18 10:45:47 +00:00
nickysn
711efc3e3a + started working on the SysUtils unit for the WASI platform
git-svn-id: trunk@49220 -
2021-04-17 14:39:54 +00:00
nickysn
a0e88efa6a + compile the sysconst unit for wasm32-wasi
git-svn-id: trunk@49216 -
2021-04-17 11:26:21 +00:00
florian
d53b17cadc + Aarch64: completed LSE support for all interlocked operations
git-svn-id: trunk@49212 -
2021-04-16 19:33:31 +00:00
Károly Balogh
0d5260396c sinclairql: added startup code support for the 'packed' relocation table format in vlink. disabled for now.
git-svn-id: trunk@49211 -
2021-04-16 17:03:41 +00:00
florian
5442e9f9d8 * insert explicit type cast for the count parameter of move/fillchar wrapping C functions,
avoids a warning in combination with -O3 and negative count values

git-svn-id: trunk@49205 -
2021-04-14 19:02:54 +00:00
Károly Balogh
8f61df817a atari: implemented stacktop for working stacktraces, implemented stacksize dependent stackmargin, and a system specific backtracestr. however, offs display still doesn't work properly, due to a linker issue (reported)
git-svn-id: trunk@49203 -
2021-04-14 14:59:08 +00:00
Károly Balogh
2f90dbbd44 sinclairql: implemented StackTop, this results in working stacktraces and working stack checking. Implemented a custom 5% stack safety margin and a system specific SysBackTraceStr()
git-svn-id: trunk@49201 -
2021-04-14 04:05:33 +00:00
Károly Balogh
7b9ed5fe46 rtl: make STACK_MARGIN a variable instead of a const. this allows adjusting margin size on system unit init, based on the actual stack length of the executable. useful for small systems running with little stack. allow overwriting SysBackTraceStr with a platform-specific implementation
git-svn-id: trunk@49200 -
2021-04-14 02:35:01 +00:00
pierre
86c036d9ed Explicitly disable range and overflow checking to avoid troubles with pointer arithmetics
git-svn-id: trunk@49198 -
2021-04-13 20:57:18 +00:00
Károly Balogh
da252e2f4b sinclairql: turn the anyKey string const into a pchar, this reduces the final binary size by 200-odd bytes
git-svn-id: trunk@49196 -
2021-04-13 10:20:29 +00:00
pierre
f90324a02a Add strings unit to buildrtl meta-unit, and update Makefile.fpc accordingly
git-svn-id: trunk@49195 -
2021-04-12 21:34:03 +00:00
Károly Balogh
9e7a8f44aa sinclairql: add right spelling for iof_mkdr, add the QDOS equivalent alias
git-svn-id: trunk@49192 -
2021-04-12 13:23:03 +00:00
Károly Balogh
8128736233 sinclairql: also have a function which returns a pointer directly to the QLstring job name
git-svn-id: trunk@49191 -
2021-04-12 12:21:25 +00:00
Károly Balogh
3280ec3220 sinclairql: have a max. 48 char buffer for job name. set the job name to the program name by default on system unit init
git-svn-id: trunk@49190 -
2021-04-12 11:58:14 +00:00
Károly Balogh
ad05434401 sinclairql: add the used includes to the system unit deps
git-svn-id: trunk@49174 -
2021-04-10 17:23:32 +00:00
Károly Balogh
9432aa4b69 sinclairql: do_mkdir implemented, patch by Norman Dunbar
git-svn-id: trunk@49173 -
2021-04-10 17:20:50 +00:00
Károly Balogh
3d4e677db0 sinclairql: new files to contain SMS only functions, iof_rename implemented, based on a patch by Norman Dunbar
git-svn-id: trunk@49172 -
2021-04-10 17:20:08 +00:00
Károly Balogh
541c65feb7 sinclairql: implemented do_rename(), based on the patch of Norman Dunbar
git-svn-id: trunk@49171 -
2021-04-10 17:04:47 +00:00
Károly Balogh
fc26e2629b sinclairql: various seeking, FS_POSAB/FS_POSRE and ERR_EF related fixes
git-svn-id: trunk@49169 -
2021-04-10 15:15:12 +00:00
Károly Balogh
f3a19aaf59 sinclairql: first version of working argc/argv generation. implemented ParamCount and ParamStr()
git-svn-id: trunk@49168 -
2021-04-10 15:12:45 +00:00
florian
c1f85ac3a1 + initial implementation of path dependent IsFileNameCaseSensitive/IsFileNameCasePreserving functions for darwin
git-svn-id: trunk@49164 -
2021-04-10 13:29:59 +00:00
Jonas Maebe
500e29e5e2 * regenerated with FreeBSD/AArch64 support
git-svn-id: trunk@49159 -
2021-04-10 08:19:40 +00:00
Jonas Maebe
d8021a1102 + FreeBSD/AArch64 support (patch by Mikaël Urankar, mantis #38441)
git-svn-id: trunk@49157 -
2021-04-10 07:57:28 +00:00
Károly Balogh
ca475537e8 sinclairql: instead of tinyheap, made the QL port to use the new OS heap by default, also implemented Randomize, based on patch by Norman Dunbar
git-svn-id: trunk@49150 -
2021-04-09 04:35:54 +00:00
Károly Balogh
f5c22b7a93 sinclairql: various file and directory handling improvements, based on patch by Norman Dunbar
git-svn-id: trunk@49149 -
2021-04-09 04:34:38 +00:00
Károly Balogh
e7681dfe5b sinclairql: implemented io_delet and mt_rclck QDOS functions, patch by Norman Dunbar
git-svn-id: trunk@49148 -
2021-04-09 04:24:06 +00:00
Károly Balogh
d480192477 sinclairql: implemented Error2InOutRes, patch by Norman Dunbar
git-svn-id: trunk@49147 -
2021-04-09 04:22:47 +00:00
Károly Balogh
08023bbad0 sinclairql: fixed parameter trashing in several QDOS function assembler wrappers
git-svn-id: trunk@49146 -
2021-04-09 03:04:24 +00:00
Károly Balogh
caa2735203 osheap: new very small heap manager which only acts as a thin layer above an OS provided heap API. mainly aimed for small and embedded systems
git-svn-id: trunk@49145 -
2021-04-09 02:20:22 +00:00
Károly Balogh
80d549a734 sinclairql: further tweaks to the startup code. enable optimizations. mark functions as noreturn to save a few bytes
git-svn-id: trunk@49144 -
2021-04-08 23:51:48 +00:00
Károly Balogh
ab0de8eec0 sinclairql: fix and simplify the startup code changes in r49134. accessing global variables is not possible before relocation
git-svn-id: trunk@49143 -
2021-04-08 23:33:54 +00:00
Jonas Maebe
f13b47289e * handle case where the first instruction with line information is looked up
o this should be handled better. The common way is looking up address - 1,
     but that doesn't seem to work here.

git-svn-id: trunk@49142 -
2021-04-08 19:50:40 +00:00
Jonas Maebe
7b5e58382b * regenerated
git-svn-id: trunk@49141 -
2021-04-08 19:50:37 +00:00
Jonas Maebe
0eb9dd3879 * Darwin support for printing line info for backtraces when using Dwarf,
based on patches by Colin Western, mantis #38483)
   o requires that the program/library is compiled with -Xg (or that
     dsymutil is run on it after compiling), and that the .dSYM bundle
     is in the same directory as the program/library
   o always use the "dl" unit in exeinfo for Darwin, as that's needed for
     dynamic library support, and this does not cause an extra dependency
     since on Darwin we always use libc
   o cleaned up the exeinfo unit for Darwin, and sped it up by using mmap
     instead of small reads
   o fixed unit dependencies for exeinfo, lineinfo and lnfodwarf in Darwin
     RTL Makefile
  * use the process address info from the original exe even when reading
    the debug information from an external file
  - removed outdated ifdef'd darwin code from dl.pp (no longer needed now
    that processaddress gets set correctly in exeinfo for that platform)

git-svn-id: trunk@49140 -
2021-04-08 19:50:34 +00:00
Jonas Maebe
4166e8c464 * Darwin/BSD: fixed StackBottom calculation
git-svn-id: trunk@49139 -
2021-04-08 19:50:30 +00:00
pierre
44e39f454a Add basic support for setting argc and argv for sinclairql OS
git-svn-id: trunk@49134 -
2021-04-07 15:58:42 +00:00
florian
e4cc8af8fc * Makefiles regenerated
git-svn-id: trunk@49124 -
2021-04-05 15:39:07 +00:00
florian
755c574a87 + lazarus project
git-svn-id: trunk@49119 -
2021-04-04 14:54:56 +00:00
marco
1edc9cd01b * patch from mantis 37205, add OS X sysctl constants
git-svn-id: trunk@49115 -
2021-04-03 19:42:11 +00:00
Jeppe Johansen
d12dd1bdae * CortexM4: Add some missing system registers
git-svn-id: trunk@49114 -
2021-04-03 18:13:51 +00:00
florian
e6f01065ec + Aarch64: use LSE if available for atomic intrinsics
git-svn-id: trunk@49113 -
2021-04-03 11:59:36 +00:00
marco
787798e96f * split propsheetheader in -A and -W variants.
git-svn-id: trunk@49101 -
2021-04-02 14:54:40 +00:00
Jeppe Johansen
d712c64236 * thumb2: Optimize fillchar a bit more with a wider inner loop chunk size
git-svn-id: trunk@49100 -
2021-04-01 20:55:21 +00:00
Jeppe Johansen
8b779975aa * thumb2: Make fillchar smaller, faster and more reliable. Some gas versions remove the "mov r0,r0" making the calculated branch break
git-svn-id: trunk@49098 -
2021-04-01 12:36:06 +00:00
florian
45b3d8e0bf * check for cache entry before even trying to open the file containing the debug info
git-svn-id: trunk@49086 -
2021-03-30 14:06:19 +00:00
florian
4dfcdeaef8 + use a hash table to speed up line info retrieval
git-svn-id: trunk@49080 -
2021-03-29 12:20:39 +00:00
svenbarth
5a20531d9b * rework the basic event on Windows so that peventstate directly represents the Event handle
git-svn-id: trunk@49068 -
2021-03-27 19:48:32 +00:00
Károly Balogh
50cb5707ef amiga: check if P is nil while processing params. this should never happen, except sometimes in real world it still happens. so lets be defensive about it
git-svn-id: trunk@49052 -
2021-03-25 16:33:22 +00:00
michael
e99c9ddd75 * Add deprecation message
git-svn-id: trunk@49038 -
2021-03-23 11:53:33 +00:00
Károly Balogh
1b1e1009c1 rtl: reverted some accidental but harmless extra changes committed in r49036
git-svn-id: trunk@49037 -
2021-03-23 09:36:45 +00:00
Károly Balogh
45b5e9215c rtl: remove defines for v2.x compiler from the common part of the RTL. It's no longer suppported to build with that
git-svn-id: trunk@49036 -
2021-03-23 09:32:49 +00:00
Jeppe Johansen
1105726dcf * Add SAMD51P19A controller type. Unit generated by Michael Ring and slightly modified.
git-svn-id: trunk@49034 -
2021-03-22 18:40:12 +00:00
nickysn
4c209a7dc2 * JVM compilation fixed
git-svn-id: trunk@49026 -
2021-03-21 18:21:53 +00:00
nickysn
800bb3adc2 * instead of using discardresult, wrap the uniquestring functions in procedures,
that are declared as inline

git-svn-id: trunk@49016 -
2021-03-19 21:13:20 +00:00
michael
2a96ad2715 * Check buffer overflow when reading
git-svn-id: trunk@49012 -
2021-03-19 14:25:21 +00:00
michael
3575369989 * Fix leap second reading
git-svn-id: trunk@49006 -
2021-03-19 09:22:13 +00:00
ondrej
2a61397d37 unix: fix timezone info for timers after the last transition
git-svn-id: trunk@49005 -
2021-03-19 08:11:10 +00:00
ondrej
881235b489 unix: fix RefreshTZInfo UTC parameter
git-svn-id: trunk@49001 -
2021-03-18 19:21:51 +00:00
florian
3072df59ff * overflow checked mul helpers do not need to check all bits either
git-svn-id: trunk@48999 -
2021-03-17 21:30:41 +00:00
pierre
39c060dfa7 Avoid copying of objpas.pp into local rtl/macos directory
git-svn-id: trunk@48994 -
2021-03-17 09:33:14 +00:00
pierre
a70feeca7e Add sinclairql/Makefile
git-svn-id: trunk@48981 -
2021-03-15 15:39:30 +00:00
florian
d399df83ba * RiscV32: fpc_longjmp needs nostackframe directive
* RiscV: unified procedure directives of fpc_*jmp

git-svn-id: trunk@48961 -
2021-03-14 13:34:30 +00:00
nickysn
a9f4c8a16b * compilation on Windows fixed
git-svn-id: trunk@48958 -
2021-03-14 02:53:41 +00:00
nickysn
ea8f068817 * regenerated makefiles after sync with trunk
git-svn-id: branches/wasm@48951 -
2021-03-13 21:52:13 +00:00
nickysn
e42330a7ad * synchronized with trunk
git-svn-id: branches/wasm@48949 -
2021-03-13 21:47:24 +00:00
florian
62ea31f255 * riscv64-linux: generate PIC for all units as it is required for shared libraries
git-svn-id: trunk@48948 -
2021-03-13 16:33:31 +00:00
florian
a399627aee + RiscV: initial implementation of gprof support
* cleanup

git-svn-id: trunk@48945 -
2021-03-12 21:27:51 +00:00
pierre
e8fbe6696b Update Makefile's after commits 48929/48930
git-svn-id: trunk@48940 -
2021-03-12 13:23:41 +00:00
florian
3ac178f519 * RiscV: corrected setup of gp
git-svn-id: trunk@48938 -
2021-03-11 21:10:04 +00:00
florian
b7fe338bbe * mips and xtensa compilation fixed
git-svn-id: trunk@48928 -
2021-03-09 21:07:51 +00:00
florian
bb97c5ab69 + RiscV: set threadvarblocksize
* sanity check if threadvarblocksize is really set

git-svn-id: trunk@48925 -
2021-03-08 22:07:07 +00:00
nickysn
f8052134e3 * synchronized with trunk
git-svn-id: branches/wasm@48906 -
2021-03-08 00:52:43 +00:00
florian
813cf7b45e o RiscV64 glibc startup code fixed:
* there is no _init/_fini, call libc_csu_* instead
    * fix loading of global_pointer

git-svn-id: trunk@48904 -
2021-03-07 22:28:18 +00:00
florian
8735d09894 + RiscV32: setjmp/longjmp implementation, based on the RiscV64 one
git-svn-id: trunk@48893 -
2021-03-06 22:19:30 +00:00
florian
6b9a3bf283 + new RiscV32 SUBARCH rv32i
git-svn-id: trunk@48881 -
2021-03-05 21:48:22 +00:00
svenbarth
893cf511bc * fix casing of "VAr", no code changes
git-svn-id: trunk@48862 -
2021-03-02 08:06:05 +00:00
nickysn
940738a3a1 * synchronized with trunk
git-svn-id: branches/wasm@48846 -
2021-03-01 13:21:24 +00:00
florian
2932787dee * use SizeInt for counters in math unit, all non-32 bit targets should benefit from this
git-svn-id: trunk@48815 -
2021-02-26 22:47:06 +00:00
florian
5afa26ddd1 * fix compilation for CPUs without thumb
git-svn-id: trunk@48794 -
2021-02-23 20:39:25 +00:00
florian
3d0eac3ee6 * patch by Michael Ring: remove lm4f120 from armv7m as it is armv7em
git-svn-id: trunk@48750 -
2021-02-21 09:02:29 +00:00
florian
29b0712418 * patch by Michael Ring to fix errors introduced by r48722
git-svn-id: trunk@48734 -
2021-02-20 20:50:04 +00:00
florian
1213948393 * (modified) patch by Michael Ring to enable the FPU on Cortex-M4F if available
git-svn-id: trunk@48722 -
2021-02-19 21:11:12 +00:00
nickysn
d7df2d45c6 * synchronized with trunk
git-svn-id: branches/wasm@48680 -
2021-02-14 23:47:42 +00:00
florian
5e7a512777 * arm-linux: sighnd.inc must check for CPUTHUMB and CPUTHUMB2
git-svn-id: trunk@48670 -
2021-02-13 21:26:15 +00:00
nickysn
a74024e7d5 * synchronized with trunk
git-svn-id: branches/wasm@48654 -
2021-02-12 01:54:24 +00:00
florian
71c314d7d4 * another FPC_VERSION => FPC_FULLVERSIOn fix
* switch back to 32 Bit mode if no thumb code is generated

git-svn-id: trunk@48630 -
2021-02-10 20:46:15 +00:00
michael
47be45830c * Fix issue ID #38462
git-svn-id: trunk@48580 -
2021-02-10 11:00:22 +00:00
florian
3a0eb110ec * FPC_VERSION => FPC_FULLVERSION
git-svn-id: trunk@48547 -
2021-02-08 21:41:04 +00:00
florian
3e453f92fc * statx based Sysutils.FileGetDate with handle fixed
+ test

git-svn-id: trunk@48520 -
2021-02-07 17:59:28 +00:00
florian
b08717fef6 * make statx based Sysutils.FileAge working with relative pathes
+ test

git-svn-id: trunk@48519 -
2021-02-07 17:41:27 +00:00
nickysn
cf3b883bce * synchronized with trunk
git-svn-id: branches/wasm@48513 -
2021-02-04 21:34:40 +00:00
florian
91586331b5 * x86_64-linux: assembler helpers syscalls do not need a stackframe
git-svn-id: trunk@48512 -
2021-02-04 20:57:11 +00:00
pierre
64bd8336f1 Fix compilation of linux unit with -dFPC_USE_LIBC option
git-svn-id: trunk@48504 -
2021-02-02 23:56:22 +00:00
nickysn
9de09f1d28 * synchronized with trunk
git-svn-id: branches/wasm@48498 -
2021-02-02 04:02:02 +00:00
florian
3922926d17 * disable new syscalls on android
git-svn-id: trunk@48495 -
2021-02-01 21:05:23 +00:00
nickysn
d52e918fc8 * synchronized with trunk
git-svn-id: branches/wasm@48480 -
2021-02-01 01:13:27 +00:00
florian
b4a1c27c58 * renamed new syscall wrapper in linux to be consist with the others
git-svn-id: trunk@48479 -
2021-01-31 22:25:18 +00:00
florian
90ba89a128 * linux: FileGetDate makes use of statx if needed
git-svn-id: trunk@48476 -
2021-01-31 18:38:50 +00:00
florian
ef04e3983f * sysutils on linux uses only the new syscalls if the system has no suitable clong type
git-svn-id: trunk@48475 -
2021-01-31 18:20:01 +00:00
florian
c3656c6b1c * fallback to fputime if fputimensat fails as not being available
git-svn-id: trunk@48474 -
2021-01-31 18:09:57 +00:00
florian
d402e0b940 * Y2K38 problem for linux in sysutils.findfirst/findnext should be solved
git-svn-id: trunk@48473 -
2021-01-31 18:02:55 +00:00
florian
b8ab06aae7 + futimens syscall
* make use of futimens syscall in sysutils unit
  + tests

git-svn-id: trunk@48472 -
2021-01-31 17:12:39 +00:00
florian
e6f575d43c + make use of the fputimensat syscall on linux to enable always times beyond 32 bit
git-svn-id: trunk@48471 -
2021-01-31 16:43:53 +00:00
florian
0c77536f11 + linux.fputimensat which properly uses the _tim64 version if needed and available
+ test

git-svn-id: trunk@48470 -
2021-01-31 16:24:47 +00:00
nickysn
cfc9838349 * fixed compilation of the embedded target
git-svn-id: branches/wasm@48462 -
2021-01-31 04:00:08 +00:00
nickysn
8b52969b62 * synchronized with trunk
git-svn-id: branches/wasm@48460 -
2021-01-30 22:29:44 +00:00
florian
f39f8d0f1a * linux: make use of statx in Sysutils.FileAge if available
git-svn-id: trunk@48457 -
2021-01-30 18:47:27 +00:00
florian
de62cb8b02 * do not execute xend twice which was introduced in r48430
git-svn-id: trunk@48456 -
2021-01-30 18:46:58 +00:00
nickysn
2c2f2189e3 + write a debug output message and trap in FPC_LONGJMP for WebAssembly
git-svn-id: branches/wasm@48443 -
2021-01-28 13:02:26 +00:00
nickysn
4ef1367019 + added wasm32 inline procedure for generating the 'unreachable' instruction
git-svn-id: branches/wasm@48442 -
2021-01-28 12:48:56 +00:00
nickysn
605246ac3c * synchronized with trunk
git-svn-id: branches/wasm@48440 -
2021-01-27 23:54:53 +00:00
florian
706e72e1fd * better error message for runtime errors 202 and 210, resolves #38254
git-svn-id: trunk@48438 -
2021-01-27 21:28:55 +00:00
nickysn
95e0c7ab6e * synchronized with trunk
git-svn-id: branches/wasm@48433 -
2021-01-26 22:52:18 +00:00
pierre
5dbd9eb2e0 Introduce USE_REAL_INSTRUCTIONS to handle expressions not accepted by old assemblers
git-svn-id: trunk@48430 -
2021-01-26 14:50:58 +00:00
nickysn
616db5df68 + compile the strings unit for the wasi target
git-svn-id: branches/wasm@48427 -
2021-01-25 21:17:28 +00:00