Recent

Author Topic: FPC 3.2.0 - own system.pas - internal error 200411171  (Read 1586 times)

paulee32

  • New Member
  • *
  • Posts: 18
FPC 3.2.0 - own system.pas - internal error 200411171
« on: October 01, 2020, 07:27:48 am »
Hello,

I played a little bit with FPC, to create own system.pas file.
It seems it will going all well, but I get internal error 200411171.
In the attachment, there are the testfiles.

I tried to compile the sources:  # fpc -Fu. rtl.lpr

Thanks for help.
paule32

Thaddy

  • Hero Member
  • *****
  • Posts: 14205
  • Probably until I exterminate Putin.
Re: FPC 3.2.0 - own system.pas - internal error 200411171
« Reply #1 on: October 01, 2020, 08:37:41 am »
 a simple grep reveals this:
Code: Bash  [Select][+][-]
  1. grep -nHIirF -- 200411171 (in directory: /home/asta/fpc331/compiler)
  2. ./symdef.pas:6999:            internalerror(200411171);
  3. ./symdef.pas:7006:            internalerror(200411171);
  4. Search completed with 2 matches.
Both seem related, but I wonder why there are two! spots with the same internal error. That does not seem correct. (although they are close and cover much the same issue)
Can you detect which of the two is the one you encountered? (I suppose you compile with debug info!)

Note playing with system is asking for trouble. You really need to know what you are doing. (I wrote some of the Delphi system replacements for KOL together with Vladimir Kladov and based on his original. That was not easy and FPC's system unit is even more complex)

Also note the comment at the start of the routine that contains those internal error(s):
Code: Pascal  [Select][+][-]
  1.     procedure tprocdef.setmangledname(const s : TSymStr);
  2.       begin
  3.         { This is not allowed anymore, the forward declaration
  4.           already needs to create the correct mangledname, no changes
  5.           afterwards are allowed (PFV) }
  6.         { Exception: interface definitions in mode macpas, since in that }
  7.         {   case no reference to the old name can exist yet (JM)         }
Which tells us with this combined info it is macpas related.
Considering the comments, I suggest to ask Jonas Maebe (JM) for help. (best place is on the fp-devel list, not on the forum)

« Last Edit: October 01, 2020, 09:18:37 am by Thaddy »
Specialize a type, not a var.

PascalDragon

  • Hero Member
  • *****
  • Posts: 5446
  • Compiler Developer
Re: FPC 3.2.0 - own system.pas - internal error 200411171
« Reply #2 on: October 01, 2020, 09:26:04 am »
a simple grep reveals this:
Code: Bash  [Select][+][-]
  1. grep -nHIirF -- 200411171 (in directory: /home/asta/fpc331/compiler)
  2. ./symdef.pas:6999:            internalerror(200411171);
  3. ./symdef.pas:7006:            internalerror(200411171);
  4. Search completed with 2 matches.
Both seem related, but I wonder why there are two! spots with the same internal error. That does not seem correct. (although they are close and cover much the same issue)
Can you detect which of the two is the one you encountered? (I suppose you compile with debug info!)

Only one of them is active as they reside in different branches of an $ifdef. As they handle the same problem they have the same error code.

I played a little bit with FPC, to create own system.pas file.
It seems it will going all well, but I get internal error 200411171.
In the attachment, there are the testfiles.

compilerproc needs to be declared in both the interface and the implementation section, cause it influences the mangled name which is why the internal error trips.

paulee32

  • New Member
  • *
  • Posts: 18
Re: FPC 3.2.0 - own system.pas - internal error 200411171
« Reply #3 on: October 01, 2020, 12:36:10 pm »
Hello PascalDragon,

that was the solution!
I add the files for creating a 4096 Byte sized .DLL for Windows.
I test it under Windows 10, and the DLL will created.
Now, I test the DLL, if they useable, and not only writen.
In attachments, the files I used for.

compiled with win64 fpc 3.2.0: # fpc -Fu. rtl.lpr

Thanks for helping!

So, I think forward: that this question is solved.
An other topic is the eliminating compiler identifier string in the DLL/.o
But this could be a linker script topic.

fcu

  • Jr. Member
  • **
  • Posts: 89
Re: FPC 3.2.0 - own system.pas - internal error 200411171
« Reply #4 on: October 01, 2020, 02:25:58 pm »
i tested your demo , but i get an error
Code: Pascal  [Select][+][-]
  1. rtl.lpr(3,6) Fatal: Unknown compilerproc "fpc_initializeunits". Check if you us
  2. e the correct run time library.
  3.  

note that i replaced (library) with (program) in top of rtl.lpr file

paulee32

  • New Member
  • *
  • Posts: 18
Re: FPC 3.2.0 - own system.pas - internal error 200411171
« Reply #5 on: October 01, 2020, 03:15:07 pm »
The main topic/meaning was, to create a DLL under Windows 10 with frpc 3.2.0
here the output for e:\fpc -Fu. rtl.lpr

with "library" in mind.

the files:
1. fpintres.pas (  53   Bytes)
2. rtl.pas          (  29   Bytes)
3. sysinit.pas   (  54   Bytes)
4. system.pas  (878  Bytes)
-------------------------------------
total:                1024 Bytes

after # fpc -Fu. rtl.lpr:
1. fpintres.ppu  (    669 Bytes)
2. rtl.o               (  2343 Bytes)
3. sysinit.ppu    (    662 Bytes)
4. system.o       (24952 Bytes)
5. system.ppu   (15679 Bytes)

and last been not lost:  rtl.dll  (4096 Bytes)

PascalDragon

  • Hero Member
  • *****
  • Posts: 5446
  • Compiler Developer
Re: FPC 3.2.0 - own system.pas - internal error 200411171
« Reply #6 on: October 02, 2020, 09:21:25 am »
note that i replaced (library) with (program) in top of rtl.lpr file

Compiling a program requires more runtime functions.

Please also note that essentially all of the RTL functionality is unusable with the provided System unit.

 

TinyPortal © 2005-2018