Commit Graph

205 Commits

Author SHA1 Message Date
florian
54dccaaad1 * do not crash in case of too many $push directives, resolves #39652 2022-04-07 22:51:30 +02:00
florian
dcb1fcd9b8 + support $lgeacyifend directive, resolves #37676 2021-11-01 23:24:42 +01:00
florian
95ad8f1694 * correctly read the region label in $region directives, resolves #39395 2021-10-28 21:13:01 +02:00
yury
64c586b86d * Removed/ifdefed lots of unused variables.
git-svn-id: trunk@48384 -
2021-01-24 12:24:01 +00:00
florian
0b63068ad2 * dir_push might not flush pending switch changes but has to read the pending
record if needed

git-svn-id: trunk@47660 -
2020-12-01 21:39:38 +00:00
svenbarth
903486642e * allow an integer expression for SetPeFlags and SetPeOptFlags (Delphi compatible)
* adjusted test to check that as well

git-svn-id: trunk@47602 -
2020-11-26 20:13:40 +00:00
Jonas Maebe
e7d1a77f9a * rename the ARM/AArch64-Darwin targets to ARM/AArch64-iOS
* rename the m68k/PowerPC-MacOS targets to m68k/PowerPC-MacOSClassic
  * repurpose the AArch64/Darwin target for AArch64/macOS
   o make AArch64-Darwin default target for a hosted AArch64-Darwin compiler

git-svn-id: trunk@45758 -
2020-07-10 21:52:24 +00:00
Jonas Maebe
8d18c1792e * fixed {$unitpath xxx} directive with absolute paths
git-svn-id: trunk@45424 -
2020-05-18 17:20:13 +00:00
Jonas Maebe
a88eee4080 * fixed unitdir directive for relative paths in case the current module's
path is not set, broken by r43312 (mantis #37095)

git-svn-id: trunk@45410 -
2020-05-17 21:27:00 +00:00
Jonas Maebe
6483b3f5e3 * fixed opt-in sysroot substitution again, renamed the three-argument version
TSearchPathList.AddPath() to AddLibraryPath() to make it clear it's only
    to be used for adding library search paths (and replaced one case where
    it was used for a source file search path with a call to the
    two-argument version)
  * also added some missing '=' prefixes to built-in library search paths,
    and fixed wrong DirectoryExists checks in t_linux in case of using
    a sysroot, cross-compiling or linking on target

git-svn-id: trunk@43312 -
2019-10-26 13:48:30 +00:00
nickysn
31431d99ab * limit the heapsize to 65520 bytes on win16 (the $M directive in win16 only
sets the size of the "local heap", which is limited to a single segment. The
  actual heap in the large memory model is the "global heap", which doesn't have
  a set limit, but grows with the memory allocated)

git-svn-id: trunk@42660 -
2019-08-12 14:24:01 +00:00
nickysn
b7a4965ac3 - suppress the warning that the $D directive is not supported on i8086-win16
git-svn-id: trunk@42632 -
2019-08-10 00:11:45 +00:00
Jonas Maebe
ba1b4b1c92 + support for verifying whether a case statements handles all possibilities
(based on patch by Martok)
   o enabled by default in ISO and Extended Pascal: compile-time error if not
     the case in ISO mode, warning and run-time error in Extended Pascal mode
   o warning enabled by default in all other modes for boolean, enumeration and
     subrange integer types with ranges different from the default ones
     (i.e., different from 0..255, -128..127, 0..65536, etc)
   o warnings for all ordinal types can be enabled in all modes with
     -CC

git-svn-id: trunk@42047 -
2019-05-12 14:29:11 +00:00
Jonas Maebe
0b61b5d4cf * added extra header to ppu inside a subsection, so we won't run into
trouble when the ppu version hits 255
  * also moved several ppu flags to a set inside that section

git-svn-id: trunk@41846 -
2019-04-06 21:28:43 +00:00
florian
3c69f9a066 + basic infrastructure to generate code for floating point exception
checking for CPUs without floating point exception support

git-svn-id: branches/laksen/riscv_new@39637 -
2018-08-19 10:54:45 +00:00
florian
0c6cf12fbf + support for the directive $EXCESSPRECISION
git-svn-id: trunk@39443 -
2018-07-12 21:39:50 +00:00
svenbarth
ff407c56d9 * extend scanning of $modeswitch to support not only + and -, but also ON and OFF like other switches
+ added tests

git-svn-id: trunk@39280 -
2018-06-22 21:29:08 +00:00
svenbarth
be0d51d64c * allow $MinEnumSize, $PackSet and $PackRecords to be used with $Push and $Pop
+ added tests

git-svn-id: trunk@39215 -
2018-06-12 19:40:45 +00:00
florian
7d35ced2d9 + support {$message info ...}, resolves #30654
+ test

git-svn-id: trunk@38346 -
2018-02-25 15:50:58 +00:00
florian
f61b074912 * (re)store alignment when doing a $push/$pop
git-svn-id: trunk@38020 -
2018-01-22 21:06:07 +00:00
svenbarth
9619576515 + add support for $SetPE{OS,SubSys,User}Version directives; Delphi compatible; Note: $SetPEUserVersion takes precedence to $Version
+ added test

git-svn-id: trunk@37364 -
2017-09-30 13:55:29 +00:00
Károly Balogh
95274c1d7b atari: enable apptype directive, and change exe extension when compiling a GUI app
git-svn-id: trunk@35215 -
2016-12-30 10:27:27 +00:00
Károly Balogh
464ecab542 huge syscall support refactor for Amiga-likes. removed large chunks of ancient duplicated code, and in general tried to make the entire thing more maintainable and cleaner. also added support for AROS EAXBase syscall convention
git-svn-id: trunk@34416 -
2016-09-03 07:57:23 +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
svenbarth
d24065c529 Fix compilation of the JEDI package. Old Delphi versions have {$WEAKPACKAGEUNIT} while newer ones also seem to allow {$WEAKPACKAGENUNIT ON}... :/ (analogous for DENYPACKAGEUNIT...)
scanner.pas, tscannerfile:
  + new method readoptionalstate which reads a state like readstate, but if it encounters the closing } then it returns the provided fallback state
scandir.pas:
  + do_moduleflagswitch: new parameter optional that triggers the use of readoptionalstate instead of readstate
  * dir_weakpackageunit & dir_denypackageunit: the ON/OFF is optional

git-svn-id: trunk@33515 -
2016-04-15 14:18:39 +00:00
svenbarth
7d8d0340b9 Merged revision(s) 31988, 31991-31993, 32136, 32308-32309, 32312, 32318 from branches/svenbarth/packages:
Correctly parse the directives DenyPackageUnit and WeakPackageUnit

ppu.pas:
  + add flags uf_packagedeny and uf_packageweak
scandir.pas:
  + new procedure do_moduleflagswitch() which parses a ON/OFF/+/- argument and sets or clears a flag in the current module
  + new procedure dir_denypackageunit which handles DenyPackageUnit
  * implement dir_weakpackageunit (and move to the correct location ;) )
  * InitScannerDirectives: add dir_denypackageunit handler
........
Respect DenyPackageUnit flag.

pmodules.pas, proc_package:
  * check all contained units that are not already part of a package for their uf_package_deny flag and report an error for each that has it set
........
Do not check whether all units are used as by definition all units of a package are considered as used.

pmodules.pas, proc_package:
  - remove call to current_module.allunitsused
........
Check whether a unit has been implicitely imported in a package. A unit is considered as implicitely imported if it is not part of a required package nor part of the units listed in the contains section. This note is useful (Delphi even provides a dialog in that case) as a package with implicitely imported units /might/ become incompatible with other packages (e.g. if another package includes that unit uses that package and includes that unit explicitely; of course that is the same as if both package included it explicitely, but with the hint one knows where to look).

pmodules.pas, proc_package:
  * while walking the loaded units also check whether any of them not contained in a package was part of the contained units which are the same as the current module's used units
........
Generate CRC for package files

pcp.pas, tpcpfile:
  + new field do_crc which controls CRC generation
  + override putdata() method to generate CRC when data is written
  * resetfile: enable do_crc by default
........fppu.pas, tppumodule:
  * loadfrompackage: mention if a unit is loaded from a package
........
fpkg.pas, tcontainedunit:
  + new fields offset and size for the PPU data stored inside the PCP
fpcp.pas, tpcppackage:
  * readcontainedunits & addunit: correctly initialize offset and size to 0
........
Store the modified PPU files directly inside the PCP and thus get finally rid of the .ppl.ppu files.

entfile.pas:
  + new entry type ibpputable
pkgutil.pas:
  * adjust RewritePPU to work on a stream as output instead of a filename
fpcp.pas, tpcppackage:
  + new method writepputable() which writes the offsets and sizes of all contained units (not part of CRC!)
  + new method writeppudata() which rewrites all contained PPUs directly into the PCP after the ibend entry (Note: the data is written 16 Byte aligned to ease viewing of the PCP and its contained PPUs in a hex editor)
  + new method readpputable() which reads the offsets and sizes of all contained units
  + new method getmodulestream() which returns a substream for a contained module
  * loadpcp: also call readpputable()
  * writepcp: first write an empty pputable, then finish writing all data that requires the put*/write* methods of the pcpfile, then use writeppudata() to write all PPUs and finally write the correct pputable at the original location
fppu.pas, tppumodule:
  * loadfrompackage: don't read the PPU from a file if it is contained in a package, but using the new tpcppackage.getmodulestream() and tppumodule.openppustream() methods
pmodules.pas, proc_package:
  * don't rewrite the PPUs here
pcp.pas:
  * increase CurrentPCPVersion
........
Fix cycling

........

git-svn-id: trunk@33514 -
2016-04-15 13:39:41 +00:00
svenbarth
86b9381673 Add new Delphi compatible switch {$G+/-}, {$IMPORTEDDATA ON/OFF} which handles generation of indirect references for cross unit variable accesses if needed for the target.
globtype.pas:
  + tlocalswitch: extend by cs_imported_data
globals.pas:
  * default_settings: cs_imported_data is set by default (Delphi compatible)
switches.pas:
  * turboSwitchTable: G is used for cs_imported_data
scandir.pas:
  + new directive handler dir_importeddata
  * InitScannerDirectives: handle IMPORTEDDATA with dir_importeddata

git-svn-id: trunk@33281 -
2016-03-18 22:04:57 +00:00
nickysn
06b9789928 + implemented a new {$ASMCPU XXX} directive, allowing to specify a different
CPU target for inline assembler blocks. In addition to the different CPUs
  (as listed under 'Supported CPU instruction sets:' in the output of 'fpc -i'),
  it also supports the special values 'ANY' and 'CURRENT'. 'ANY' means no
  restrictions (i.e. all instructions are available). 'CURRENT' means the
  current CPU target (as specified with the '-Cp' command line option). For
  backward compatibility, the default value is 'ANY' for all CPU targets, except
  i8086, where it defaults to 'CURRENT'.

  This directive requires support for the new asd_cpu directive in the assembler
  writer. This is currently implemented only for NASM, but will be supported in
  some of the other assembler writers as well (incl. the x86 internal assembler
  writer).

git-svn-id: trunk@33138 -
2016-02-29 22:25:25 +00:00
nickysn
3a4afab681 * fixed a bug in the $targetswitch directive, which prevented target switches
from being turned off (they were turned on instead)

git-svn-id: trunk@31832 -
2015-09-26 13:36:51 +00:00
Jonas Maebe
2cf8e50771 * fixed unwanted disabling of a codepage set via -FcXXX/{$codepage XXX}
when {$modeswitch systemcodepage} gets disabled without having been
    enabled first (such as when initially setting the syntax mode)
    (mantis #28718)

git-svn-id: trunk@31831 -
2015-09-25 18:31:58 +00:00
Jonas Maebe
0d74e4f719 * changed paratargetdbg from a global variable into a field of toption
git-svn-id: trunk@31443 -
2015-08-28 22:31:17 +00:00
nickysn
7f9fa145e8 + added error message in case the HUGEPOINTERNORMALIZATION directive is used
with an invalid argument

git-svn-id: trunk@28152 -
2014-07-04 17:16:58 +00:00
nickysn
63305cc2e6 + added directive {$HUGEPOINTERARITHMETICNORMALIZATION} to control the
cs_hugeptr_arithmetic_normalization local setting
+ added the cs_hugeptr_comparison_normalization local setting and corresponding
  directive {$HUGEPOINTERCOMPARISONNORMALIZATION} to set it
* the {HUGEPOINTERNORMALIZATION} changed to set both of the huge pointer
  normalization settings, according to the specified compiler type ('BORLANDC',
  'MICROSOFTC' or 'WATCOMC')

git-svn-id: trunk@28151 -
2014-07-04 14:43:46 +00:00
nickysn
a3b48b79cb - rm the scan_w_hugepointernormalization_not_support message, replaced with
scanner_w_directive_ignored_on_target

git-svn-id: trunk@28150 -
2014-07-04 14:03:18 +00:00
nickysn
aee568e6fc * cs_hugeptr_normalization renamed to cs_hugeptr_arithmetic_normalization,
because we're going to also introduce cs_hugeptr_comparison_normalization as
  an independent option

git-svn-id: trunk@28149 -
2014-07-04 13:14:06 +00:00
svenbarth
30be5d8d33 As discussed on core enable the abstract class construction warning by default and also make it controllable with {$warn constructing_abstract ...}.
* scandir.pas, dir_warn: also adjust the message state for type_w_instance_abstract_class if the identifier is CONSTRUCTING_ABSTRACT
* msg/errore.msg: enable type_w_instance_abstract_class by default

* msgidx.inc, msgtxt.inc: updated

git-svn-id: trunk@28137 -
2014-07-02 19:40:22 +00:00
nickysn
b3bb9df19f + added a $HUGEPOINTERNORMALIZATION switch
git-svn-id: trunk@28088 -
2014-06-27 13:56:12 +00:00
nickysn
0d4edf118e + added upper limits to the heapmin and heapmax values set by the $M directive
git-svn-id: trunk@28056 -
2014-06-25 09:33:04 +00:00
nickysn
db011dfb7a + added a warning if HeapMax<HeapMin is specified with the $M directive
git-svn-id: trunk@28042 -
2014-06-24 09:16:03 +00:00
nickysn
1910177cf0 + added heapmax support to the $M directive on i8086-msdos. It is currently
only implemented in the near data memory models. The far data models support
  is still a TODO.

git-svn-id: trunk@28039 -
2014-06-23 20:17:17 +00:00
nickysn
0f5b13d45b * allow setting a heap size of exactly 1024 bytes with the $M directive, since
that's a valid heap size value for the -Ch command line option

git-svn-id: trunk@28026 -
2014-06-21 21:51:27 +00:00
nickysn
82eb84ddff + added warning in case of an $M directive with an invalid stack size specified
git-svn-id: trunk@27964 -
2014-06-15 10:14:56 +00:00
nickysn
c868a5e0ea * check whether the stack size specified in the $M directive exceeds the maximum
stack size
* allow setting a stack size of _exactly_ 1024 bytes with the $M directive

git-svn-id: trunk@27963 -
2014-06-15 09:55:13 +00:00
nickysn
597f110eb9 + added support for units with code larger than 64kb in the far code i8086
memory models. Enabled by the new directive {$hugecode on}. The directive is
  ignored in the near code memory models. When enabled, it forces each procedure
  to be in a separate segment and disables mixing near and far procedures (so
  'near' and {$F-} are ignored in this mode). Note that {$hugecode on} does not
  count as a different memory model, because you can freely link modules (units)
  compiled with {$hugecode on} and {$hugecode off}.

git-svn-id: trunk@27615 -
2014-04-20 19:03:14 +00:00
nickysn
fc6eac6a98 + added $F directive handling, sets cs_force_far_calls (not implemented yet)
git-svn-id: trunk@27560 -
2014-04-13 13:07:18 +00:00
pierre
ca156aa64a Force external linker for nasm smartlinking
git-svn-id: trunk@27512 -
2014-04-10 15:02:04 +00:00
Jonas Maebe
9420a5d7a7 * also check for targets not supporting -gc/checkpointer functionality in
compiler directives, not just on the command line (mantis #25862)

git-svn-id: trunk@27128 -
2014-03-13 20:42:18 +00:00
paul
93883d1264 compiler: load binary unicode mappings in cpavailable() call instead of separate loadbinarycp() call
git-svn-id: trunk@26379 -
2014-01-04 16:42:20 +00:00
paul
52d1cbc544 compiler:
+ add -FM command line option to pass directory for unicode binary files
  + enable dynamic loading of charset files (don't disable runtime charset files for the moment)

git-svn-id: trunk@26378 -
2014-01-04 15:44:18 +00:00
florian
4d5119bf1c * fixes several issues which cause warnings by the dfa code when using it to detect uninitialized variables
git-svn-id: trunk@26161 -
2013-12-01 17:02:08 +00:00