summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Correctly handle external functions that are used from other units.svenbarthsvenbarth2015-12-111-2/+20
| | | | | | | | pkgutil.pas, createimportlibfromexternals: * processasmsyms: also check the import name when checking for duplicates (just for safety, the cache check should have caught these already) * processimportedsyms: if we have a routine imported from a library of whihc the symbol resides in a unit loaded from a package we need to import the routine ourselves instead of trying to import it from the package; also add an entry in the cache to speed up finding it again in processasmsyms() git-svn-id: http://svn.freepascal.org/svn/fpc/branches/svenbarth@32639 3ad0048d-3df7-0310-abae-a5850022a9f2
* Convert WideStrInits and ResStrInits to indirect symbols.svenbarth2015-12-113-6/+14
| | | | | | | | | | | | compiler/ngenutil.pas, tnodeutils: * InsertRuntimeInits: also generate an indirect symbol * InsertRuntimeInitsTablesTable: use the indirect symbol in the table rtl/objpas/objpas.pp: * UpdateResourceStringRefs: respect the new indirect reference of the table entry rtl/win/syswin.inc: * InitWin32Widestrings: respect the new indirect reference of the table entry git-svn-id: http://svn.freepascal.org/svn/fpc/branches/svenbarth@32638 3ad0048d-3df7-0310-abae-a5850022a9f2
* psub.pas:svenbarth2015-12-111-18/+28
| | | | | | * read_proc: extract the code that creates an import library entry into its own function import_external_proc so that the same code can be used from other locations as well git-svn-id: http://svn.freepascal.org/svn/fpc/branches/svenbarth@32637 3ad0048d-3df7-0310-abae-a5850022a9f2
* pkgutil.pas:svenbarth2015-12-111-0/+6
| | | | | | * exportabstractrecordsymproc & insert_export: don't try to export a typedef if it doesn't belong to the current symtable, happens for cross unit type aliases git-svn-id: http://svn.freepascal.org/svn/fpc/branches/svenbarth@32635 3ad0048d-3df7-0310-abae-a5850022a9f2
* pkgutil.pas, createimportlibfromexternals:svenbarth2015-12-041-0/+3
| | | | | | * import_proc_symbol: at least import the mangled name if there is no alias available git-svn-id: http://svn.freepascal.org/svn/fpc/branches/svenbarth@32583 3ad0048d-3df7-0310-abae-a5850022a9f2
* pkgutil.pas, createimportlibfromexternals:svenbarth2015-12-041-0/+6
| | | | | | * findpackagewithsym: ignore other (weak) external symbols git-svn-id: http://svn.freepascal.org/svn/fpc/branches/svenbarth@32582 3ad0048d-3df7-0310-abae-a5850022a9f2
* Adjust passing of TlsKey so that it works correctly for indirect entry ↵svenbarth2015-12-045-39/+26
| | | | | | | | | | | | | | | | | | | | | information rtl/win32/sysinit.inc: * TlsKeyVar is a mere variable, not a public one rtl/win32/system.pp: * new public variable FPCTlsKey to hold the pointer to the TlsKey variable * Exe_entry: setup FPCTlsKey rtl/win/syswin.inc, Dll_entry: * setup FPCTlsKey * adjust TlsKey usage rtl/win/systhrd.inc: - get rid of the TlsKey property again * TlsKey is now a pointer to the TlsKey variable; in case of no indirect main information that is declared locally otherwise it must have been set through the entry information * adjust usages of TlsKey rtl/inc/heaptrc.pp: * TlsKey is now a PDword instead of a DWord git-svn-id: http://svn.freepascal.org/svn/fpc/branches/svenbarth@32581 3ad0048d-3df7-0310-abae-a5850022a9f2
* Adjust passing of SysInstance so it works correctly for packagessvenbarth2015-12-043-2/+4
| | | | | | | | | | | | rtl/win32/sysinit.inc: * SysInstance is neither external nor public, but just a mere variable win32/system.pp: + new public variable FPCSysInstance that will hold the address of SysInstance passed through the entry information * EXE_Entry: setup FPCSysInstance win/syswin.inc: * DLL_Entry: setup FPCSysInstance git-svn-id: http://svn.freepascal.org/svn/fpc/branches/svenbarth@32580 3ad0048d-3df7-0310-abae-a5850022a9f2
* pkgutil.pas, add_package_libs:svenbarth2015-12-041-1/+3
| | | | | | * fix exit condition (on Linux it probably worked by accident :/ ) git-svn-id: http://svn.freepascal.org/svn/fpc/branches/svenbarth@32579 3ad0048d-3df7-0310-abae-a5850022a9f2
* pmodules.pas, finish_unit:svenbarth2015-12-031-1/+4
| | | | | | | * also release the generated proc symbol if the init function isn't needed git-svn-id: http://svn.freepascal.org/svn/fpc/branches/svenbarth@32575 3ad0048d-3df7-0310-abae-a5850022a9f2
* Ensure that no unnecessary symbols are generated for generics.svenbarth2015-12-033-3/+14
| | | | | | | | | | | | | | ncgrtti.pas, TRTTIWriter: * write_rtti: don't write rtti for generic definitions or generic dummy symbols psub.pas: * tcgprocinfo.parse_body: don't allocate a proc symbol for generics * read_proc: don't define an assembler symbol for global generics pkgutil.pas: * exportprocsym: don't export a procdef if it's generic * insert_export: don't export generic record- and objectdefs git-svn-id: http://svn.freepascal.org/svn/fpc/branches/svenbarth@32574 3ad0048d-3df7-0310-abae-a5850022a9f2
* pkgutil.pas, exportprocsym:svenbarth2015-12-031-4/+6
| | | | | | | | * use a temporary variable for the procdef * restructure the if-expression a bit to make it better readable git-svn-id: http://svn.freepascal.org/svn/fpc/branches/svenbarth@32573 3ad0048d-3df7-0310-abae-a5850022a9f2
* rtl/darwin/sysinit.pas:svenbarth2015-11-271-1/+1
| | | | | | | * reference PASCALMAIN correctly (I wonder how this even worked previously :/ ) git-svn-id: http://svn.freepascal.org/svn/fpc/branches/svenbarth@32547 3ad0048d-3df7-0310-abae-a5850022a9f2
* Report a warning if a unit is used from an indirectly used package. We are ↵svenbarth2015-11-232-3/+28
| | | | | | | | | | | | doing this only for the units used in contained units though as in the "contains" section there can't be such units anyway (and just checking all loaded units would lead to false positives). pkgutil.pas: + new procedure check_for_indirect_package_usages() which walks a TLinkedList of used units and warns on every unit that is from an indirectly imported package pmodules.pas, proc_package: * when checking all loaded units whether they are from a package or not also check for indirect package usages using the new procedure git-svn-id: http://svn.freepascal.org/svn/fpc/branches/svenbarth@32515 3ad0048d-3df7-0310-abae-a5850022a9f2
* * regenerated msgtxt.inc & msgidx.inc after r32513svenbarth2015-11-232-168/+174
| | | | git-svn-id: http://svn.freepascal.org/svn/fpc/branches/svenbarth@32514 3ad0048d-3df7-0310-abae-a5850022a9f2
* msg/errore.msg:svenbarth2015-11-231-1/+4
| | | | | | | + new message when a unit from an indirectly referenced package is used git-svn-id: http://svn.freepascal.org/svn/fpc/branches/svenbarth@32513 3ad0048d-3df7-0310-abae-a5850022a9f2
* pmodules.pas, proc_package:svenbarth2015-11-231-2/+13
| | | | | | | * add all packages of loaded units as required packages git-svn-id: http://svn.freepascal.org/svn/fpc/branches/svenbarth@32512 3ad0048d-3df7-0310-abae-a5850022a9f2
* Disable most of the (annoying) debug output regarding packages.svenbarth2015-11-231-9/+9
| | | | git-svn-id: http://svn.freepascal.org/svn/fpc/branches/svenbarth@32511 3ad0048d-3df7-0310-abae-a5850022a9f2
* fpcp.pas, tpcppackage:svenbarth2015-11-231-0/+15
| | | | | | | + new method add_required_package() to add a required package while ignoring duplicates git-svn-id: http://svn.freepascal.org/svn/fpc/branches/svenbarth@32510 3ad0048d-3df7-0310-abae-a5850022a9f2
* Also load all packages that are required by packages, but that are not part ↵svenbarth2015-11-231-3/+42
| | | | | | | | | | | 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 git-svn-id: http://svn.freepascal.org/svn/fpc/branches/svenbarth@32509 3ad0048d-3df7-0310-abae-a5850022a9f2
* Keep track whether a package was added directly through a requires section ↵svenbarth2015-11-234-5/+7
| | | | | | | | | | | | | | | | (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() git-svn-id: http://svn.freepascal.org/svn/fpc/branches/svenbarth@32508 3ad0048d-3df7-0310-abae-a5850022a9f2
* systems/t_linux.pas, TLinkerLinux:svenbarth2015-11-231-1/+5
| | | | | | | * WriteResponseFile: if a library has a non standard extension then we need to force the linker to look for this using ":" git-svn-id: http://svn.freepascal.org/svn/fpc/branches/svenbarth@32507 3ad0048d-3df7-0310-abae-a5850022a9f2
* ncgvmt.pas, TVMTWriter:svenbarth2015-11-231-1/+1
| | | | | | | * generate_field_table: use the indirect symbol for the class references; it is currently not used in the RTL, so mentioning this in User Changes Trunk should be enough git-svn-id: http://svn.freepascal.org/svn/fpc/branches/svenbarth@32506 3ad0048d-3df7-0310-abae-a5850022a9f2
* * regenerate Makefile after r32504svenbarth2015-11-231-0/+1
| | | | git-svn-id: http://svn.freepascal.org/svn/fpc/branches/svenbarth@32505 3ad0048d-3df7-0310-abae-a5850022a9f2
* Set FPC_HAS_INDIRECT_MAIN_INFORMATION for i386-linuxsvenbarth2015-11-231-0/+1
| | | | git-svn-id: http://svn.freepascal.org/svn/fpc/branches/svenbarth@32504 3ad0048d-3df7-0310-abae-a5850022a9f2
* ncgflw.pas, tcgonnode:svenbarth2015-11-231-3/+1
| | | | | | | * pass_generate_node: get rid of unnecessary move into register git-svn-id: http://svn.freepascal.org/svn/fpc/branches/svenbarth@32503 3ad0048d-3df7-0310-abae-a5850022a9f2
* Use indirect reference for the RTL helpers that require RTTI symbols.svenbarth2015-11-231-12/+36
| | | | | | | | hlcgobj.pas, thlcgobj: * g_incrrefcount, g_initialize, g_finalize & g_array_rtti_helper: use the indirect symbol of the RTTI if the target supports packages git-svn-id: http://svn.freepascal.org/svn/fpc/branches/svenbarth@32502 3ad0048d-3df7-0310-abae-a5850022a9f2
* Adjust resourcestrings so they use indirect references as well.svenbarth2015-11-232-1/+27
| | | | | | | | | | cresstr.pas, Tresourcestrings: * CreateResourceStringData: generate indirect symbols for the single resourcestrings if the target supports packages ncgld.pas, tcgloadnode: * pass_generate_code: load resourcestrings using their indirect symbols if required git-svn-id: http://svn.freepascal.org/svn/fpc/branches/svenbarth@32501 3ad0048d-3df7-0310-abae-a5850022a9f2
* Use indirect references for "on".svenbarth2015-11-231-2/+13
| | | | | | | | ncgflw.pas, tcgonnode: * pass_generate_code: if the target supports packages then we need to load the VMT using an indirect symbol git-svn-id: http://svn.freepascal.org/svn/fpc/branches/svenbarth@32500 3ad0048d-3df7-0310-abae-a5850022a9f2
* Adapt resource string tables to use indirect references as well.svenbarth2015-11-223-11/+30
| | | | | | | | | | | | | | compiler/cresstr.pas, Tresourcestrings: * CreateResourceStringData: generate indirect labels for the START and END markers of the unit's resource strings compiler/ngenutil.pas, tnodeutils: * InsertResourceTablesTable: reference the indirect symbols of the START and END markers rtl/objpas/objpas.pp: + add pointer to PResourceStringRecord * TResourceStringTableList: use PPResourceStringRecord instead of PResourceStringRecord * adjust usages of TableStart and TableEnd (the first dereferentiation is by definition always valid) git-svn-id: http://svn.freepascal.org/svn/fpc/branches/svenbarth@32498 3ad0048d-3df7-0310-abae-a5850022a9f2
* Improve PIC startup code when not using C libraries. It correctly reaches ↵svenbarth2015-11-221-7/+8
| | | | | | PascalMain, but it crashes inside fpc_cpucodeinit when setting has_mmx_support :/ git-svn-id: http://svn.freepascal.org/svn/fpc/branches/svenbarth@32497 3ad0048d-3df7-0310-abae-a5850022a9f2
* Adjust the C 2.1 startup code to be able to handle indirect main information ↵svenbarth2015-11-221-0/+80
| | | | | | (PIC does not work though :( ). git-svn-id: http://svn.freepascal.org/svn/fpc/branches/svenbarth@32496 3ad0048d-3df7-0310-abae-a5850022a9f2
* Adjust the C and C 2.1 halt code to retrieve the exit code from the ↵svenbarth2015-11-222-55/+5
| | | | | | parameter instead of accessing ExitCode directly. git-svn-id: http://svn.freepascal.org/svn/fpc/branches/svenbarth@32494 3ad0048d-3df7-0310-abae-a5850022a9f2
* Fix compilation.svenbarth2015-11-221-2/+12
| | | | | | | | ncgrtti.pas, TRTTIWriter: * get_rtti_label_ord2str & get_rtti_label_str2ord: adjust due to the change of ordering for the indirect suffix and o2s/s2o git-svn-id: http://svn.freepascal.org/svn/fpc/branches/svenbarth@32493 3ad0048d-3df7-0310-abae-a5850022a9f2
* For systems that support both internal and external resources (in this case ↵svenbarth2015-11-221-2/+5
| | | | | | | | | | 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: http://svn.freepascal.org/svn/fpc/branches/svenbarth@32492 3ad0048d-3df7-0310-abae-a5850022a9f2
* Adjust non-Windows resources to work with indirect main information as well.svenbarth2015-11-228-24/+46
| | | | | | | | | | | | | | | | | | | 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 git-svn-id: http://svn.freepascal.org/svn/fpc/branches/svenbarth@32491 3ad0048d-3df7-0310-abae-a5850022a9f2
* Enable dynamic packages support for i386-linux. Note: this requires the RTL ↵svenbarth2015-11-221-1/+1
| | | | | | | | | | to be manually compiled with FPC_HAS_INDIRECT_MAIN_INFORMATION since not all SysInit units are yet adjusted. systems/i_linux.pas, system_i386_linux_info: + add tf_supports_packages to flags git-svn-id: http://svn.freepascal.org/svn/fpc/branches/svenbarth@32489 3ad0048d-3df7-0310-abae-a5850022a9f2
* Adjust the C-less entry points to support indirect main information.svenbarth2015-11-222-3/+56
| | | | | | | | | | rtl/inc/si_dll.inc: * _FPC_shared_lib_start: fill in SysInitEntryInformation and call SysEntry with it in case of indirect main information rtl/inc/si_prc.inc: * _FPC_proc_start: fill in SysInitEntryInformation and call SysEntyr with it in case of indirect main information git-svn-id: http://svn.freepascal.org/svn/fpc/branches/svenbarth@32488 3ad0048d-3df7-0310-abae-a5850022a9f2
* Prepare Linux sysinit units for indirect main information.svenbarth2015-11-221-0/+40
| | | | | | | | | | rtl/linux/si_impl.inc: + add SysEntry external + add externals for the various tables + add default constant for the entry information; the entry points only need to fill in the platform specific type then git-svn-id: http://svn.freepascal.org/svn/fpc/branches/svenbarth@32487 3ad0048d-3df7-0310-abae-a5850022a9f2
* Prepare Linux System unit for working with indirect main information.svenbarth2015-11-222-3/+54
| | | | | | | | | | | | rtl/linux/sysosh.inc: + add linux specific TPlatform type to be used by TEntryInformation rtl/linux/system.pp: + add EntryInformation variable + add common entry point that sets up the tables and calls PascalMain * System_exit: adjust to call EntryInformation.Platform.haltproc if indirect main information is used git-svn-id: http://svn.freepascal.org/svn/fpc/branches/svenbarth@32486 3ad0048d-3df7-0310-abae-a5850022a9f2
* Fix haltproc to retrieve the exit code from the passed parameter instead of ↵svenbarth2015-11-221-34/+4
| | | | | | manually accessing ExitCode git-svn-id: http://svn.freepascal.org/svn/fpc/branches/svenbarth@32485 3ad0048d-3df7-0310-abae-a5850022a9f2
* Move PascalMain external from the si_*.inc files to a new include file ↵svenbarth2015-11-2219-17/+22
| | | | | | si_impl.inc that's included in the implementation sections of the si_*.pp units git-svn-id: http://svn.freepascal.org/svn/fpc/branches/svenbarth@32484 3ad0048d-3df7-0310-abae-a5850022a9f2
* sysunixh.inc:svenbarth2015-11-221-0/+6
| | | | | | | * don't use externals for argc, argv and envp if FPC_HAS_INDIRECT_MAIN_INFORMATION is set git-svn-id: http://svn.freepascal.org/svn/fpc/branches/svenbarth@32483 3ad0048d-3df7-0310-abae-a5850022a9f2
* Get rid of calling convention modifier of PascalMain in context of indirect ↵svenbarth2015-11-223-3/+3
| | | | | | | | | | | | | | entry information. rtl/inc/systemh.inc, TEntryInformation: - remove calling convention modifier; PascalMain is generated using the default calling convention of the platform rtl/win32/sysinit.inc: - remove "stdcall;" modifier from PascalMain external rtl/darwin/sysinit.pas: - remove "cdecl;" modifier from PascalMain external git-svn-id: http://svn.freepascal.org/svn/fpc/branches/svenbarth@32482 3ad0048d-3df7-0310-abae-a5850022a9f2
* Get rid of the operatingsystem_result symbol.svenbarth2015-11-222-2/+2
| | | | | | | | | | rtl/inc/systemh.inc: - remove the public name for ExitCode rtl/freebsd/i386/si_crt.inc: * use ExitCode instead of operatingsystem_result git-svn-id: http://svn.freepascal.org/svn/fpc/branches/svenbarth@32481 3ad0048d-3df7-0310-abae-a5850022a9f2
* Generate an error if a unit listed as in "contains" is part of a directly or ↵svenbarth2015-11-221-0/+13
| | | | | | | | | | indirectly required package. pmodules.pas, proc_package: * walk all units and check whether it had been loaded from a package, but is also part of the units of the current module; if so then generate an error git-svn-id: http://svn.freepascal.org/svn/fpc/branches/svenbarth@32480 3ad0048d-3df7-0310-abae-a5850022a9f2
* * msgidx.inc & msgtxt.inc: regenerated after r32478svenbarth2015-11-222-161/+162
| | | | git-svn-id: http://svn.freepascal.org/svn/fpc/branches/svenbarth@32479 3ad0048d-3df7-0310-abae-a5850022a9f2
* + new message for when a unit is listed in the contains section that is ↵svenbarth2015-11-221-0/+3
| | | | | | already part of another package git-svn-id: http://svn.freepascal.org/svn/fpc/branches/svenbarth@32478 3ad0048d-3df7-0310-abae-a5850022a9f2
* Fix inclusion of PPUs that don't have a corresponding object file.svenbarth2015-11-221-9/+2
| | | | | | | | | pkgutil.pas, RewritePPU: * don't abort if a unit does have the flag uf_no_link set * only abort if both uf_static_link and uf_no_link are not set git-svn-id: http://svn.freepascal.org/svn/fpc/branches/svenbarth@32477 3ad0048d-3df7-0310-abae-a5850022a9f2
* Ensure that all implicitely imported units are indeed part of the package.svenbarth2015-11-221-9/+10
| | | | | | | | pmodules.pas, proc_package: * instead of checking the units loaded by the current module we need to check *all* units that are loaded for the package git-svn-id: http://svn.freepascal.org/svn/fpc/branches/svenbarth@32462 3ad0048d-3df7-0310-abae-a5850022a9f2