Commit Graph

694 Commits

Author SHA1 Message Date
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
nickysn
c2b0256869 - don't define 'CPU8086' on the i8086 target, because it clashes with the
selected instruction set define (CPU8086/CPU80186/CPU80286, etc.)
  For a generic i8086 target define, 'CPUI8086' should be used instead of
  'CPU8086'.

git-svn-id: trunk@33006 -
2016-01-26 00:33:02 +00:00
Károly Balogh
3675fc75cb VLink Support:
* fixed for MorphOS, added for Amiga/m68k
* enabled as default when running natively on these systems (cross still defaults to GNU LD)
* added -XV command line switch to enable/disable it
* dropped the 'fpc' prefix from vlink binary name on MorphOS

git-svn-id: trunk@32324 -
2015-11-15 01:18:30 +00:00
yury
36622eaba9 * arm-android: Compile for ARMv5T by default to be compatible with all versions of Android.
git-svn-id: trunk@32078 -
2015-10-17 16:27:53 +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
yury
432248cbf1 * Removed lot of unused vars.
git-svn-id: trunk@31732 -
2015-09-17 12:48:58 +00:00
yury
67758f450e * Set ARMv6 as default CPU for arm-android to eliminate multi-threading issues on multi-core CPUs.
git-svn-id: trunk@31718 -
2015-09-16 16:11:36 +00:00
Jonas Maebe
c7aabaa3b6 - removed FPC_OBJFPC_EXTENDED_IF-related code, FPC 2.6.4 has it
git-svn-id: trunk@31696 -
2015-09-15 11:52:02 +00:00
Jonas Maebe
28bc3bb294 - removed FPC_STRTOSHORTSTRINGPROC-related checks, FPC 2.6.4 has it
git-svn-id: trunk@31695 -
2015-09-15 11:51:58 +00:00
Jonas Maebe
ad66b06222 - removed FPC_STRTOCHARARRAYPROC-related checks, FPC 2.6.4 had it
git-svn-id: trunk@31694 -
2015-09-15 11:51:55 +00:00
Jonas Maebe
9ab80874cc - removed FPC_REAL2REAL_FIXED-related checks, FPC 2.6.4 has it
git-svn-id: trunk@31693 -
2015-09-15 11:51:51 +00:00
Jonas Maebe
2afd8eb802 - removed FPC_HAS_STR_CURRENCY-related code, FPC 2.6.4 has it
git-svn-id: trunk@31692 -
2015-09-15 11:51:48 +00:00
Jonas Maebe
12030f904a - removed FPC_HAS_VALGRINDBOOL-related checks, FPC 2.6.4 has it
git-svn-id: trunk@31691 -
2015-09-15 11:51:45 +00:00
Jonas Maebe
1c2bac7608 - removed FPC_HAS_VARSETS-related checks, FPC 2.6.4 has it
git-svn-id: trunk@31690 -
2015-09-15 11:51:42 +00:00
Jonas Maebe
858fd37483 - removed FPC_HASINTERNALOLEVARIANT2VARIANTCAST-related checks, FPC 2.6.4
has it

git-svn-id: trunk@31689 -
2015-09-15 11:51:38 +00:00
Jonas Maebe
da6382db2a - removed FPC_HASFIXED64BITVARIANT-related checks, FPC 2.6.4 has it
git-svn-id: trunk@31688 -
2015-09-15 11:51:35 +00:00
Jonas Maebe
4494565a15 - removed RESSTRSECTIONS-related checks, FPC 2.6.4 has it
git-svn-id: trunk@31687 -
2015-09-15 11:51:32 +00:00
Jonas Maebe
4564bffb85 * use binutils 2.19+ linker script "augmentation" functionality to specify
how the fpc sections have to be linked *on Linux*. This prevents the
    "did you forget -T" warnings from ld, and in general is more correct than
    our previous approach of specifying a complete linker script without -T
    and hoping that there won't be any unexpected interactions with ld's
    built-in linker script (fixed version of r31664, thanks to Alan Modra)
   o use the new -X9 command line option to generate linker scripts that
     are compatible with binutils older than 2.19 (reverts to the old
     behaviour)

git-svn-id: trunk@31675 -
2015-09-14 07:24:54 +00:00
Jonas Maebe
e06a759e20 - reverted r31664, it causes crashes with some ld versions :/
git-svn-id: trunk@31670 -
2015-09-13 20:14:46 +00:00
Jonas Maebe
cd41bf672c * use binutils 2.19+ linker script "augmentation" functionality to specify
how the fpc sections have to be linked *on Linux*. This prevents the
    "did you forget -T" warnings from ld, and in general is more correct than
    our previous approach of specifying a complete linker script without -T
    and hoping that there won't be any unexpected interactions with ld's
    built-in linker script
   o use the new -X9 command line option to generate linker scripts that
     are compatible with binutils older than 2.19 (reverts to the old
     behaviour)

git-svn-id: trunk@31664 -
2015-09-13 19:06:14 +00:00
Jonas Maebe
c813e024ee * support non-section-based threadvars on the LLVM target
git-svn-id: trunk@31645 -
2015-09-12 23:33:14 +00:00
nickysn
bdfd23cc2e + new target switch "FarProcsPushOddBP", which causes the i8086 compiler to push
odd values of BP if the procedure is far. Enabled this by default for Win16.

git-svn-id: trunk@31569 -
2015-09-07 19:05:18 +00:00
nickysn
839ab714cc + started implementing a win16 target :)
git-svn-id: trunk@31521 -
2015-09-05 02:47:42 +00:00
nickysn
8458bbfaf6 + enabled the huge memory model command line option
git-svn-id: trunk@31495 -
2015-09-03 17:31:41 +00:00
Jonas Maebe
3f9f498e0d - removed leftover alpha, ia64 and vis code
git-svn-id: trunk@31446 -
2015-08-28 22:31:29 +00:00
Jonas Maebe
21066ba3f3 * changed LinkTypeSetExplicitly from a global variable into a field of toption
git-svn-id: trunk@31444 -
2015-08-28 22:31:21 +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
Jonas Maebe
84bd523867 * changed paratargetasm from a global variable into a field of toption
git-svn-id: trunk@31442 -
2015-08-28 22:31:12 +00:00