Forum > Other OS

JVM Backend Questions

<< < (2/3) > >>

peter.dell:
Update: I've managed to compile the rtl vor jvm-java.
I think now the RTL would have to be extended to fixe these:


Compiling mads.pas to mads.
mads.pas(364,22) Error: Duplicate identifier "MADS__fpc_intern_recname_171"
mads.pas(369,22) Error: Duplicate identifier "MADS__fpc_intern_recname_171"
mads.pas(375,22) Error: Duplicate identifier "MADS__fpc_intern_recname_171"
mads.pas(380,23) Error: Duplicate identifier "MADS__fpc_intern_recname_171"
mads.pas(386,22) Error: Duplicate identifier "MADS__fpc_intern_recname_171"
mads.pas(392,22) Error: Duplicate identifier "MADS__fpc_intern_recname_171"
mads.pas(398,22) Error: Duplicate identifier "MADS__fpc_intern_recname_171"
mads.pas(404,22) Error: Duplicate identifier "MADS__fpc_intern_recname_171"
mads.pas(411,22) Error: Duplicate identifier "MADS__fpc_intern_recname_171"
mads.pas(419,22) Error: Duplicate identifier "MADS__fpc_intern_recname_171"
mads.pas(424,22) Error: Duplicate identifier "MADS__fpc_intern_recname_171"
mads.pas(429,23) Error: Duplicate identifier "MADS__fpc_intern_recname_171"
mads.pas(434,23) Error: Duplicate identifier "MADS__fpc_intern_recname_171"
mads.pas(439,23) Error: Duplicate identifier "MADS__fpc_intern_recname_171"
mads.pas(1178,20) Error: Wrong number of parameters specified for call to "BlockWrite"
mads.pas(33,11) Error: Found declaration: BlockWrite(var TextFile;const <Formal type>;Int64;var Int64);
mads.pas(1197,5) Error: Wrong number of parameters specified for call to "BlockWrite"
mads.pas(33,11) Error: Found declaration: BlockWrite(var TextFile;const <Formal type>;Int64;var Int64);
mads.pas(1386,30) Error: Wrong number of parameters specified for call to "writeln"
mads.pas(34,11) Error: Found declaration: writeln(ShortString);
mads.pas(37,11) Error: Found declaration: writeln(ShortString;ShortString);
mads.pas(40,11) Error: Found declaration: writeln(ShortString;ShortString;ShortString);
mads.pas(43,11) Error: Found declaration: writeln(TextFile;ShortString;ShortString;ShortString);
mads.pas(1433,15) Error: Identifier not found "FileSize"
mads.pas(1461,27) Fatal: Unknown compilerproc "fpc_get_output". Check if you use the correct run time library.
Fatal: Compilation aborted

Any hints are highly appreciated.

nummer8:
Found a few files:

http://downloads.freepascal.org/fpc/contrib/jvm/

peter.dell:
I've managed to compile the PPMJVM. The Java "build" tools are included. And I also managed to build the RTL for the JVM using a 2nd installation of (stable) FPC where "fpc.exe" is included.

I also add the missing SysUtils etc. functions required by my project.

But now I got to the point where the compiler ends with an access violation.

Common.pas(213,57) Error: Compilation raised exception internally
Fatal: Compilation aborted
An unhandled exception occurred at $004559F6:
EAccessViolation: Access violation
  $004559F6
  $00530A1B
  $00530877
  $00439BD4
  $004F8B1E
  $0057E233
  $005813B1
  $00439C21
  $004161E3

Now the question is how I could get more information what and where it's going wrong. Maybe there are some compile flag that help?

- Peter.

peter.dell:
I was able to narrow the problem space:

  UnsignedOrdinalTypes: array[0..2] of TToken = (BYTETOK, WORDTOK, CARDINALTOK);

works
but

  UnsignedOrdinalTypes = [BYTETOK, WORDTOK, CARDINALTOK];

leads to the exception. Can somebody hint at where in the parser/compiler code I should check?

Leledumbo:

--- Quote from: peter.dell on September 07, 2023, 08:24:52 am ---I was able to narrow the problem space:

  UnsignedOrdinalTypes: array[0..2] of TToken = (BYTETOK, WORDTOK, CARDINALTOK);

works
but

  UnsignedOrdinalTypes = [BYTETOK, WORDTOK, CARDINALTOK];

leads to the exception. Can somebody hint at where in the parser/compiler code I should check?

--- End quote ---
The former is an array, the latter is a set. I don't know where to start looking at the compiler code, but rebuilding the compiler with -gl should at least give you where the exception occurs where you can start debugging the compiler from.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version