Commit Graph

921 Commits

Author SHA1 Message Date
svenbarth
921e73ab0c + add compiler support for the Z80 MSX-DOS target
git-svn-id: trunk@45596 -
2020-06-06 17:16:20 +00:00
nickysn
f5489b5678 + allow specifying the program load address for the ZX Spectrum target via the -WB option
git-svn-id: trunk@45581 -
2020-06-03 20:09:27 +00:00
florian
a4695a7015 * xtensa-embedded: fix setting of the fpu and abi
git-svn-id: trunk@45270 -
2020-05-05 20:41:36 +00:00
pierre
1b5ee0d063 * Put all code adding cs_fp_emulation by default inside one big
{$ifdef cpufpemu}
  * Add system_arm_freertos and system_xtena_linux to the list
    of systems that automatically add cs_fp_emulation to 
    init_settings.moduleswitches.
  + Do not use controller specfic default fputype for xtensa-linux 
    target that does not support use of -Wp option to set controller type.

git-svn-id: trunk@45265 -
2020-05-05 12:20:21 +00:00
nickysn
caecdfd51d + allow setting the heap size for the ZX Spectrum target
git-svn-id: branches/z80@45102 -
2020-04-26 14:58:47 +00:00
nickysn
4c5f095422 + reenabled fileio and textio, because consoleio doesn't seem to work without them
git-svn-id: branches/z80@45029 -
2020-04-23 02:55:08 +00:00
nickysn
3f62fb7fe7 + enabled FPU emulation for the Z80
git-svn-id: branches/z80@45007 -
2020-04-22 22:18:33 +00:00
nickysn
86643f8a34 * synchronized with trunk
git-svn-id: branches/z80@44981 -
2020-04-21 23:36:44 +00:00
svenbarth
3af74d2fd2 + implement initial compiler support for Win64 on Aarch64
git-svn-id: trunk@44914 -
2020-04-21 06:04:22 +00:00
nickysn
e261ea8e2b - disable some rtl/compiler features on the ZX Spectrum
git-svn-id: branches/z80@44909 -
2020-04-21 03:03:06 +00:00
nickysn
2f68090dd6 * synchronized with trunk
git-svn-id: branches/z80@44898 -
2020-04-20 22:42:08 +00:00
florian
8ac8c79a71 + initial support for arm-freertos largely based on patch by Michael Ring
git-svn-id: trunk@44871 -
2020-04-19 20:59:52 +00:00
nickysn
d2c32efb7b * synchronized with trunk
git-svn-id: branches/z80@44809 -
2020-04-18 23:47:30 +00:00
Jonas Maebe
ea2e516b4e + -ib parameter to print the code generator backend type: FPC or LLVM
* some cleanups related to -i printing

git-svn-id: trunk@44787 -
2020-04-18 15:44:42 +00:00
nickysn
b2549b63cd * implemented pop_parasize for the Z80 and declared stdcall to be a clearstack pocall on this arch
git-svn-id: branches/z80@44629 -
2020-04-07 00:07:34 +00:00
nickysn
50e5b07568 * synchronize with trunk
git-svn-id: branches/z80@44503 -
2020-04-01 22:43:55 +00:00
florian
ba9e930556 * Xtensa: set fpu type dependending on the controller
git-svn-id: trunk@44495 -
2020-04-01 20:08:23 +00:00
nickysn
a581ca4dce * synchronized with trunk
git-svn-id: branches/z80@44474 -
2020-03-31 22:00:40 +00:00
florian
5ef1ede0a4 * xtensa-freertos: enable softfloat for now
git-svn-id: trunk@44463 -
2020-03-31 19:33:11 +00:00
nickysn
e0efce2dd8 + added Z80-specific help messages, using the Z identifier
+ added help about the available Z80 assemblers

git-svn-id: branches/z80@44460 -
2020-03-31 19:32:17 +00:00
nickysn
3e3942e324 * synchronize with trunk
git-svn-id: branches/z80@44458 -
2020-03-31 19:18:42 +00:00
Károly Balogh
8bdcf4273d * darwin: remove some leftover resource-spec structures from i_bsd, clean up some related darwin specific int/ext resource handling in options
git-svn-id: trunk@44455 -
2020-03-31 04:57:08 +00:00
nickysn
6e346f1c79 * synchronize with trunk
git-svn-id: branches/z80@44444 -
2020-03-30 22:36:17 +00:00
Jonas Maebe
79974a9671 + -XlS<x> option to specify a suffix for externally called LLVM utilities,
e.g. -XlS-7 to call clang-7 instead of clang)
  * IMPORTANT: changed the -CL llvm code generation options to -Cl, for
    consistency with the new -Xl option (-XL was already taken)

git-svn-id: trunk@44436 -
2020-03-30 19:58:49 +00:00
nickysn
48b4cc34cb * synchronized with trunk
git-svn-id: branches/z80@44414 -
2020-03-29 23:04:40 +00:00
florian
391512546e + initial FreeRTOS RTL support, largely based on the Embedded target, limited to Xtensa so far
git-svn-id: trunk@44400 -
2020-03-29 17:13:45 +00:00
nickysn
755fe97c51 * synchronize with trunk
git-svn-id: branches/z80@44397 -
2020-03-29 16:24:32 +00:00
florian
73c68236b6 * Xtensa: completed compiler skeleton
git-svn-id: trunk@44323 -
2020-03-21 12:49:45 +00:00
florian
9e40d536cb + Xtensa: initial skeleton completed
+ xtensa-embedded support in the compiler

git-svn-id: trunk@44318 -
2020-03-20 22:34:33 +00:00
florian
95e8992e2f + AArch64: profiler support for aarch64-linux
git-svn-id: trunk@44216 -
2020-02-19 21:10:19 +00:00
Tomas Hajny
8de6066b95 + added possibility to list supported modeswitches using -im and documented it in help pages
git-svn-id: trunk@44120 -
2020-02-05 22:37:43 +00:00
joost
171142a724 * Make Win32 SEH support enabled by default. If necessary to disable, compiler should be cycled with OPT=-dDISABLE_WIN32_SEH. Mantis #12974.
git-svn-id: trunk@43830 -
2020-01-01 14:43:57 +00:00
Jonas Maebe
6fc79c7ed0 * set default target iOS/iPhoneSim version to 9.0 so we no longer depend
on crt.o existing, which is not shipped with the current SDKs anymore

git-svn-id: trunk@43822 -
2019-12-30 16:36:57 +00:00
florian
a20209e691 + tf_init_final_units_by_calls
* arm-embedded generates direct calls for unit init/final now as well

git-svn-id: trunk@43771 -
2019-12-24 16:14:30 +00:00
pierre
ba73f7376f Also accept -a5 for older binutils for mips and mpisel cpus
git-svn-id: trunk@43599 -
2019-11-27 22:54:47 +00:00
pierre
01fbad64b7 Use defined(aarch64) instead of defined(cpuaarch64) for FPC_HAS_INTERNAL_ABS_INT64
git-svn-id: trunk@43598 -
2019-11-27 22:15:23 +00:00
pierre
7d12e8cc6d Avoid warnings for m68k compiler
git-svn-id: trunk@43391 -
2019-11-05 10:00:48 +00:00
Jonas Maebe
62da49577d * set default Mac OS X/OS X/macOS target version to 10.8 for i386 and x86-64,
instead of the previous 10.4 for i386 and 10.5 for x86-64. This prevents
    issues with finding the crt.* files, as starting with 10.8 those files
    are no longer required.

git-svn-id: trunk@43374 -
2019-11-02 22:44:15 +00:00
Károly Balogh
421b06affe morphos: in SDK 3.14, the binutils is finally upgraded to 2.32 (from 2.9.1), which makes section smartlinking working with binutils, and also has finally properly working stabs relocations for lineinfo, etc. so it's the default again both cross and native compilations
git-svn-id: trunk@43313 -
2019-10-26 22:24: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
Jonas Maebe
78fb35525f * change convention for searching sysroot library paths to be the same as the
one used by GNU ld: only search for library paths in the sysroot if they
    are built into the compiler or start with "=". Previously, all
    user-provided library paths were also searched in the sysroot
    (mantis #36198)

git-svn-id: trunk@43279 -
2019-10-20 17:26:44 +00:00
pierre
6f7a39adab Fix compilation for arm-darwin using clang and forbid use of eabihf ABI for that target
git-svn-id: trunk@43205 -
2019-10-15 22:17:52 +00:00
florian
a2d3522812 * general-dynamic -> global-dynamic
git-svn-id: trunk@43132 -
2019-10-05 20:48:29 +00:00
florian
03f7ef4c63 * renamed tls model switches and symbols to match gcc
git-svn-id: trunk@43122 -
2019-10-05 20:48:20 +00:00
florian
d8e2db2691 + command line switch -CV to select the threadvar model for section threadvars
git-svn-id: trunk@43071 -
2019-09-25 21:19:04 +00:00
florian
26d8cc9142 + define FPC_STACKALIGNMENT
git-svn-id: trunk@43008 -
2019-09-15 17:17:28 +00:00
florian
c418d63c16 + create defines with FPU capabilites
+ make use of FPU capability defines in the rtl

git-svn-id: trunk@42681 -
2019-08-13 22:12:49 +00:00
florian
85edf1c1eb * reworked arm vfp capability handling to use fpu_capabilites
git-svn-id: trunk@42679 -
2019-08-13 18:41:15 +00:00
svenbarth
e296b26e9e - remove unit info and related code again as that will be handled similar, but differently with dynamic packages
git-svn-id: trunk@42369 -
2019-07-12 22:05:47 +00:00
svenbarth
84848df18d Reintegration of Custom Attributes branch by Joost van der Sluis with patches reworked by Svetozar Belic [patch 3/3]
Added FPC_REQUIRES_PROPER_ALIGNMENT to TUnitInfo definition. Added FPC_HAS_EXTENDED_RTTI define.

git-svn-id: trunk@42358 -
2019-07-12 22:04:56 +00:00
Jeppe Johansen
a1a17447ff - Fix bug in 64bit softfloat double negation.
- Clean up handling of CPU/FPU type handling in RISCV.
- Do more fixes to get RISCV32 working.
- Fix most soft multiplication handling for generic RISCV code. Still missing a few.
- Add RISCV embedded targets.

git-svn-id: trunk@42335 -
2019-07-07 11:32:27 +00:00
Jonas Maebe
0a91fcb44f * LLVM-specific support for bsr*/bsf*
git-svn-id: trunk@42309 -
2019-06-29 16:27:18 +00:00
Jonas Maebe
1b6425176b * synchronised with trunk till r42049
git-svn-id: branches/debug_eh@42050 -
2019-05-12 18:44:05 +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
281b3ad276 * fix case completeness and unreachable code warnings in compiler that would
be introduced by the next commit

git-svn-id: trunk@42046 -
2019-05-12 14:29:03 +00:00
Jonas Maebe
46efaf4b2c + support for -CLflto_nosystem option to perform LTO for everything except
for the system unit, as there are several bugs in the Xcode linkers
    that trigger when the system unit is involved:
   o Xcode 9.3: the second symbol associated with routines that have multiple
     symbols (such as FPC_INTERLOCKED*) gets moved to the next routine (so
     e.g. calling InterlockedIncrement results in calling InterlockedExchange)
   o Xcode 10.1: the linker does not generate native code for the personality
     routine (probably because it's not referenced directly anywhere)

git-svn-id: branches/debug_eh@41911 -
2019-04-20 18:56:15 +00:00
Jonas Maebe
fc60ec2ea4 + support for LLVM LTO: compile units with -CLflto -> when compiling a main
program/library also with -Clflto, all units compiled with that option
    will be linked using their bitcode files and LTO
   o compiling with -CLflto will compile all units twice: once for normal
     (static or smart) linking, and once for LTO. So the result can be
     used both with and without LTO.

git-svn-id: branches/debug_eh@41910 -
2019-04-20 18:56:11 +00:00
Jonas Maebe
cf65c55b72 * support specifying the target LLVM/Xcode version
git-svn-id: branches/debug_eh@41727 -
2019-03-17 15:28:20 +00:00
Jonas Maebe
9d07e4948f * fix compilation of ARM compiler for LLVM
git-svn-id: branches/debug_eh@41210 -
2019-02-03 21:09:54 +00:00
Jonas Maebe
d93c05a90c * synchronised with trunk till r41207
git-svn-id: branches/debug_eh@41208 -
2019-02-03 21:05:37 +00:00
Jonas Maebe
13ce27cc1d * fixed the default external assembler for llvm when using -s
git-svn-id: trunk@41207 -
2019-02-03 21:01:13 +00:00
Jonas Maebe
ab51e8637c * set default Mac OS X target version to 10.6 for LLVM (earlier versions did
not include libunwind in libSystem, causing linking errors when compiling
    on later versions)

git-svn-id: trunk@41200 -
2019-02-03 21:00:36 +00:00
Jonas Maebe
a0d796e98d * synchronised with trunk till r41159
git-svn-id: branches/debug_eh@41160 -
2019-02-01 17:01:54 +00:00
florian
6c88894999 * do not call the internal assembler if -s is passed
git-svn-id: trunk@41126 -
2019-01-29 20:16:12 +00:00
pierre
7817e48e9a -Xr is also supported for systems_android
git-svn-id: trunk@41104 -
2019-01-28 17:43:15 +00:00
Jonas Maebe
51b58f342f * synchronised with trunk till r40775
git-svn-id: branches/debug_eh@40776 -
2019-01-05 22:12:28 +00:00
Károly Balogh
2f7fe0e737 haiku-x86_64: add target to the compiler and ppudump, enable it in fpmake and fpcmake
git-svn-id: trunk@40753 -
2019-01-04 02:16:24 +00:00
Jonas Maebe
a1db586c81 * define CPULLVM for compilers with an llvm-based code generator (in addition
to the regular CPUXXX define for the target architecture)

git-svn-id: branches/debug_eh@40434 -
2018-12-01 20:30:34 +00:00
Jonas Maebe
85702dd263 + added support for clang as an assembler for llvm IR
* adapted string used for macOS/iOS version in triple in llvm IR files to
    what clang expects (always a single digit patch version)

git-svn-id: branches/debug_eh@40431 -
2018-12-01 20:30:24 +00:00
Jonas Maebe
2f8fcf7819 + new tf_use_psabieh target flag to indicate a target uses PSABI/Dwarf EH
o use this flag to set the personality routine of a function if it uses
     exception handlinga
   o also define FPC_USE_PSABIEH if this target flag is set
   o set this target flag for darwin/x86-64 if the compiler is compiled with
     -dllvm

git-svn-id: branches/debug_eh@40415 -
2018-11-29 21:31:30 +00:00
florian
0d50a63c7d + tsettings.tlsmodel
git-svn-id: trunk@40271 -
2018-11-07 22:03:01 +00:00
yury
4357caaad8 * Removed unused local vars.
git-svn-id: trunk@40183 -
2018-11-02 18:44:29 +00:00
florian
a092da723a + new fields for more precise control of alignment
+ support of new alignment control values for GNU AS writer
+ support of new alignment control values for binary writer
* better alignment settings on i386-win32
* improved inserted align directives for if nodes

git-svn-id: trunk@40159 -
2018-11-01 20:49:17 +00:00
yury
7eb9b23fa5 * Reverted r39961.
git-svn-id: trunk@39962 -
2018-10-17 18:56:29 +00:00
yury
692c287c3e * Undef FPC_HAS_TYPE_EXTENDED for x86_64-android.
git-svn-id: trunk@39961 -
2018-10-17 18:46:04 +00:00
yury
671d31df1d + Added support for the aarch64-android target.
git-svn-id: trunk@39862 -
2018-10-06 09:33:09 +00:00
pierre
0e0b43889f Use vfpv2 as default fpu for eabihf if cpu is below armv7
git-svn-id: trunk@39849 -
2018-10-01 21:50:13 +00:00
Károly Balogh
b4a7d6a82e cleanup: remove ARMHF-related comments from RISC-V only codepath. no functional change.
git-svn-id: trunk@39827 -
2018-09-27 07:04:04 +00:00
pierre
578e60e6ef Fix default CPUs for riscv32
git-svn-id: trunk@39819 -
2018-09-26 21:56:36 +00:00
Jeppe Johansen
d33b520690 Clean up peephole optimization code.
Add hardfloat ABI option for RiscV. Still needs proper implementation though.
Add CG support for profiling.

git-svn-id: branches/laksen/riscv_new@39798 -
2018-09-24 17:15:22 +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
Jeppe Johansen
ceb38833f2 Added RiscV32/64 target, from a cleaned up version of branches/laksen/riscv/trunk.
git-svn-id: branches/laksen/riscv_new@39474 -
2018-07-20 08:21:15 +00:00
florian
68eb921d46 * broken compilation after r39347 fixed
git-svn-id: trunk@39349 -
2018-06-30 12:30:25 +00:00
svenbarth
8536abce8a * as the management operator feature is not platform specific using a specific define for it aside from a
version check is unnecessary, thus remove the FPC_HAS_MANAGEMENT_OPERATOR define and instead check for VER3_0

git-svn-id: trunk@39257 -
2018-06-20 19:00:24 +00:00
nickysn
b7bfac11cb + enable using the i8086 internal linker with debug info, if the compiler is
compiled with -di8086_link_intern_debuginfo

git-svn-id: trunk@39221 -
2018-06-14 15:24:39 +00:00
nickysn
9a4a61ab97 * automatically switch to external linking (and show message) when requested to
generate debug info on the i8086 targets

git-svn-id: trunk@39017 -
2018-05-17 16:11:51 +00:00
nickysn
b80642c384 + started implementing support for generating Microsoft CodeView debug
information. Only enabled on i8086 (for now). Does not do much yet, but
  hopefully, soon it'll start emitting line number information for i8086-msdos
  that is usable by DOS debuggers.

git-svn-id: trunk@39006 -
2018-05-16 15:25:33 +00:00
svenbarth
11f673a991 * also allow a ";"-separated list of namespaces for -FN
+ added test

git-svn-id: trunk@38939 -
2018-05-06 21:16:51 +00:00
svenbarth
760e1f3776 * default namespaces are specified using the new -FN<x> option whereby <x> is the namespace to be added to the
list of default namespaces

git-svn-id: trunk@38919 -
2018-05-05 17:18:47 +00:00
florian
5d17b335a6 * based on patch by Christo Crause: when setting the controller type, set also the sub architecture, resolves #33189
git-svn-id: trunk@38285 -
2018-02-18 21:19:35 +00:00
florian
5c18758b12 + based on a patch by Christo Crause create a define for the selected controller type (FPC_MCU_...), resolves #33191
git-svn-id: trunk@38284 -
2018-02-18 18:30:28 +00:00
pierre
22c4c349a6 force dwarf-2 debug format if used assembler does not support stabs (as indicated by new af_no_stabs flag)
git-svn-id: trunk@38239 -
2018-02-14 15:19:12 +00:00
Károly Balogh
75158d02ca m68k: set palmos to use 68000 and no FPU by default
git-svn-id: trunk@37916 -
2018-01-06 08:43:20 +00:00
pierre
0c3486f6e4 Add 'U' to list of first pass parsing, required to set cs_compilesystem early and avoid false error
git-svn-id: trunk@37908 -
2018-01-04 16:37:13 +00:00
Károly Balogh
6094910917 amiga/m68k: disable dynlibs feature. while the amiga has dynamic libraries, they have a different architecture, which don't mix with this feature. powerpc amiga could support the mainstream-style dynlibs, so keep it enabled there.
git-svn-id: trunk@37880 -
2017-12-30 07:00:15 +00:00
Károly Balogh
05642cd495 atari: switch off threading for atari tos. i think if we'll ever support MiNT, that should be a separate target, with all the advanced features enabled
git-svn-id: trunk@37877 -
2017-12-30 06:49:39 +00:00
florian
b41cb26727 + write selected features in ppu of the system unit and load them further on
* ppu version update
* -Sf might be used only during system unit compilation
* loadsystemunit factored out so the system unit can be loaded earlier than other units to get features set

git-svn-id: trunk@37708 -
2017-12-10 16:32:56 +00:00
nickysn
1c8b607d92 - disable threading on win16
git-svn-id: trunk@37669 -
2017-12-03 15:37:50 +00:00
florian
7fa9d267e3 * correctly set cpu defines after r37582, even if architecture and cpu type defines are equal (like CPUMIPS32), resolves #32687
git-svn-id: trunk@37590 -
2017-11-13 21:13:53 +00:00
florian
826f208e45 * define CPU and FPU type macros before the second parsing of the parameters so they can be used in config files
git-svn-id: trunk@37582 -
2017-11-12 22:14:18 +00:00
svenbarth
fcc1ce7a08 * fix for Mantis #30344: applied patch by Mario Ray Mahardhika to add new command line option -Sj[-|+] to control writeable typed constants (with a small adjustment to the help text)
+ added test

git-svn-id: trunk@37437 -
2017-10-09 19:19:23 +00:00
pierre
fee49a3e40 Disable threading feature for arm-palmos (like it is done for m68k-palmos)
git-svn-id: trunk@37221 -
2017-09-15 20:27:03 +00:00
nickysn
4e489f2b33 + generate faster, branchless code for abs(int64) on i8086
git-svn-id: trunk@37172 -
2017-09-10 18:58:45 +00:00
nickysn
aefa317474 + fast and branchless implementation of abs(int64) for i386
git-svn-id: trunk@37169 -
2017-09-10 17:25:47 +00:00
Károly Balogh
a87df638e7 m68k-atari: reenable threading feature. even if it's technically unsupported, it breaks the build of too many otherwise applicable packages
git-svn-id: trunk@37033 -
2017-08-22 11:07:10 +00:00
Károly Balogh
8db10af841 m68k: palmos and atari doesn't support threading
git-svn-id: trunk@37027 -
2017-08-22 09:06:52 +00:00
florian
7f72c780d8 * cleanup
git-svn-id: trunk@36960 -
2017-08-20 17:20:42 +00:00
pierre
903955f329 Add 's' for sparc64 specific message prefix
git-svn-id: trunk@36744 -
2017-07-18 12:50:47 +00:00
Károly Balogh
eaa769053b m68k: enable 68881 FPU on Linux and NetBSD by default
git-svn-id: trunk@36699 -
2017-07-08 23:54:39 +00:00
Károly Balogh
177a571af8 morphos/amiga/atari: fixed making vlink default based on the host platform
git-svn-id: trunk@36486 -
2017-06-11 23:33:11 +00:00
nickysn
a34f531661 + implemented support for codepage aware compiler messages. It can be enabled
per platform (currently only enabled for win32 and win64). Enabling it forces
  code page conversion from the codepage of the .msg file to CP_ACP, before
  writing the message to the console. Not enabling it keeps the previous
  behaviour of not doing any kind of code page conversion for messages. This
  feature should be tested and enabled per platform, because it requires code
  page conversion support in the rtl (so it may require adding the appropriate
  extra units, such as fpwidestring). When this feature is enabled for all
  platforms, we can start keeping only one .msg file per language, because
  having extra .msg files for different encodings for the same language becomes
  redundant, since the compiler can do code page conversion to whatever code
  page the console uses.

git-svn-id: trunk@36450 -
2017-06-08 16:11:33 +00:00
florian
024481262c + compiler sets SPARC64 defines
git-svn-id: trunk@36427 -
2017-06-05 21:30:58 +00:00
nickysn
fa645dcaf7 + added abs(smallint) and abs(shortint) for cpus with 8-bit or 16-bit alu
git-svn-id: trunk@36327 -
2017-05-25 14:14:18 +00:00
Károly Balogh
a4c40a51ff m68k: also add options.pas to the previous change
git-svn-id: trunk@36303 -
2017-05-23 00:18:13 +00:00
pierre
ae349a3ccc Handle second argument to -Ch option, -Chx,y y is max heap size
git-svn-id: trunk@36260 -
2017-05-19 21:28:24 +00:00
pierre
b7fab7d39c Add -Wh command line option to enable HugeCode (equivalent of $F+)
for msdos memory models that support this.
  Add message to document this new command line option.

git-svn-id: trunk@36199 -
2017-05-12 22:49:50 +00:00
pierre
65fadcaa53 Disable threading and dynlibs features for msdos OS target by default
git-svn-id: trunk@36123 -
2017-05-05 15:03:47 +00:00
florian
fc4a8c0daa * more z80 support for the compiler
git-svn-id: branches/z80@35678 -
2017-03-28 20:21:03 +00:00
maciej-izak
af8e0efe57 * Rtti info about Management Operators (MO) in init table for records. Note: commit contains minimal changes for RTL (for proper "make") no functional changes. More RTL changes for fully functionally MO in next commits.
compiler/ncgrtti.pas
  + write_record_operators procedure which fills simple VMT like table for MO.
  * recorddef_rtti save MO (if exists)
  * objectdef_rtti_fields save nil pointer/entry for objects rtti (have same RTL parts like for records)

compiler/options.pas
  + new define FPC_HAS_MANAGEMENT_OPERATORS

compiler/symconst.pas
  + new item itp_init_record_operators for tinternaltypeprefix enum
  + new entry '$init_record_operators$' in internaltypeprefixName

rtl/inc/rtti.inc
  + new field RecordOp (pointer to MO VMT table) in TRecordInfoInit
  + new types to handle MO VMT: TRTTIRecordOpVMT, PRTTIRecordOpVMT, TRTTIRecCopyOp, TRTTIRecVarOp

rtl/objpas/typinfo.pp
  + RecordOp field for TRecInitData record

git-svn-id: trunk@35445 -
2017-02-19 00:22:59 +00:00
Jonas Maebe
265c8e7bbc + support for specifying ms_abi_default, ms_abi_cdelc, sysv_abi_default, and
sysv_abi_cdecl calling conventions on x86-64 to force using the SYSV/
    Microsoft ABI on platforms that don't use it by default (mainly to ease
    porting pure assembler routines)

git-svn-id: trunk@35425 -
2017-02-11 19:57:12 +00:00
svenbarth
a9888eba70 * also generate Big Obj COFF files with the GNU utilities (needs 2.25 or newer), at least as long as the new option -a5 isn't given, which disables this
Note 1: using an older AS might fail anyway if the amount of sections is too high (like in packages\odata\src\sharepoint.pp)
Note 2: it might be an idea to keep track of the created sections in the asmlists and only enable the option if *really* necessary (like with the internal COFF output generator), though this might lead to false positives due to multiple sections with the same name (since I'd prefer to use the KISS principle only a counter would be used)

git-svn-id: trunk@35381 -
2017-02-03 22:45:32 +00:00
Jonas Maebe
9cd707a27a * give an error if -Pxxx is specified to the compiler binary and xxx is not
the target architecture this compiler binary supports (mantis #30098)

git-svn-id: trunk@35299 -
2017-01-14 13:50:41 +00:00
florian
29a2c433f7 * -Sr option for iso mode: in case no command line parameter is passed, the file name for program parameters is derived from their variable name
git-svn-id: trunk@35257 -
2017-01-07 14:50:58 +00:00
florian
42cde51805 * ignore warnings caused by boolean expression simplification
git-svn-id: trunk@35231 -
2017-01-04 16:33:31 +00:00
Károly Balogh
d8f7fd008e atari: enable vlink for native builds as default
git-svn-id: trunk@35222 -
2017-01-03 13:58:49 +00:00
florian
7f375ac7bc * white space fixes
git-svn-id: trunk@35189 -
2016-12-23 17:04:30 +00:00
pierre
4d09dfca95 Remember usage of checkpointer (-gc) option:
Use new cs_checkpointer_called moduleswitches set element.
     Use new uf_checkpointer_called PPU flag (reusing obsolete uf_local_browser flag value)
     Emit warning if compiled library/program has any code using checkpointer.
  
 * ppu.pas: New constant: uf_checkpointer_called
 * globtype.pas: New constant: cs_checkpointer_called
 * fppu.pas: Set uf_checkpointer_called flag if cs_checkpointer_called is set in current_settings.module_switches
 * i8086/n8086mem.pas: Include cs_checkpointer_called in current_settings.moduleswitches
 *  ncgmem.pas: Likewise.
 * msg/errore.msg: Add new message saying that -gc and -Ur options are incompatible
   Add description to -gc option, saying it is experimental.
   Add warning at link time for program/library if checkpointer is used in any unit or main code.
 * options.pas: if -gc and -Ur options are used, never enable checkpointer code,
   instead output a warning that release is incompatible with -gc option.
 * pmodules.pas: proc_program: Check all modules for uf_checkpointer_called flag,
   emit a warning if checkpointer is used.
 * utils/ppuutils/ppudump.pp: Add code for uf_codepointer_called option.

git-svn-id: trunk@34567 -
2016-09-27 14:46:09 +00:00
pierre
13076a3580 Use NO prefix to disable a feature (-Sfnoheap) instead of '-' prefix
git-svn-id: trunk@34018 -
2016-06-25 05:27:09 +00:00
pierre
270a574d6a + Allow to disable specific feature with -Sf-FEATURE_NAME
* Fix "-CX -al" use for i8086, because it was currently broken
  -al triggered switch to nasm external assembler but with smart linking,
  this should also generate a switch to external assembler.

git-svn-id: trunk@34017 -
2016-06-24 15:55:10 +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
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
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
svenbarth
17bb29ddc3 Check for tf_winlikewidestring in the target's flags instead of relying on the target being a Windows system when determining whether the system as the WideString type that's separate from UnicodeString
git-svn-id: trunk@33900 -
2016-06-04 08:45:22 +00:00
pierre
e1814305bd Fix default CPU for assembler blocks (init_settings.asmcputype) to be the same as init_settings.cputype
git-svn-id: trunk@33612 -
2016-05-02 11:57:22 +00:00
Károly Balogh
510c3456d6 m68k: define CPUCOLDFIRE on the CF family targets
git-svn-id: trunk@33531 -
2016-04-18 02:17:25 +00:00
svenbarth
e8ede4c3e2 Merged revision(s) 32508-32510, 32512 from branches/svenbarth/packages:
Keep track whether a package was added directly through a requires section (or the command line) or indirectly.

fpkg.pas, tpackageentry:
  + new field "direct"
pkgutil.pas:
  + add_package: new parameter "direct" which sets the "direct" field of the new package entry
options.pas:
  * TOption.interpret_option & read_arguments: adjust call to add_package()
pmodules.pas:
  * proc_package: adjust call to add_package()

........
Also load all packages that are required by packages, but that are not part of the directly used packages.

pkgutil.pas, load_packages:
  * check the list of required packages for packages that are not yet part of the package list and add these as indirect packages
  * establish the links to loaded packages in the required packages once all packages were loaded

........
fpcp.pas, tpcppackage:
  + new method add_required_package() to add a required package while ignoring duplicates

........
pmodules.pas, proc_package:
  * add all packages of loaded units as required packages

........

git-svn-id: trunk@33517 -
2016-04-15 14:42:24 +00:00
Károly Balogh
fca1a74244 * reenable VLink as default linker for PowerPC Amiga, now that the support is fixed
git-svn-id: trunk@33512 -
2016-04-14 21:44:34 +00:00
svenbarth
c5bdc11cb2 Merged revision(s) 31924, 31934-31937 from branches/svenbarth/packages:
pmodules.pas, proc_package:
  * generate the dummy entry symbol only on Windows systems (ToDo for other systems that might need it)

........
options.pas:
  * TOption.interpret_option & read_arguments: use add_package() from pkgutils instead of addpackage() from fpkg
fpkg.pas:
  - remove no longer needed addpackage()

........
pkgutil.pas:
  + new procedure add_package_libs() to add all packages as libraries that are also linked against
pmodules.pas:
  * proc_package & proc_program: add all package libraries to the linker before creating the final binary

........
pkgutil.pas, add_package:
  * package names are case insensitive so add them in uppercase to correctly detect duplicates

........
Keep track of how many units are used from each required/requested package and only link those from which any units are used.

fpkg.pas, tpackageentry:
  + new field usedunits to count how many units of the package are used
pkgutil.pas:
  + new procedure add_package_unit_ref() to increase the amount of used units for the given package
pmodules.pas:
  * proc_package & proc_program: check which units of all loaded ones are provided by other packages

........

git-svn-id: trunk@33510 -
2016-04-14 21:35:47 +00:00
Károly Balogh
a73404a88c * disable default VLink for AmigaOS/PowerPC, as current VLink internalerrors while tries to link FPC-generated objects on this platform, for unknow reasons
git-svn-id: trunk@33494 -
2016-04-13 03:16:58 +00:00
Károly Balogh
9dae10b8ba * enable VLink when running on Amiga/MorphOS targets earlier so it can even be disabled afterwards
git-svn-id: trunk@33489 -
2016-04-12 16:52:47 +00:00
svenbarth
f8e9b33f99 Merge first batch of package handling related revisions from the packages branch
Merged revision(s) 28796, 28837-28845, 28847-28850, 28852, 32135 from branches/svenbarth/packages:
Provide possibility to pass packages and search paths for packages as parameters.

fpkg.pas:
  + new unit which contains the base types related to package files (most importantly "tpackage")
globals.pas:
  + new variable "packagesearchpath" which contains all paths in which package files should be looked for
  + new variable "packagelist" which contains a list of all packages that should be used in a program or library
  * InitGlobals & DoneGlobals: initialize/finalize "packagesearchpath" accordingly ("packagelist" is handled in unit fpkg using a init/done-callback)
options.pas:
  + TOption: new fields "parapackagepath" and "parapackages" to keep track of package search paths and package files passed as parameters
  * TOption.interpret_option: use '-Fp' for package search paths and '-FP' for package files
  * read_arguments: apply the passed package search paths and packages to their respective containers
........
+ add a new unit which will contain basic functions related to handling packages
........
Move package related functions from pmodules to pkgutil.

pmodules.pas => pkgutil.pas:
  * createimportlibfromexports
  * varexport
  * procexport
  * insert_export
  * RewritePPU
........
* adjust indentation
........
Extract the code to export the symbols of a unit to its own function in pkgutil so that less functions need to be exported.

pmodules.pas, proc_package:
  * move code to export the symbols of a unit to new function export_unit
pkgutil.pas:
  + new function export_unit
  - remove exports of procexport, varexport and insert_export
........
Some small fixes for package parsing.

pmodules.pas, proc_package:
  * use orgpattern instead of pattern to build the module name (like is done in uses sections)
  * ignore duplicates when generating exports
  - no need to generate an import library for the package; that is done by the program/library that uses the package
........
+ new unit fpcp of which the class tpcppackage handles the reading and writing of package metadata from/to pcp files (equivalant to tppumodule).
........
+ add unit which contains representation of a PCP file (tpcpfile) like tppufile is for units.
........
Improve export generation.

pkgutil.pas:
  + new function exportprocsym to correctly export a procedure with all its aliases
  + new function exportabstractrecordsymproc to export the members of structured types 
  * insert_export: handle also namespacesym and propertsym (by ignoring them)
  * insert_export: correctly export classes, record and objects
  * insert_export: use new exportprocsym function to export a procsym
  * insert_export: only export public variables of a static symtable


........
+ add entry constants for the name of the package and the package file names, both used by a PCP file
........
* use messages to get rid of most writelns related to package loading
........
Add additional entry types for PCP files

entfile.pas:
  + new entries ibstartrequireds and ibendrequireds to store the list of required packages
  + new entries ibstartcontained and ibendcontained to store the list of contained units
  + new entries ibstartppus and ibendppus to store the list of contained PPU files
........
Generate the PCP file once the package file and the used units were compiled correctly.

pmodules.pas:
  * proc_package: generate the PCP file upon successful compilation
........
Add the possibility to load all packages supplied as parameters.

pkgutil.pas:
  + new function load_packages to load all packages supplied as parameters
pmodules.pas, proc_program:
  * use load_packages to load all packages before any unit is loaded
........
Add code which tries to load a unit from a package first and only then as usual.

fppu.pas, tppumodule:
  + new method loadfrompackage which searches all available packages for the unit and loads it from there if found
  * loadppu: first try to load the unit from a package if any are available
........
Don't link objects files of a unit that is provided by a package.

pmodules.pas, proc_program:
  * if a unit has uf_in_library set we must not include it in the units we link against
........

git-svn-id: trunk@33452 -
2016-04-08 15:40:27 +00:00
yury
af1ea62ff7 * i386-android: By default set CPU type to PentiumM and FPU to SSSE3 according to Android x86 ABI.
git-svn-id: trunk@33309 -
2016-03-21 09:53:18 +00:00
yury
cac16fa60e * Small refactor of the arm defaults for better readability.
git-svn-id: trunk@33307 -
2016-03-21 09:19:02 +00:00
florian
4e64fe77ac + define macros with information about the memory sizes of a MCU: FPC_FLASHBASE, FPC_FLASHSIZE, FPC_SRAMBASE, FPC_SRAMSIZE, FPC_EEPROMBASE, FPC_EEPROMSIZE, FPC_BOOTBASE, FPC_BOOTSIZE, resolves issue #29365
git-svn-id: trunk@33236 -
2016-03-13 15:50:55 +00:00
Jonas Maebe
741c91275a - removed "const" from first parameter of check_configfile(), because that
routine is called with the same variable passed as the first and second
    parameter, so the first one is not constand (since the second one is a
    "var" para) -- this caused errors when compiling the compiler with -gt

git-svn-id: trunk@33202 -
2016-03-07 19:58:59 +00:00
florian
1c067e96bf * fix VFPv4 support
git-svn-id: trunk@33182 -
2016-03-06 13:33:16 +00:00
florian
ddad3b3166 * allow very small heaps for avr
git-svn-id: trunk@33071 -
2016-02-07 18:28:13 +00:00
florian
fd61d65313 * handle controller type already in the first options pass_1
* set heapsize for the avrsim controller target to a reasonable size

git-svn-id: trunk@33068 -
2016-02-07 11:24:47 +00:00