Commit Graph

38341 Commits

Author SHA1 Message Date
pierre
42586baa34 Use SUPPORT_SAFECALL conditional
git-svn-id: trunk@22488 -
2012-09-27 15:57:40 +00:00
pierre
f36c769c2f + Add SUPPORT_SAFECALL conditional
git-svn-id: trunk@22487 -
2012-09-27 15:56:20 +00:00
pierre
2f24527ea0 Enable gotvarsym for sparc cpu
git-svn-id: trunk@22486 -
2012-09-27 15:55:07 +00:00
pierre
e2f5e11778 Add tf_pic_uses_got for sparc linux and sparc solaris
git-svn-id: trunk@22485 -
2012-09-27 15:54:21 +00:00
pierre
20c9d19764 Add PIC specific code
git-svn-id: trunk@22484 -
2012-09-27 15:50:31 +00:00
pierre
62356c0e17 + add support for unlimited PIC mode
git-svn-id: trunk@22483 -
2012-09-27 15:50:02 +00:00
pierre
abef064786 Adapt TSigContext to structure found by debugging
git-svn-id: trunk@22482 -
2012-09-27 15:49:13 +00:00
pierre
5deddaec8c Adapt TSigContext to structure found by debugging
git-svn-id: trunk@22481 -
2012-09-27 15:48:54 +00:00
pierre
333dec347c Regenerate after: Use "-K PIC" for assembler call if pic mode is selected
git-svn-id: trunk@22480 -
2012-09-27 15:47:47 +00:00
pierre
543cf7e78b Use "-K PIC" for assembler call if pic mode is selected
git-svn-id: trunk@22479 -
2012-09-27 15:47:31 +00:00
pierre
141b1340fb + Handle PIC code for unlimited GOT size
git-svn-id: trunk@22478 -
2012-09-27 15:45:54 +00:00
pierre
5bbd9597e0 + Add handling of PIC mode with unlimited GOT size
git-svn-id: trunk@22477 -
2012-09-27 15:45:00 +00:00
pierre
1621ae2835 Allow safecall calling convention for sparc
git-svn-id: trunk@22476 -
2012-09-27 15:44:03 +00:00
pierre
e0ff818a51 * Handle addr_pic { for small GOT table with GOT13 relocations, limited to 8K table }
+ Add $PIC to assembler commmandline.

git-svn-id: trunk@22475 -
2012-09-27 15:43:22 +00:00
pierre
0ed6c20451 Use -K PIC instead of -KPIC for pic mode
git-svn-id: trunk@22474 -
2012-09-27 15:42:35 +00:00
pierre
fbd5d13b9f Allow correct parsing of ld [%g1 + %l7], %g1
git-svn-id: trunk@22473 -
2012-09-27 15:35:44 +00:00
pierre
934980ec62 Record filepos in TInstruction class, to avoid problems with wrong source lines
in GDB for assembler instructions followed by {$ifdef XXX} lines.

git-svn-id: trunk@22472 -
2012-09-27 15:34:20 +00:00
marco
aa7a980a6f * patch for mantis #22371 TTimeField.SetAsString stores data as NativeFormat corrupting time fields
git-svn-id: trunk@22471 -
2012-09-27 11:16:25 +00:00
michael
f019e004ce * Patch to add support for charset (bug 22985)
git-svn-id: trunk@22470 -
2012-09-27 09:10:08 +00:00
Jonas Maebe
032d96b415 * re-added aasmdata because it's required when compiling a compiler for the
jvm target

git-svn-id: trunk@22469 -
2012-09-27 08:59:09 +00:00
michael
10b5d31fc1 Patch to fix type (Bug ID 22994)
git-svn-id: trunk@22468 -
2012-09-27 08:09:20 +00:00
Jonas Maebe
92064356f0 * prevent code page conversion in CharInSet(widechar,tsyscharset)
git-svn-id: trunk@22464 -
2012-09-26 20:46:19 +00:00
Jonas Maebe
91d92c4732 * make ansistring unique when changing the code page without conversion
(like on other platforms)

git-svn-id: trunk@22463 -
2012-09-26 19:48:37 +00:00
svenbarth
54c1e638ad Fix for Mantis #22428.
* pgenutil.pas, generate_specialization:
  * return a generrordef instead of Nil when returning because of an error
  * always check "genname" for a generic count string as a mode ObjFPC generic specialized in a mode Delphi unit will already contain a "$X" suffix and only symname will be set.
+ add (corrected) test

git-svn-id: trunk@22462 -
2012-09-26 15:03:37 +00:00
Jonas Maebe
e3b97d99c6 * fixed memory leaks in case a TP-style object inherits from another object
type that contains managed types, but this child doesn't contain any
    managed type itself (since r16632, the parent should be considered as a
    field of the child in terms of needing initialization/finalization)

git-svn-id: trunk@22461 -
2012-09-26 14:26:00 +00:00
michael
2cd78c03b3 * Fix for bug ID #0022986
git-svn-id: trunk@22460 -
2012-09-26 14:17:31 +00:00
Jonas Maebe
10d4b8e66f * added "HaltOnNotReleased:=true;" so test exits with an error if not all
memory is released

git-svn-id: trunk@22459 -
2012-09-26 14:16:19 +00:00
pierre
cb123a6376 * Fix compilation for targets without process unit
git-svn-id: trunk@22458 -
2012-09-26 11:48:15 +00:00
florian
46bf1823b8 * fixed/cleaned up lazarus project file
git-svn-id: trunk@22457 -
2012-09-25 18:53:11 +00:00
svenbarth
e04fae2c67 Remove commented variables which strangely weren't detected by a "make cycle"...
git-svn-id: trunk@22456 -
2012-09-25 11:52:10 +00:00
svenbarth
582f1d04b8 Added %NORUN flag.
git-svn-id: trunk@22455 -
2012-09-25 10:27:34 +00:00
svenbarth
2414c55ca0 Fix for Mantis #21538.
* defcmp.pas, compare_defs_ext: 
  use the new genericparas list to check whether two specializations of the same generic can be considered equal
+ added test

git-svn-id: trunk@22454 -
2012-09-25 10:25:30 +00:00
svenbarth
03493a4d31 Added tests for now fixed Mantis #22427.
git-svn-id: trunk@22453 -
2012-09-25 10:10:28 +00:00
svenbarth
88af293155 Fix for Mantis #22160
The cause of the internal error was the following:
We have a generic in an unit ("A") which uses another unit ("B") in the implementation section and this other unit uses unit A in the interface section. Now the generic is specialized in the interface section of B. This leads to the problem that in unit A when it tries to load the globalsymtable of unit B that globalsymtable will be Nil, because parsing of the interface section is not yet finished. Thus the change in pgenutil.pas, specialization_init: if the unit is still "in_interface" the localsymtable needs to be used instead of the globalsymtable.

This doesn't necessarily lead to a compiling test though, as there is the following possibility:
Unit A contains a generic class/record (with methods) and uses unit B in the implementation section. This unit B also contains a generic class/record (with methods) and uses unit A in the implementation section. Both units contain a specialization of the other unit's generic outside of it's own generics (such that generate_specialization is fully triggered). Let's assume compilation starts with unit A and we reach the uses of unit B. Now compilation switches to unit B and completes as unit A is already registered and in compilation. The problem now is that the generic in unit A still contains unresolved forward declarations as the implementation section of A was not yet parsed which will lead to "forward declaration not solved" errors (Note: Delphi compiles this).

The solution to this is the following: if a generic is specialized from another unit which is not in state ms_compiled then the unit of the specialization needs to wait for the unit of the generic. So the specialization's unit adds itself into a list of waiting units of the generic's unit. Now inside "proc_unit" we need to check whether this module is waiting for other modules and if so avoid "finishing" the unit (which means generating the methods of the specialization, generating assembler code and ultimately freeing the scanner and PPU). Now when the generic's unit finishes we need to check whether other modules are waiting for it and finish them (of course it's a bit more complicated in reality, but that pretty much sums it up).

+ globstat.pas: Added an unit which handles the saving and restoring of the global state which was originally inside "parser.pas, compile" so that Don't Repeat Yourself (DRY) is respected.
* fmodule.pas, tmodule: 
  + add fields to keep track of the units the module is waiting for and which modules are waiting for the module
  + add field for the saved global state (raw pointer to avoid circles)
  + add field for the state which is needed to finish the unit (raw pointer to avoid circles)
  + move the code which was used in "parser.pas, compile" after a module was successfully compiled to the new virtual method "end_of_parsing"
+ fppu.pas, tppumodule.end_of_parsing:
  free the ppufile here
* pgenutil.pas:
  + add new procedure "maybe_add_waiting_unit" which adds the specialization's unit to the waiting list of the generic if that unit is not yet compiled
  * generate_specialization: call the new function when we add a new (true) specialization
  * specialization_init: instead of not adding implementation units at all check whether the unit is still parsing the interface section and add the localsymtable in that case
* pmodules.pas:
  * change "proc_unit" to a function which returns "true" if the unit was already finished (no need to wait for other units)
  + move the code from "proc_unit" from "generate_specialization_procs" on to a new procedure "finish_unit" which
  * this procedure is either called immediately in "proc_unit" if the unit does not need to wait for other units or from "finish_unit" itself if a unit that is waiting for the given unit does no longer wait for another module (special care is taken in proc_unit to avoid circles)
* parser.pas, compile:
  * correctly handle the case if an unit is not finished
  * use the new global state functionality from globstat.pas
  * pay special attention when calling "set_current_module" (see comment at that call)

+ add tests from 22160
+ add test for above mentioned "diamond" case

git-svn-id: trunk@22452 -
2012-09-25 09:45:25 +00:00
pierre
d01ec10f45 Fix tw22326 for mips CPU
git-svn-id: trunk@22451 -
2012-09-24 22:28:54 +00:00
pierre
15f4e1279b Add RS_GP to list of saved registers if pi_needs_got flag is set
git-svn-id: trunk@22450 -
2012-09-24 21:01:47 +00:00
pierre
5b5a5ab7af + Add EXTDEBUG warning if pi_needs_got was not set in pass_1
git-svn-id: trunk@22449 -
2012-09-24 15:54:59 +00:00
pierre
bc04e83b25 Add pi_needs_got to current_procinfo.flags in pass_1 method if a label reference is used
git-svn-id: trunk@22448 -
2012-09-24 15:39:26 +00:00
michael
cd733daaa4 * Take care of locking when reading a file.
git-svn-id: trunk@22447 -
2012-09-24 09:00:52 +00:00
Jonas Maebe
944c1172ee * implementation of fix from r22376 without using introspection
git-svn-id: trunk@22446 -
2012-09-23 21:25:39 +00:00
Jonas Maebe
1a97e61619 * factored out fixref from handle_load_store, and handle indirect symbol
loads for darwin in fixref (used to be done in ncgld, but was removed
    there)

git-svn-id: trunk@22445 -
2012-09-23 21:25:32 +00:00
tom_at_work
71059475f8 GParMake also needs to get passed to allow completion of testsuite when some compilation options are incompatible to the default ones
git-svn-id: trunk@22438 -
2012-09-22 12:54:35 +00:00
Jonas Maebe
dc5c318eeb * fixed compilation with -dTEST_WIN64_SEH after r22433 based on patch by
Cyrax, mantis #22952)

git-svn-id: trunk@22437 -
2012-09-22 12:41:31 +00:00
Jonas Maebe
6402714780 - reverted r22363 (disabling of multi-threaded compilation), didn't notice
the issue had been fixed in r22353

git-svn-id: trunk@22435 -
2012-09-21 22:42:35 +00:00
Jonas Maebe
5ea03973d3 * reject assignments to vecn[rangen] (mantis #22941)
git-svn-id: trunk@22434 -
2012-09-21 22:42:30 +00:00
florian
ca5fabda6d * cleanup some unused units from uses clauses
git-svn-id: trunk@22433 -
2012-09-21 18:53:46 +00:00
Jonas Maebe
6f2c567e37 * don't write '.section' twice for stubs on Darwin/ARM
git-svn-id: trunk@22432 -
2012-09-21 16:28:43 +00:00
pierre
ad45f8be0b Regenerated after: avoid troubles if svnversion is found twice in SEARCHPATH
git-svn-id: trunk@22431 -
2012-09-21 14:32:57 +00:00
pierre
0dc69d5b3e Avoid troubles if svnversion is found twice in SEARCHPATH
git-svn-id: trunk@22430 -
2012-09-21 14:32:33 +00:00
tom_at_work
beca39448a Forgot to add current compiler options to fpmkunit compilation. This leads to the error described in r22397 when e.g. building with -Cfvfpv3 on arm/linux
git-svn-id: trunk@22429 -
2012-09-21 12:13:50 +00:00