- remove accidentally commited debug output

git-svn-id: http://svn.freepascal.org/svn/fpc/branches/svenbarth@29006 3ad0048d-3df7-0310-abae-a5850022a9f2
Remove need to export FPC_EMPTYINTF variable.

compiler/ncgvmt.pas, TVMTWriter:
  * writevmt: write ordinal 1 instead of address to FPC_EMPTYINTF, because we wouldn't be able to correctly handle the indirect symbol here
rtl/inc/objpas.inc:
  + new constant emptyintfptr which contains either the address of emptyintf (for 2.6.x) or an ordinal 1
  * InitInterfacePointers, TObject.InitInstance, TObject.GetInterfaceEntry & TObject.GetInterfaceEntryByStr: instead of checking for @emptyintf we check for emptyintfptr

git-svn-id: http://svn.freepascal.org/svn/fpc/branches/svenbarth@29007 3ad0048d-3df7-0310-abae-a5850022a9f2
Fix threadvar handling.

compiler/ngenutil.pas, tnodeutils:
  * InsertThreadvarTablesTable: reference the indirect symbol instead of the direct one
  * InsertThreadvars: write the indirect symbol to the threadvar list
rtl/inc/threadvr.inc: 
  * TltvInitTablesTable: use an additional indirection for the table for 2.7.1 and newer
  * init_all_unit_threadvars & copy_all_unit_threadvars: correctly dereference the table for 2.7.1 and newer
  

git-svn-id: http://svn.freepascal.org/svn/fpc/branches/svenbarth@29008 3ad0048d-3df7-0310-abae-a5850022a9f2
Avoid the need to import/export _FPC_SysInstance and _FPC_TlsKey.

inc/systemh.inc, TEntryInformation:
  + add new, optional field Platform which a target can use to provide additional information through the entry information
win/sysosh.inc:
  + new type TPlatformEntryInformation which contains a pointer to the SysInstance and TlsKey variables of the program/library module
win32/sysinit.inc:
  * provide storage for SysInstance instead of importing it
  * provide storage for TlsKey
  * set up SysInstanceAddr and TlsKey of the entry information accordingly
win32/system.pp:
  - don't export SysInstance anymore
  * initialize Platform.SysInstanceAddr and Platform.TlsKeyAddr
  * use Platform.SysInstanceAddr^ instead of SysInstance to store/retrieve the current instance value
win/systhrd.inc:
  + in case of indirect entry information add a new property TlsKey that uses EntryInformation.Platform.TlsKeyAddr
  - disable TLSKey variable if indirect entry information is used
win/systlsdir.inc:
  * in case of indirect entry information we use an absolute to the new TlsKeyVar of sysinit.inc instead of an imported variable

git-svn-id: http://svn.freepascal.org/svn/fpc/branches/svenbarth@29009 3ad0048d-3df7-0310-abae-a5850022a9f2
Fix usage of threadvars.

Note: In a Win32 application InitHeap and InitSystemThreads is called before the entrypoint from the TLS entrypoint. In that case entry information is not initialized yet (thus TLSKeyAddr is Nil). Because of this that case needs to be handled specially.

compiler/ncgld.pas, tcgloadnode:
  * pass_generate_code: use the indirect symbols for FPC_THREADVAR_RELOCATE and the threadvar to load
rtl/win/systhrd.inc:
  * GetTLSKey: check whether TLSKeyAddr is assigned and return $fffffff otherwise (to have the remaining initialization work correctly)
  * SetTLSKey: check whether TLSKeyAddr is assigned and ignore the setting otherwise
rtl/win/systlsdir.inc:
  * Exec_Tls_Callback: manually allocate the TLS key
rtl/win32/sysinit.inc:
  * ensure that FPC_HAS_INDIRECT_MAIN_INFORMATION is defined

git-svn-id: http://svn.freepascal.org/svn/fpc/branches/svenbarth@29013 3ad0048d-3df7-0310-abae-a5850022a9f2
- reduce debug output a bit

git-svn-id: http://svn.freepascal.org/svn/fpc/branches/svenbarth@29014 3ad0048d-3df7-0310-abae-a5850022a9f2
Start to use package related messages

git-svn-id: http://svn.freepascal.org/svn/fpc/branches/svenbarth@29015 3ad0048d-3df7-0310-abae-a5850022a9f2
Fix usage of interfaces declared in units that are part of a package.

compiler/ncgvmt.pas, TVMTWriter:
  * writeinterfaceids: generate indirect symbol for IID and IIDSTR symbols
  * intf_gen_intf_ref: use indirect symbol for IID and IIDSTR symbols
rtl/inc/objpash.inc:
  * tinterfaceentry: use pointer to PGUID and to PShortString to accomodate for\
 indirect symbol
rtl/inc/objpas.inc, TObject:
  * GetInterfaceEntry: correctly dereference IID of the tinterfaceentry
  * GetInterfaceEntryByStr: correctly dereference IIDSTR of the tinterfaceentry


git-svn-id: http://svn.freepascal.org/svn/fpc/branches/svenbarth@29029 3ad0048d-3df7-0310-abae-a5850022a9f2
+ add a error message for specifying a package multiple times


git-svn-id: http://svn.freepascal.org/svn/fpc/branches/svenbarth@29036 3ad0048d-3df7-0310-abae-a5850022a9f2
Fix a potential access violation when exporting symbols on a Unix based system.

expunix.pas, texportlibunix:
  * generatelib: check whether hp2.sym is really assigned before accessing it


git-svn-id: http://svn.freepascal.org/svn/fpc/branches/svenbarth@29037 3ad0048d-3df7-0310-abae-a5850022a9f2
Add a possibility to track if a unit was loaded from a package.

fmodule.pas, tmodule:
  + new field "package" which is Nil if the unit is not (yet) part of a package or a reference to the package this unit was loaded from
fppu.pas, tppumodule:
  * loadfrompackage: set the "package" field of the module to the package it's loaded from.


git-svn-id: http://svn.freepascal.org/svn/fpc/branches/svenbarth@29038 3ad0048d-3df7-0310-abae-a5850022a9f2
Ensure that units loaded from a package are not recompiled if the source files should happen to be available.

fppu.pas, tppumodule:
  loadppu: set the state to ms_compiled instead of ms_load if the unit was loaded from a package (additionally close the PPU file as it's no longer needed)


git-svn-id: http://svn.freepascal.org/svn/fpc/branches/svenbarth@29039 3ad0048d-3df7-0310-abae-a5850022a9f2
Add support for reading/writing required packages from/to the PCP file

fpcp.pas, tpcppackage:
  + new methods writerequiredpackages and readrequiredpackages
  * loadpcp: use readrequiredpackages
  * savepcp: use writerequiredpackages
pcp.pas:
  * increase PCP version


git-svn-id: http://svn.freepascal.org/svn/fpc/branches/svenbarth@29040 3ad0048d-3df7-0310-abae-a5850022a9f2
When compiling a package, handle only those units that are not yet part of a package.

pmodules.pas, proc_package:
  * only export units that are part of the package
  * only add units to the package if they are really part of the package
  * don't rewrite the PPU if the unit is not part of the package
  * don't link the unit's files if it is not part of the package


git-svn-id: http://svn.freepascal.org/svn/fpc/branches/svenbarth@29041 3ad0048d-3df7-0310-abae-a5850022a9f2
Add support for parsing required packages.

pkgutil.pas:
  + new function add_package to add a package to the list of available packages with the possibility to check for duplicates
  * load_packages: also load all required packages
pmodules.pas, proc_package:
  * create the tpcppackage instance earlier (and use the module name as read from the source file as package name)
  * clear the list of packages in case the user passed any using -FPxxx
  * parse the "requires" section like a list of units and add each full identifier as a package to load
  * before parsing the "contains" section load all packages, so that all units can be correctly resolved


git-svn-id: http://svn.freepascal.org/svn/fpc/branches/svenbarth@29042 3ad0048d-3df7-0310-abae-a5850022a9f2
Correctly create import libraries for packages as well.

pkgutil.pas, createimportlibfromexternals:
  * instead of processing units without the uf_in_library flag, only process those that don't have a package reference set (thus becoming part of the program/library or the package)
  - remove unneeded "pkg" parameter
pmodules.pas:
  + proc_package: create the import library if the package requires other packages
  * proc_program: adjust call to createimportlibfromexternals


git-svn-id: http://svn.freepascal.org/svn/fpc/branches/svenbarth@29043 3ad0048d-3df7-0310-abae-a5850022a9f2
Ensure that the reference to the System unit is correctly set up for packages. Among other things this is needed to compile a package with the -gl option (though debug information doesn't work yet).

pmodules.pas:
  * convert AddUnit to a function and let it return the newly loaded module
  * proc_package: when parsing the contained units ensure that we correctly set up the System unit reference if we are to contain the System unit
  * proc_package: also set up the System unit reference once all units are loaded and this hasn't happened yet (because all contained units are already compiled)


git-svn-id: http://svn.freepascal.org/svn/fpc/branches/svenbarth@29044 3ad0048d-3df7-0310-abae-a5850022a9f2