Sven Barth wrote:
Am 10.12.2012 17:24, schrieb Mark Morgan Lloyd:
Sven Barth wrote:
Am 10.12.2012 12:15, schrieb Mark Morgan Lloyd:
I'm currently cross-compiling the MacOS RTL for PPC on a PC. I've fixed some trivial issues that had crept in since this was last maintained, some of which affect other targets, but am stuck at the errors below.

/usr/local/src/fpc/fpc-trunk/compiler/ppcXppc -Ur -Tmacos -Ppowerpc -XPpowerpc-macos- -Xr -Ur -Xs -O2 -n -Fi../inc -Fi../powerpc -FE. -FU/usr/local/src/fpc/fpc-trunk/rtl/units/powerpc-macos -dpowerpc -dRELEASE -Us -Sg system.pp text.inc(1789,14) Warning: Implicit string type conversion from "AnsiString" to "UnicodeString" text.inc(2013,44) Warning: Implicit string type conversion with potential data loss from "UnicodeString" to "AnsiString" system.pp(481,2) Warning: User defined: To be implemented - using GetProcessInformation???
system.pp(571) Fatal: Internal error 2003090901
Fatal: Compilation aborted
make[2]: *** [system.ppu] Error 1
make[2]: Leaving directory `/usr/local/src/fpc/fpc-trunk/rtl/macos'

Allowing that system.pp ends at line 570, I presume that something after line 481 is confusing the compiler. Any suggestions would be appreciated.


Not necessarily. It seems to be related to something "external".

You could try the following by adjusting the compiler source: before the internalerror (in compiler/powerpc/agppcmpw.pas) add a "writeln(tasmsymbol(p).typ)" and maybe also a "AsmFlush" so that the assembler file up to the error will be written so you can see in which function the problem exists.

system.pp(481,2) Warning: User defined: To be implemented - using GetProcessInformation???
AT_NONE
system.pp(571) Fatal: Internal error 2003090901
Fatal: Compilation aborted

Hmm... could you output "p.name" as well? maybe that will give us a lead... also two of the viable locations where such a tasmsymbol is created is in compiler/aasmdata.pas in TAsmData.RefAsmSymbol and TAsmData.WeakRefAsmSymbol. So you could writeln something (like what "s" is) in case the result is not assigned...

..
>>> In TAsmData.RefAsmSymbol(), param is "RTTI_$SYSTEM_$$_DEF1351"
>>> In TAsmData.RefAsmSymbol(), param is "U_$SYSTEM_$$_THREADID"
>>> In TAsmData.RefAsmSymbol(), param is "U_$SYSTEM_$$_ERROUTPUT"
>>> In TAsmData.RefAsmSymbol(), param is "U_$SYSTEM_$$_OUTPUT"
>>> In TAsmData.RefAsmSymbol(), param is "U_$SYSTEM_$$_INPUT"
>>> In TAsmData.RefAsmSymbol(), param is "U_$SYSTEM_$$_STDOUT"
>>> In TAsmData.RefAsmSymbol(), param is "U_$SYSTEM_$$_STDERR"
>>> In TAsmData.RefAsmSymbol(), param is "U_$SYSTEM_$$_INOUTRES"
>>> In TAsmData.RefAsmSymbol(), param is "U_$SYSTEM_$$_STACKTOP"
>>> In TAsmData.RefAsmSymbol(), param is "U_$SYSTEM_$$_STACKBOTTOM"
>>> In TAsmData.RefAsmSymbol(), param is "U_$SYSTEM_$$_STACKLENGTH"
>>> In TAsmData.RefAsmSymbol(), param is "U_$SYSTEM_$$_SOFTFLOAT_EXCEPTION_MASK" >>> In TAsmData.RefAsmSymbol(), param is "U_$SYSTEM_$$_SOFTFLOAT_EXCEPTION_FLAGS" >>> In TAsmData.RefAsmSymbol(), param is "U_$SYSTEM_$$_SOFTFLOAT_ROUNDING_MODE"
>>> In TAsmData.RefAsmSymbol(), param is "U_$SYSTEM_$$_EXCEPTADDRSTACK"
>>> In TAsmData.RefAsmSymbol(), param is "U_$SYSTEM_$$_EXCEPTOBJECTSTACK"
>>> In TAsmData.RefAsmSymbol(), param is "U_$SYSTEM_$$_EXCEPTTRYLEVEL"
>>> In TAsmData.RefAsmSymbol(), param is "U_$SYSTEM_$$_FREELISTS"
>>> In TAsmData.RefAsmSymbol(), param is "U_$SYSTEM_$$_READWRITESTRTEXT"
>>> In TAsmData.RefAsmSymbol(), param is "THREADVARLIST_$SYSTEM"
AT_NONE
PBGetCatInfoSync
system.pp(571) Fatal: Internal error 2003090901
Fatal: Compilation aborted

./units/powerpc-macos/system.s is 28 bytes, containing only

        string asis
        aligning off

You could also debug the compiler (copy the command line from the Makefile's output) when compiling the system unit and place a breakpoint on the internalerror and then investigate the "p" variable.

I'm not very good with gdb (noting also Pierre's contribution, but it's probably somewhat ahead of my skills at the moment). How do I get the true name of the place I need to set the breakpoint?

Couldn't you use Lazarus for that? Open the "ppcppc.lpi" project, adjust the command line arguments, compile and run... at least that's how I do my compiler development ;)

OK, I've done a bit of that when I was starting to look at the MIPS compiler a year or so ago. I'll see how far I can get.

[Apropos MIPS: Pierre, any comment on my last mipseb run reported on 29th November?]

--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to