Description: rtl/linux and rtl/unix
This file as text.
(active) Revisions in this set:
51644f497b5a301f39600bb4b799fb3bc606ec73,e949276d9d91fa49e88f014bbb97b8cbf0ea39cd,9c041afc7c11e9d47a1f866e09881237f0817a71
04debba9dea61e81e1b75f3d2254439cd374bebf,31ae109a317d480dec469a000603d82f58d813b7,32121de8aea0dfd64109f73696ed7530285fdbe1
a83bc6263903a51c789545d381bfd86e3ae9f1d9,639adc314f4660859264f647b2b5172847265dcf,5f4a0c7af7b8f605338728aa0274ad1f877e2a75
0100c4abf8df357f5c58e9d70d8b35233e994c51,cb4b085a99c726875ec848162770185a00f388c6,12647c348e57e0a0fe5826705d6e1c2b049e2fe1
fae45b20752f63b270c3d270b0f7588067344802,0a3a35152d74441c8b221e9f19a906a1a091396f,a7a67f3d3c8443304eb268ee78d46d502c1049d0
c8129c52284769ca11e459b405caca11c4f93acc,dc681a75ecdd001fe5f3ce6d245f3c83651e35e5,8e5e8774171802b15e395877621b2c5d13174890
e8ae49012860a2031a52ce2d8ea071c2939f8dc9,bd35c02257c37ef18d28df181583205ce126fa69,c189af0e3d8e1c5293e9b3f0aa11092cd262d976
247f80abfba336b27c28186d9f5fb14abfedfd25,e8b9d8442e43d3e84d2b9b35cb739ac765e48f7e,23111a71ea4316d6b32fe0fc8b0fca1c5960fa97
0e0407ad5793e54afd1046b9933ce1299f17027a,9bd19b050b3b5edce7d6d1cb98c6ec87528e3620,6929da66a87b0185fe1f2d3762a189ed5b44fbf2
3335104da26fd1750f200cbdcbd815a56856b217,3b39ec84e46f32eba0d2d328391f7b67595f8e9a,e7f5b89c2c7cf856951f65c7698f6d2a351852c7
460369405ecbc3200eeaf38350bf8b2e082fd34f,4888c379c433c51d7dfa68adff8d69d785cff9a0,4d25558519f9662785c16ef3717f11e1716c1617
2840e5e1fda6a4d222057f583c6a65cb08a0074d,eb6f503badb9d8f5475ad81f1146466090c98b09,9f60f5093d0754474dfb49550a3842dbbcc431f6
04cbf32b1ba789ff52f5669af195cffddfc39ff3,48cc5250f9c17a1dafa3ecb4ec6b43501d557566,313790502da4de79b8c7b67c1d5e5df59025e923
b49aa071ca8e4d2396afee7a85cdf34695a664d8,277d98431c0aa3a72664b639fcc02124bf870a14,288c7e3c9eeea0b079dafe0f73c98c23426eb968
2b023c62c5bd7877c890a7701b38fd3275d0af93,f316121d53dcb540390ca8fcda64a67e53cf0f17,f80bd9b034171030819d9ff7efb0f45de375c1e4
a36caf90435ae9ebdf620d75efffcbea057c0e07,7ad4694e4bd4f2b369b0599b880ad0b9b3031aca,e154b9933fc030f4f4e894c48c91b026f688f8c0
233d883731ca365b96d9ba4c1e54fa452accab99,7b88d1127ff9e4d011b4ad4cab8dac70e190811f,a33256c1fbd5896ef346b95fb95ef966361afd92
91229dcee9f6b783f7268da54aec3fe416735657,6854f171d1ab1e7bbe3916d29b0e379e21e75f4e,f982317ebd3fbbd180f354b72dad502d8e5f694b
d2b0bcdf1fbc5426b6f4c2331f3ea34cb38f99cc,359bb64aedafca34fee136e053b69a897b9c428a,efe6b32638c26cdd511b8ed35ffa9074817dcf20
83a1f5fbc3f60760e36fa2832648b82690543b45,0055023394e23271b641f9bcfc38606b6b4e4f36,91586331b550f102ee2a90e460807b75177ceb2d
3a0eb110ec513fad178844309b16d66347f7525d,71c314d7d498c6c346f11f5f703272a2307bac1e,5e7a512777b6c1ca9aa544fedcf5c28c7f42b87c
5afa26ddd1e80d78959af421ff64edf756e5ab13,813cf7b45ec3dc7c0b5c4e3fc681ac9026fb56b6,bb97c5ab693b170a31bb7844d2bcff1e809da1f0
b7fe338bbee54f18f2ed4e7bb44883972a5e2fbc,3ac178f519ecb990b425b5bfcc65467f55ef7d0f,a399627aee3c1696a6d34d2005f6577c77f3cefd
d0b1402e103cec251219270215591240103d8bd3,0ed69fc662821756b873ad3bf9e81fd0c26ca9e4,aca327d7873f16e89b3ed89846c1a91b6e2cf0ca
f8c92914c2f33be7a3f53b4278b50792c9c73b13,7baf2461f06eb90429c07950459801e93d286b05,d5b368988f34e631d2e065971713690fb691ebf3
644263277fe49d9be901527f02d8aa0170c840a2,0b2a58027c3171a3ba2962d472653e2f8839e1f2,d42f577a3ff2bd02b6ce709b6c89bf6fc08b32ae
1fce64fa0a780d4b0753eae79c2ae172ca8fb58e,727e25e93eea38a44e493722a9aa74aeb7333f6a,1f328cf362768d56dfe6101661209e6aeffdded5
8c251db2c1bb15d4f9ee8ef84a6998babca199f1,fd83fd5779e5f19373202c57209f648bae072640,0758aa1143a6498532b3d100ed15edd63ca878b6
75c252fd8f754788a4ab2f9ca8da110f6dd6aa86,f1abd2c2f00c69ae25a02df3d06d394c8dfdb546,88ae6721c65e5eb62e16627c6ec9555674c6f04c
6ffa3d4a89adc384b4bcc4459c63b30d1c0d830b,4c2b54ee0d9c3ced0b6ed6d8e9f1535fec82add9,4c529287c66689ee5e750abf4e34acab9d439511
9d6a495c0272124f134dbe93ae0c7f9ee0f09b38,0d0317b3af32e7d366acb8000607a1797fa6c5af,74fdf0692caf78d795585b06078f93310d7ae0cf
b9a1a90d6e737b1132b5e3fbc69e580fc4bf9f1c,bf3ced76b244385edbadeea1c9d2c7c19f48c5a5,6084bb6d09aab6c4f337f0df1ae121f0c7149c7e
a06c034189304457633b01adbc978231674b7498,3e3b96e08878da9b828a3530b0f70bfd2bcf376f,a304962ea04633be422527bbe64c44cf635450b1
0efa4cbc678f8c9fd6baa09eb9386858522bacb4,bcf7701887088598606eca13de251f7d0eab60c7,bad62d51fa1eb41ea7ab811df5b12617abb433a7
2928837225267b3fc95acffe029712c61a6a8c48,f202dda5c5d9c2f8dd82c4d36c376659017eccb4,6ef31c643abc5ce46651ef4f6ddb3ba4ff1e8621
a3a827eba5593f57bae6d0131b18bdd5cd7b071c,fcb5cf42bfd26e076628902778c65f7d6cc3b7ec,512faa71415be47530dff235711c9ea8f49e9a2f
603614e28e22f93723a1e383893cb567eb2840d2,c09e8778bdfc30e9dd669a6ba6d18de952befcaf,bc641cc76be7375eba14e343c300476d5af95f4c
0f0454a0921b31cbf80dc52b83a06f8860d1cd06,25c75b1784d0a0d37337c15810fc7fe462a96bbe,f0b714d5adaa8a660aeaad55d73d6bdbc9805804
3cd2cbcda8d082f06ca29ffd1f22c0f992f19793,c11772decaa00925feb543aac383c01da0ad918b,2cb7e44a1bd86b4a43e7fa777acd8a5d21798d9a
7c9cf75418b9fc60c968820df62a77f162e4d213,774e0f912213dcba17d6f0e0a876d0b243f47df4,9dc75c300538a724d4dcf61b5a9b763dbcedcb7e
654d75b777565fa55c9694c0c67e16e44e8e00ea,9ee2eee293a157ca05a90344feb82518ed7d7ebe,4dc4d2b2ba3d7bc1262e5cb32d2880893c570eef
54dba5738c9fc27c06516b8c74e228ce29fecea5,185a346744c55b0f3e73cfd962e52bcc1c8f68ee,785e259e627992409f323d8851cc8664ce50b1e5
2efb72bedeaa96b6e9b5937619f380e4bea74843,dc5041d778811fc6c940aeb283952caa16ff89b7,40072fb762a25409f793fab0ab453a01c984177c
c3339e9a51ccf3f4e4a3e00f473d985f5ed2d902,e1b2feac33844bdfa75cc45118b9f83df8bf2767,1caa5dfde89e89fbf779a6867dc31784f5b50e45
e80ce5f61f3857db8956c81de525d41b86aa2ed0,c261d5fdeef1a8304f8de9cfefda31f9afca7af6,abb5294b6e9a9caf553211a291f18266daa9d4b6
06eaec4313692b4b7b56939b3e71d56715f79171,b1a47a5d7d2b7ebad337cc6d9b4fd099e4a7dcb9,a4ca9f53572f88115aae5a7e6d84e0811e939c9e
b1c2023af1f7b395a9b204f3fd63a14ff48825bf,7e5d9680c2f4f18349bab94ee03fcb5205c29a41,d2f5bbac508712e27069d377e0bb3c4bc56828a1
d959e47c830cab1f9246e1d2291511c9cd7c4760,8720ab7d3ddf8ae2604fbd4211226272849e5202,dd01c88f94972d054875c6a3fe134ef345420a1c
ad03158349efdbb34d27c806af7316fd681bb15d,3332a7218c37198df28f08f2c210eceb9ff8d1fb,6fda9b58ba275b3305400ce3e9dd922f515566b9
bea570ead89ecb6b08d012b46fa92a8903522e74,fef8e309caf92fb305d6bb142f0a316bc67ba9d2,1d664955b7156d7ea73b5f2c9bc338c0115d6cdb
fcba79e567518fd8de6ac9b18049d3469260f187,2d9377426d6ad9fa5076f4674ad6c883f59ac742,4e920d2c0003d2fc182a66becc349ab791643ac2
c79b677948d22df9dadf8b705acaa21bb12fd4da
Clicking a revision will expand files
* fixes broken compilation after merging
* basic implementation for pure pascal programs to allocate tls space
* disable generic threadvar handling if section thread vars are available
Fix arm-android compilation by prepending syscall_nr_ prefix also to __ARM_NR_XXX arm specific linux syscalls
* properly initialize phdr and phnum
* do not call InitTLS when a compiler is used which does not include the abi tag section
Improve syscall number testing script:
+ Add support for parameters:
-v sets verbose variable to 1
VAR=value gets evaluated.
* moves to rtl/$os if called at diferent level.
+ check if there is a incude directive in sysnr.inc file.
+ Add compilation of C source code with the C variant of the syscall number.
+ Support 32 and 64-bit version of C compilation for systems
allowing 32 and 64-bit executable (like x86_64-linux).
+ Add 'preprocessing' using AWK to test {$ifdef CPUXXX} macro.
+ Add summary at end of script.
* Rename check_syscall_number to check_c_syscall_from_fpc_rtl
* Rename check_syscall_number_reverse to check_c_syscall_in_fpc_rtl
* Try to remove most intermediate files.
+ Generate add_missing_syscalls.inc file if numbers are missing.
Eliminate wrong line (bug report 35441)
* freebsd and openbsd also use sys/syscall.h header
+ Add AWK parser to removed parts of source not concerning current CPU
(only handles CPUXXX like CPUI386)
More improvements to script testing syscall numbers
* Also allow '-' in include file names
+ Add os_cpu and cpu_source variables
* Cope with aarch64 GNU C compiler that does not support -m64 option
+ Add support for arm test on aarch64 machine
* Better accept expressions instead of constants in C #define
Add script to use h2paschk on t_OS.h2paschk file for rtl tests for system header compliance
Add first linux RTL compliance test file t_linux.h2paschk
Also remove -m32 option for arm native GNU C compiler
* Improve handling of command line args setting variables (did not work if it contained spaces)
+ Group all recognized macros into list_defines in preproc.awk file
+ Convert Pascal style hexadecimal constants into C style
Disable 64-bit version of CPU_SOURCE is 32-bit
* properly return from the signal handler on ARM/Linux instead of calling
HandleErrorAddrFrame directly (fixes psabieh exception handling, and
generally is cleaner)
Fix compilation with release 3.0.4 ppcarm
sparc32 bit needs SA_SIGINFO
* improved software floating point exception handling in the rtl
prepare source to also support riscv32 code
Replace obsolete scall by ecall instruction
Add missing and needed syscall_nr_XXX
Add si_XXX.inc files, pointing to riscv64 counterparts
Also use syscall_nr_fstatat for FpStat function for riscv32 cpu
+ Enable FPU exception handling for m68k processor
* get paramstr(0) only if really needed
Examine all exception bits in m68k fpsr register to decide which into which run time error it is converted
* Avoid doing a syscall with a nil parameter in fileexists
+ xtensa-linux: OS specific system unit header files
Use same field type and name as in /ust/include/sys/stat.h
* Use off_t type for l_start and l_end fields instead of kernel_off_t
+ Distinguish rlim_t type depending on fs32bit macro being set or not.
* fix for Mantis
0036895: the new epoll_pwait was missing the size parameter for the sigmask parameter
* fix O_LARGEFILE for Aarch64, RISC-V 32-bit and RISC-V 64-bit
F_GetLk/SetLk have different values for sparc/sparc64
* rename local import of fpc_geteipasebx
* fpc_geteipasebx and fpc_geteipasecx are used as procedures, not functions, so declare them as such
* linux-m68k: depend on FPU defines to compile FPU code, instead of CPU68020. also, minor cosmetics
* linux: fix some formatting in ostypes.inc, no functional change
* linux: use ugetrlimit syscall on m68k for rlimits retrieval. this fixes fpgetrlimit() call, and stack checking on Linux/m68k (tstack.pp test), at least on anything newer than kernel 2.4+ (2001)
* Do_IsDevice treats pipes and sockets the same way as character devices
Do not set __USE_LARGEFILE64 macro for sparc CPU, as it does not seem to be used for regular linux kernels
Add handling of extra parameters, using eval if equal sign is found.
+ Add TMP_DIR variable and use it.
* Only remove temp files if verbose is not set.
Fix typo in script comment
Unix LocalToEpoch: fix typo
* remove the BaseUnix dependency added by mistake
Add some types and records to rtl/linux/t_linux.h2paschk and set macro _LARGEFILE64_SOURCE for __i386__ C code
Correct computation of operatingsystem_parameter_envp, which wrongly pointed to the NIL pointer separating argv from environment variables
* cwstring: try to load the iconv library with .6 suffix as well
* cwstring: open iconv with the transliterate flag instead of setting it later with iconvctl because it may be unavailable
* revert
0047631: cwstring: open iconv with the transliterate flag instead of setting it later with iconvctl because it may be unavailable
* cwstring: open iconv with the transliterate flag if iconvctl is not available
+ linux implementation of System.GetCPUCount
* if the Linux target is compiled with FPC_USE_LIBC the initialization of TLS is not required (according to one comment by Florian), so disable all related code in that case (as for example the syscall numbers are not available then)
+ add declaration of FpSchedGetAffinity when the Linux target is compiled with FPC_USE_LIBC
Also set __stkptr inside cprt0.as startup assembly source
Also set __stkptr inside cprt0.as and dllprt0.as startup assembly sources
* x86_64-linux: assembler helpers syscalls do not need a stackframe
* FPC_VERSION => FPC_FULLVERSION
* another FPC_VERSION => FPC_FULLVERSIOn fix
* switch back to 32 Bit mode if no thumb code is generated
* arm-linux: sighnd.inc must check for CPUTHUMB and CPUTHUMB2
* fix compilation for CPUs without thumb
o RiscV64 glibc startup code fixed:
* there is no _init/_fini, call libc_csu_* instead
* fix loading of global_pointer
+ RiscV: set threadvarblocksize
* sanity check if threadvarblocksize is really set
* mips and xtensa compilation fixed
* RiscV: corrected setup of gp
+ RiscV: initial implementation of gprof support
* cleanup
* fix for Mantis
0037252: apply patch by Bi0T1N to implement TThread.NameThreadForDebugging for Mac OS X 10.6 and newer (older versions don't provide the required functions)
Fix compilation with 3.2.2 release for arm and i386 CPUs
+ added baud rate constants for arm as proposed by Piotr Kardasz in
0039101
* check paramstr argument for negative values, resolves
gitlab 0039410
LLVM: add Read/WritePort* implementations
Fixes Unix graph compilation on x86 with LLVM
* clean up of assembler files not used anymore
* powerpc64-linux: unused assembler loader files removed
+ additional skeleton files for mips64
Disable range and overflow checks inside detect_linuxvcs procedure
* make __lib_csu* weak symbols on m68k-linux
Darwin: use recent versions of stat(fs) records when available
When the RTL is built for Mac OS X 10.6 or newer, use the new versions
and the corresponding alternate system library functions.
Also extracted the Darwin stat record definition to reduce the
ifdef hell.
Darwin: fix compilation on macOS/AArch64 after 1f328cf3
No function suffixes there since there's no backward compatibility issue.
m68k-linux: try to be as ColdFire compatible in the startup code as possible, so explicitly use jsr, otherwise this might compile to a long bsr, that is not CF compatible (except cfv4)
FPU exception mask: generlised system unit interface
* Extra linux fcntl constants
Linux: fix pthread types
Remove legacy implementation-specific fields (they don't match the current
glibc fields anymore since a long time) and fix alignment fields (they are
union fields that overlap with the rest of the record).
All platforms now use the modern opaque array-based definitions.
Linux mutex: restored the __m_kind field
This particular field is at the same offset on all architectures with the same
bit width, and is guaranteed by glibc to remain at this offset for backward
compatibility with static initialisers.
Resolves
gitlab 0040021
* Remove use of internal conversion routines
* Some forgotten string -> shortstring instances
* cleanup of outdated defines
* fix of Erroneous reading of the value of the StackLength variable at program start based on issue report by Sergey Larin, resolves
gitlab 0040211
Try to implement linux si_uc.inc for xtensa CPU
Attempt to use local _init and _fini procedures
Support use statx syscall in fpstat and fpfstat
fix when FPC_USE_LIBC is disabled not call PASCALMAIN
fix store stacklength but not its addr in info
Use prlimit64 in FpSetRLimit and FpSetRLimit
Set STACK_MARGIN_MAX to four times of pagesize on LoongArch64
It fixed a test named tstack. Actually, Linux user get the stacktop is
incorrect in current. The value of stack pointer when enter the procedure
is thought as it is in the highest stack page. But if the parameters is
enough large, lager than 16k, most of arch will also fail this test.
Since the LoongArch default pagesize is 16k, it fail often because
stack-layout-randomization causes the stackpointer underflow to next page.
I had tried fixed it in rtl/linux/[arch]/si_*. But because the codes is
unworthy and hardly the parameters is enough large, just expand
STACK_MARGIN_MAX for simplicity.
* Fix for i386 breakage after merge request !433
Restore usage of fpexecve function inside ExecuteProcess
as set by commit 305d34a8f6f
Adapt USE_STATX code to FPC_DOTTEDUNITS
* Small improvement in inittls. Fixes issue 40408
Use frame register $r22 (aliased as $fp) inside SignalToRunerror for loongarch64 CPU to fix backtrace dumps
Modify references to old syslinux unit in comments
* Ensure null-terminated strings. Patch by modersohn, fixes issue
gitlab 0040499
* Add pthread_mutex_timedlock, sem_timedwait may be needed in future
* GetEpochTime (not used though it seems) should return time_t
* ensure that the SysCall unit is also usable when FPC_USE_LIBC is defined
Fix compilation of syscall unit for Linux with -dFPC_USE_LIBC option
Fix syscall unit compilation for i386-linux using -dFPC_USE_LIBC
+ support for fputimens on non-linux OSes
* reworked fputimens support on linux
+ FileSetDate for all unix OSes
Avoid double declaration of seterrno
* fix bootstrapping with with 3.2.2 and -dFPC_USE_LIBC
* fix utimensat and utimensat if the rtl is compiled with -dFPC_USE_LIBC
* use TTimespecArr instead of tkernel_timespecs in sysutils
* cleaned up TTimespecArr declarations
* fix darwin compilation after TTimespecArr changes
* compilation on linux with FPC_USE_LIBC fixed
Use call to seterrno function inside FpSysCall functions for powerpc cpu on linux OS
* fix compilation for mipsel-android (hopefully)
* Prevent file handle leak
* Set monitor structures in place
Re-implement (for debugging purposes) buildrtl.pp unit for Linux OS (not used in regular RTL compilation)
* Allow to disable monitor
Fix reading past the end of the string in Unix.FSearch.
Add CC_OPT for riscv processors
* Fix compilation under unicode rtl
Use '__global_pointer$' special linker symbol to set gp,
because its value can be different from __BSS_END__ - 0x800.
Details from binutils-2.40/ld/emulparams/elf32lriscv-defs.sh
// We must cover as much of sdata as possible if it exists. If sdata+bss is
// smaller than 0x1000 then we should start from bss end to cover as much of
// the program as possible. But we can't allow gp to cover any of rodata, as
// the address of variables in rodata may change during relaxation, so we start
// from data in that case.
OTHER_END_SYMBOLS="${CREATE_SHLIB-__BSS_END__ = .;
__global_pointer$ = MIN(__SDATA_BEGIN__ + 0x800,
MAX(__DATA_BEGIN__ + 0x800, __BSS_END__ - 0x800));}"
* upated syscalls
+ RiscV specific syscalls added
+ support for RiscV hwprobe syscall
+ test
Fix compilation of riscvXX-linux targets with -dFPC_USE_LIBC
Riscv64 linux also needs _STAT_VER_LINUX to be zero for correct libc rtl behavior
Fix _FPC_xtensa_exit first parameter passing
* fix rlim_t for i386 and other 32 bit CPUs supporting 64 bit fs calls
Avoid range check error in FindGetFileInfo function on AIX OS and change type of local variable LinAttr to match argument type of fpS_ISDIR function
+ constants for more RiscV extensions added
* Add intrinsics unit for ARM platforms
Replace unused AARCH macro by AARCH64
Only add intrinsics unit dependency for trunk branch
Add intrinsics unit dependency for powerpc and powerpc64 CPUs
* Correct some fixes of typos
Use '$if declared(fpfutimens)' to set USE_FUTIMES macro
* Faster (and correct) TThread.GetSystemTimes. Fixes issue
gitlab 0040597