Commit Graph

323 Commits

Author SHA1 Message Date
marco
7ef8f00100 * more occured -> occurred spelling fixes.
git-svn-id: trunk@35130 -
2016-12-14 20:05:21 +00:00
Jonas Maebe
11c90a73b1 - removed "Set8087CW(Default8087CW)" call from SysEntry:
o it is already performed in fpc_cpucodeinit
   o in libraries, fpc_cpucodeinit first sets Default8087CW to the current x87
     control word to avoid them enabling fpu exceptions if the host platform
     had first disabled them

git-svn-id: trunk@33993 -
2016-06-15 18:32:07 +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
marco
9c03d0d6ba * fix for mantis #25931 return error 5 on EBUSY and ENOTDIR
git-svn-id: trunk@33262 -
2016-03-17 21:14:07 +00:00
svenbarth
191a293e4a Fix compilation of Mac OS X. Without the cdecl modifier we need the _
rtl/bsd/system.pp:
  * use _PASCALMAIN instead of PASCALMAIN

git-svn-id: trunk@33034 -
2016-01-30 19:38:40 +00:00
svenbarth
b525cecad8 - get rid of the calling convention modifier for PascalMain as it's generated using the default calling convention anyway (without any parameters this luckily doesn't matter that much ;) )
(Note: adjusted merge info as in my packages branch there is a less complete commit for this)

git-svn-id: trunk@33023 -
2016-01-29 14:51:15 +00:00
Jonas Maebe
f8f03ac4ad * fixed dirent handling for DragonFly BSD (patch by John Marino,
mantis #29228)

git-svn-id: trunk@32706 -
2015-12-24 10:54:47 +00:00
pierre
f08fa883e2 Pipe syscall for DragonFly also uses EAX:EDX for result, like FreeBSD
git-svn-id: trunk@31209 -
2015-07-14 21:58:27 +00:00
Jonas Maebe
5a8959381c + Darwin/AArch64 support
git-svn-id: trunk@29934 -
2015-02-23 22:53:50 +00:00
svenbarth
2d454dc8fa Move DynLibs support to System unit using a manager approach like for Threads, WideStrings, etc.. This is needed so that we can support features like "delayed" and loading of dynamic packages.
Each port that allows the usage of dynamic libraries should call InitSystemDynLibs during initialization of the System unit.
The DynLibs unit has been adjusted to be a forwarder for the functions that now reside in the System unit (for backwards compatiblity just in case). Additionally the unit will register the DynLibsManager if it doesn't reside in the System unit anyway.
Currently only the Windows targets (Win32, Win64 and WinCE) implement the DynLibsManager inside the System unit. For other systems using the LoadLibrary, etc. functions will lead to a run error/exception.
If a port wants to implement its own DynLibsManager then it needs to define DISABLE_NO_DYNLIBS_MANAGER. TLibHandle, NilHandle and optionally TOrdinalEntry (it's set to SizeUInt otherwise) should be defined in sysdlh.inc which needs to be enabled using the define FPC_SYSTEM_HAS_SYSDLH (because there are targets which have FEATURE_DYNLIBS enabled, but don't support them... e.g. powerpc-wii -.-).
The DynLibsManager contains methods for loading a library based on a RawByteString and based on a UnicodeString. BOTH should be implemented, but internally one can forward to the other.
The loading by ordinal *can* be be implemented. If it is set to Nil then the implementation of GetProcAddress(lib,ordinal) will return Nil.

+ new functions SetDynLibsManager and GetDynLibsManager to set and retrieve the current DynLibsManager
* provide interface of DynLibs unit in unit System

git-svn-id: trunk@29613 -
2015-02-03 20:00:00 +00:00
marco
2578514853 * first dragonfly patch (existing most). Mantis #27091
git-svn-id: trunk@29213 -
2014-12-07 20:27:02 +00:00
pierre
7ffca97a68 OpenBSD support for OS version specific syscall numbers
git-svn-id: trunk@29136 -
2014-11-23 21:59:25 +00:00
sergei
3a5e6485b5 - RTL: removed InitVariantManager, it was an empty procedure since day 1.
git-svn-id: trunk@29114 -
2014-11-22 20:35:46 +00:00
pierre
72a0dfecf0 Add code to includee new file to handle changing openbsd syscall numbers
git-svn-id: trunk@28830 -
2014-10-15 23:27:59 +00:00
marco
c4d8a4c5f2 * Stat file patches from OpenBSD ports tree.
git-svn-id: trunk@28739 -
2014-10-04 11:25:45 +00:00
marco
bcd13a856d * Some convenience permission constants, patch by Graeme #26373
git-svn-id: trunk@28038 -
2014-06-23 15:35:43 +00:00
sergei
2f8a1706e6 * x86_64-*bsd: cleaned out handwritten assembler threadvar access from syscall code.
git-svn-id: trunk@27793 -
2014-05-15 16:29:50 +00:00
sergei
7e4b98e735 * i386-*bsd: cleaned out handwritten assembler threadvar access from syscall code.
git-svn-id: trunk@27679 -
2014-04-28 06:21:54 +00:00
marco
a818559481 * clocale moved to rtl-extra.
git-svn-id: trunk@27376 -
2014-03-30 15:27:35 +00:00
marco
d6f5ca21b9 * moved units ipc for *BSD, darwin/iphonesim and linux. The others are
makefile cleanups.

git-svn-id: trunk@27373 -
2014-03-30 13:13:13 +00:00
sergei
9801288cdc * Removed SysInitFPU/SysResetFPU from (remaining) system units initialization code. It is redundant there because it is called from fpc_cpuinit, or, in case of i386, from fpc_cpucodeinit.
* It fixes regression of tw16283b after r27169. 
* BeOS, Haiku: added fpc_cpucodeinit to compensate for removal of SysInitFPU, it also enables use of CPU features like SSE.

git-svn-id: trunk@27171 -
2014-03-17 10:53:52 +00:00
pierre
8a0dccf590 NetBSD getcwd system call also returns string length
git-svn-id: trunk@25661 -
2013-10-05 21:23:47 +00:00
Jonas Maebe
81597bf171 * updated address of FSF (mantis #24646, patch by Alexey Svistunov)
git-svn-id: trunk@24986 -
2013-06-27 14:01:18 +00:00
marco
9554eb2b48 * some O_ constants. Patch by Barlone.
git-svn-id: trunk@24536 -
2013-05-20 15:30:40 +00:00
yury
2b2a68446d * Added new unit unixcp. It contains stuff from winiconv.inc - a table to map Windows code page identifiers to locale names on unix. Also GetSystemCodePage function in this unit can be used to detect which code page is used currently.
* Build unixcp for all unix-like systems.
* Use the unixcp unit in cwstring instead of winiconv.inc.
- Deleted winiconv.inc
- Reverted r22410,r22411,r22428. The compiler will use the unixcp unit to get a default code page for ansistrings.

git-svn-id: trunk@23670 -
2013-02-28 18:21:28 +00:00
Jonas Maebe
69c29a415f * pass the procdef to getintparaloc instead of only the proccalloption, so
that the type of the parameters can be determined automatically
   o added compilerproc declarations for all helpers called in the compiler
     via their assembler name, so we can look up the corresponding procdef

git-svn-id: trunk@23325 -
2013-01-06 15:05:40 +00:00
Jonas Maebe
5f3d762788 * when the stack size is overestimated so much that it's larger than the
stack pointer (can happen for externally started threads), truncate it
    to a legal value (should stop crashes when enabling stack checking on
    iOS 6)

git-svn-id: trunk@23320 -
2013-01-06 15:05:16 +00:00
pierre
7457a0f321 Use new getdirentriesi49 syscall, contributed by Pascal Stumpf
git-svn-id: trunk@23223 -
2012-12-26 14:33:30 +00:00
pierre
bba4932ef9 * Fix commit 23220, by moving declaration from syscallh.inc to syscall.inc
git-svn-id: trunk@23221 -
2012-12-25 22:54:49 +00:00
pierre
70a29668a4 Try to fix simply the fpc_threadvar_relocate_proc problem
git-svn-id: trunk@23220 -
2012-12-24 16:23:30 +00:00
paul
d7d8c10aaf bsd: set DefaultSystemCodePage without cwstring.pas
git-svn-id: trunk@22410 -
2012-09-17 02:33:06 +00:00
marco
1a895a875b * move fpgetenv(pchar) to unit system for syscall based *nix rtls.
It was already available for libc based *nix rtls

git-svn-id: trunk@22365 -
2012-09-10 09:21:56 +00:00
Jonas Maebe
c71cb9dc69 * fixed null termination of cmdline (based on patch by C Western,
mantis #22742) -- that function seems like a good candidate to
    put in a shared include file though

git-svn-id: trunk@22270 -
2012-08-30 21:30:31 +00:00
pierre
23f21254bd + Add USE_SIGACTION_SIGTRAMP
git-svn-id: trunk@21027 -
2012-04-24 23:03:08 +00:00
pierre
e3aabfec79 * OpenBSD uses a special sigprocmask syscall
git-svn-id: trunk@20900 -
2012-04-16 15:43:44 +00:00
pierre
2d130d20e7 + Add forward declaration of InstallDefaultSignalHandler for use inside sighnd.inc
git-svn-id: trunk@20782 -
2012-04-11 12:56:11 +00:00
pierre
db3346994c * Use correct sign extension for FPC_DOSYS1w
git-svn-id: trunk@20775 -
2012-04-09 21:57:13 +00:00
pierre
b98529673c Explicitly set fpSigAction return value
git-svn-id: trunk@20774 -
2012-04-09 21:56:02 +00:00
pierre
78e129931b Add NETBSD_USE_STAT30 conditional for recent NetBSD changes, not yet used
git-svn-id: trunk@20741 -
2012-04-07 15:37:03 +00:00
pierre
67bc3c0e0b st_mode is before st_ino for NetBSD in stat record
git-svn-id: trunk@20737 -
2012-04-06 23:55:57 +00:00
pierre
981ec54226 NetBSD code added
git-svn-id: trunk@20338 -
2012-02-13 16:44:23 +00:00
Jonas Maebe
aefe5acd72 - removed "packed" modifiers from record types, the C versions don't have any
__attribute__((__packed__)) either (and {$packrecords c} is always active
    when compiling this file)

git-svn-id: trunk@19612 -
2011-11-08 22:04:36 +00:00
Jonas Maebe
c7d38570fd * fixed file descriptor control and locking flags (patch by Barlone,
bug #20617)

git-svn-id: trunk@19611 -
2011-11-08 21:44:49 +00:00
pierre
3f4dd5ac9b * Fix parameter type for sigsuspend syscall for OpenBSD
git-svn-id: trunk@19609 -
2011-11-08 17:01:02 +00:00
paul
1ccf16358c rtl: init widestring and unitcodestring managers before initialization of Standard IO files (stdin,stdout,stderr)
git-svn-id: trunk@19542 -
2011-10-25 02:29:29 +00:00
pierre
216113e80d Fix compilation error introduced in my last patch for non-openbsd systems
git-svn-id: trunk@19468 -
2011-10-11 23:07:20 +00:00
marco
199f7535b4 * fix pipe call for openbsd. fpmake now seems to work.
git-svn-id: trunk@19440 -
2011-10-09 19:34:21 +00:00
pierre
a6280de177 * Fix getdirentries problem for openbsd
git-svn-id: trunk@19418 -
2011-10-08 16:46:38 +00:00