Commit Graph

48754 Commits

Author SHA1 Message Date
nickysn
cb5a2b9a2e + enable the i8086-embedded cpu/os combination in fpmkunit as well
git-svn-id: trunk@34001 -
2016-06-17 21:55:38 +00:00
nickysn
2dc530dfe3 + enable the i8086-embedded cpu/os combination in fpcmake
git-svn-id: trunk@34000 -
2016-06-17 20:24:55 +00:00
nickysn
c2305809dc + added an i8086-embedded target support to the compiler (RTL and makefile
support are not done yet)

git-svn-id: trunk@33999 -
2016-06-17 19:15:24 +00:00
michael
e022ba1b53 * Annotations (and HTML links) support
git-svn-id: trunk@33998 -
2016-06-16 20:14:20 +00:00
florian
d31d24ed16 * r33995 was not complete
git-svn-id: trunk@33997 -
2016-06-16 19:26:43 +00:00
svenbarth
dfe00a8ed1 Fix for Mantis #30279. Apply patch by Max Nazhalov to fix compilation of i386-wince and arm-wince (the only modification is that the no longer used AnsiString variants of ExecuteProcess are removed)
git-svn-id: trunk@33996 -
2016-06-16 17:03:17 +00:00
florian
1cbae41cab * proper fix for the issue detected in r33945
git-svn-id: trunk@33995 -
2016-06-15 20:43:52 +00:00
svenbarth
248490bbf1 * declare fpc_zeromem and fpc_fillmem as inline to avoid one call
git-svn-id: trunk@33994 -
2016-06-15 20:16:16 +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
Jonas Maebe
899add8c7d * don't emit default values for local variables in generic routines: those
default values are not used, and they are not type-correct (and hence
    cause trouble with LLVM)

git-svn-id: trunk@33992 -
2016-06-15 18:32:02 +00:00
Jonas Maebe
5313db710b * override gen_stack_check_size_para() and gen_stack_check_call()
for llvm and do nothing (see comments in the code)

git-svn-id: trunk@33991 -
2016-06-15 18:31:58 +00:00
Jonas Maebe
98ac6c4797 * converted gen_stack_check_call() to the high level code generator
git-svn-id: trunk@33990 -
2016-06-15 18:31:52 +00:00
Jonas Maebe
4121facc7a * only free the llvm shadow symtable when the original symtable will
also be freed

git-svn-id: trunk@33989 -
2016-06-15 18:31:47 +00:00
Jonas Maebe
8ca9ece66a * fixed buffer overrun in tai_aggregatetypedconst.add_to_string()
git-svn-id: trunk@33988 -
2016-06-15 18:31:42 +00:00
Jonas Maebe
8c006f04e2 * don't check type size equality for conversions to formaldef either
git-svn-id: trunk@33987 -
2016-06-15 18:31:37 +00:00
michael
15c5ea3b9c * Fix bug in event-based variables
git-svn-id: trunk@33986 -
2016-06-14 17:25:14 +00:00
svenbarth
638339812e i386-win32 also has indirect entry information, so enable this in the compiler and disable the corresponding define in system.pp
git-svn-id: trunk@33985 -
2016-06-14 12:25:21 +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
pierre
a72434e93a Trial to clarify heap for i8086 issues:
- MSDOS heap in tinyheap.inc modified to use usual
  SysGetMem and similar names.
  - Use HAS_MEMORYMANAGER (used previously in wince source code,
  to specify that a memory manager is defined elsewhere than inside
  heap.inc include file.
  - Use
  - Remove TinyHeapMemoryManager Structure variable completely

  heaptrc.pp: remove unneeded macro code after name changes of tinyheap.inc

  msdos/system.pp now only defines HAS_MEMORYMANAGER macro
  win16/system.pp defines HAS_MEMORYMANAGER and FPC_NO_DEFAULT_HEAP
  as it still uses a different memory manager.
  __stkbottom variable added for win16 system.pp as it is required
  by i8086 specific stack check code.

git-svn-id: trunk@33983 -
2016-06-13 22:26:03 +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
nickysn
452d9b747b * fixed code generation for initialized pointer variables, with the initial
value set to the address of an external variable in the i8086 medium and
  compact memory models. Should fix Mantis #30107

git-svn-id: trunk@33981 -
2016-06-13 00:29:32 +00:00
Jonas Maebe
3f01efbee0 * adapted tcgtypeconvnode.second_int_to_int() to work with high level cpu
targets, and removed the (buggy) LLVM-specific version

git-svn-id: trunk@33980 -
2016-06-12 20:56:40 +00:00
Jonas Maebe
2d1023140a * don't try to check whether the size of from and to in type conversion nodes
are the same in case of open arrays (their size can't be determined at
    compile time) -- this is just a sanity check, which can't be performed in
    this case

git-svn-id: trunk@33979 -
2016-06-12 20:56:37 +00:00
Jonas Maebe
e521a029b1 * fixed fpcmake Makefile
git-svn-id: trunk@33978 -
2016-06-12 20:56:35 +00:00
marco
bb75790e38 * german error file updates mantis #30024
git-svn-id: trunk@33977 -
2016-06-12 20:37:17 +00:00
svenbarth
f606d0d2ec Fix for Mantis #29051 to add the ability to only load the core profiles of OpenGL.
git-svn-id: trunk@33971 -
2016-06-12 17:22:46 +00:00
svenbarth
266eccde9f Merge revision(s) 32484 from branches/svenbarth/packages
Move PascalMain external from the si_*.inc files to a new include file si_impl.inc that's included in the implementation sections of the si_*.pp units

git-svn-id: trunk@33970 -
2016-06-12 16:49:56 +00:00
svenbarth
bb853d135c Fix compilation after r33958.
git-svn-id: trunk@33969 -
2016-06-12 16:06:48 +00:00
svenbarth
e527b6fe4f psub.pas, read_proc:
* always register implementation-only, public routines as they might only be called from other units using an external declaration

git-svn-id: trunk@33967 -
2016-06-12 13:47:08 +00:00
svenbarth
a4cfa64d96 pkgutil.pas, insert_export:
* only export the symbol name with the indirect suffix (on Windows the indirect ones will be generated in the module that does the importing on other system's they're not needed anyway)

git-svn-id: trunk@33966 -
2016-06-12 12:50:20 +00:00
svenbarth
22b0553be3 Fix PPUDump on PowerPC systems
compiler/utils/ppuutils/ppudump, readdefinitions:
  * with the move of most target specific PPU data into the target specific sym types the location of the library symbol for the Amiga-like systems has changed

git-svn-id: trunk@33965 -
2016-06-12 12:11:28 +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
fa4690eef8 Don't try to export generics.
pkgutil.pas, exportabstractrecorddef:
  * if it's a generic then leave before iterating the nested types

git-svn-id: trunk@33963 -
2016-06-12 09:25:22 +00:00
Jonas Maebe
580cf73e64 * align the variables passed to InterlockedCompareExchange128() to a
multiple of 16 bytes

git-svn-id: trunk@33962 -
2016-06-12 09:21:08 +00:00
Jonas Maebe
cef5cac4fa * converted tcgvecnode.rangecheck_string to the high level code generator
git-svn-id: trunk@33961 -
2016-06-12 09:21:05 +00:00
Jonas Maebe
68d9eb89a2 * skip static fields while constructing the LLVM shadow symtable for structs
git-svn-id: trunk@33960 -
2016-06-12 09:21:03 +00:00
Jonas Maebe
22c31ca004 * fixed LLVM vecn typed constant evaluation if the lower bound is <> 0
git-svn-id: trunk@33959 -
2016-06-12 09:21:00 +00:00
Jonas Maebe
b8ed0fac5d * give an error when trying to get the address of an element of a dynamic
string in a typed constant, like Delphi (instead of generating a bogus
    address)

git-svn-id: trunk@33958 -
2016-06-12 09:20:57 +00:00
Jonas Maebe
8bc39ba7a3 * fixed bitpacked array index calculation for llvm: the element bitsize was
only used for masking out the bits of the loaded data, not for calculating
    the offset

git-svn-id: trunk@33957 -
2016-06-12 09:20:54 +00:00
Jonas Maebe
14ab43626f * don't write initialisation values for AB_EXTERNAL_INDIRECT
git-svn-id: trunk@33956 -
2016-06-12 09:20:51 +00:00
Jonas Maebe
728efedcf3 * fixed sysinit unit dependencies
git-svn-id: trunk@33955 -
2016-06-12 09:20:46 +00:00
svenbarth
18e6ea0ec8 Fix compilation by fixing typo -.-
git-svn-id: trunk@33954 -
2016-06-12 09:18:26 +00:00
svenbarth
614c4f47a6 Add two more defines related to packages:
* FPC_HAS_DYNAMIC_PACKAGES is set if the target does support dynamic packages (currently none, but soon(TM) that should be i386-win32, {i386,x86_64}-linux and all darwin systems)
* FPC_HAS_INDIRECT_VAR_ACCESS is set if assembler code should assume that variables from another unit are accessed indirectly (thus different assembler code should be used)

git-svn-id: trunk@33953 -
2016-06-12 09:14:51 +00:00
svenbarth
ca07a4f86f Merged revision(s) 32491-32492 from branches/svenbarth/packages:
Adjust non-Windows resources to work with indirect main information as well.

rtl/inc/systemh.inc, TEntryInformation:
  + new cross platform field ResLocation which stores the pointer to the resources
rtl/inc/intres.inc:
  * change the type of ResHeader from PResHdr to PPResHdr (and adjust code that uses it accordingly; Note: the first dereferencing is assumed to be always valid!)
  * adjust declaration of ResHeader depending on whether indirect main information is used or not
rtl/darwin/sysinit.pas & rtl/linux/si_impl.inc:
  * pass the location of the resources through SysInitEntryInformation
rtl/bsd/system.pp & rtl/linux/system.pp:
  + new public variable FPCResLocation which is setup by SysEntry
rtl/win32/sysinit.inc:
  * initialize ResLocation of SysInitEntryInformation as Nil
rtl/win32/system.pp:
  * initialize ResLocation of EntryInformation as Nil
........
For systems that support both internal and external resources (in this case only Darwin ones) we need to generate the FPC_RESLOCATION symbol always, because the SysInit unit is resource type agnostic.

ngenutil.pas, tnodeutils:
  * InsertResourceInfo: generate FPC_RESLOCATION symbol pointing to 0 in case the program is compiled on Darwin with resources set to external ones (-We)

git-svn-id: trunk@33952 -
2016-06-12 09:08:17 +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
florian
2890927b10 * MovMov2MovMov1 requires that the allocation of the first register is extended
git-svn-id: trunk@33948 -
2016-06-11 19:54:18 +00:00
michael
56d3909dea * Added event-based fetching of variables
git-svn-id: trunk@33947 -
2016-06-11 17:07:32 +00:00
nickysn
c205cb03c8 * in SysUtils.DecodeDate(), cast the result of trunc() to longint (trunc
normally returns int64 in FPC), before performing any further calculations -
  the result always fits in a longint (the date is range checked against
  MaxDateTime and that is well within longint limits). This generates faster
  code on non 64-bit targets and also fixes i8086 compilation, which previously
  failed on register allocation on this function.

git-svn-id: trunk@33946 -
2016-06-10 19:39:44 +00:00