Recent

Author Topic: internal Compiler Error  (Read 1872 times)

paule32

  • Hero Member
  • *****
  • Posts: 645
  • One in all. But, not all in one.
internal Compiler Error
« on: July 09, 2025, 01:18:55 pm »
Hello,
I have a Unit xmm.pas - when I try to compile it:

Code: Bash  [Select][+][-]
  1. T:\a>fpc.exe -dDLLEXPORT -dLANGDEU -dDLLDEBUG -n     -Twin64 -FE. -Fu. -O3 -Os xmm.pas

I get the following Error:

Code: Bash  [Select][+][-]
  1. xmm.pas(17,10) Error: Duplicate identifier "SYSTEM"
  2. xmm.pas(17,10) Error: Compilation raised exception internally
  3. Fatal: Compilation aborted
  4. An unhandled exception occurred at $00000001000615EC:
  5. EAccessViolation: Access violation
  6.   $00000001000615EC
  7.   $0000000100045FFA
  8.   $00000001000461DB
  9.   $000000010019D378
  10.   $000000010003DCE5
  11.   $0000000100017941
  12.   $0000000100001A3D
  13.   $0000000100001A56
  14.   $0000000100014280
  15.   $0000000100001850
  16.   $00007FFD4B2B257D
  17.   $00007FFD4CDEAF08

Line 17:
Code: Pascal  [Select][+][-]
  1. interface

I have attach the source file xmm.pas below the request...
MS-IIS - Internet Information Server, Apache, PHP/HTML/CSS, MinGW-32/64 MSys2 GNU C/C++ 13 (-stdc++20), FPC 3.2.2
A Friend in need, is a Friend indeed.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 12659
  • FPC developer.
Re: internal Compiler Error
« Reply #1 on: July 09, 2025, 02:03:29 pm »
Works fine for me with both trunk and release, but I get compilation errors.

Code: Pascal  [Select][+][-]
  1. c:\testing>fpc -Px86_64 -Twin64 xmm.pas
  2. Free Pascal Compiler version 3.2.2 [2021/05/15] for x86_64
  3. Copyright (c) 1993-2021 by Florian Klaempfl and others
  4. Target OS: Win64 for x64
  5. Compiling xmm.pas
  6. xmm.pas(168,9) Error: Identifier not found "_atomic32"
  7. xmm.pas(174,3) Error: Identifier not found "_atomic32"
  8. xmm.pas(272,13) Error: Identifier not found "xgetmem"
  9. xmm.pas(275,3) Error: Identifier not found "xfillmem"
  10. xmm.pas(453,13) Error: Identifier not found "xfillmem"
  11. xmm.pas(581,3) Error: Identifier not found "xmminit"
  12. xmm.pas(584) Fatal: There were 6 errors compiling module, stopping
  13. Fatal: Compilation aborted
  14. Error: c:\fpc\3.2.2\bin\i386-win32\ppcrossx64.exe returned an error exitcode

Sounds like it is a problem with a custom RTL or so.

Nitorami

  • Hero Member
  • *****
  • Posts: 605
Re: internal Compiler Error
« Reply #2 on: July 09, 2025, 03:13:57 pm »
marcov: Setting -dDLLEXPORT avoids these error messages.

When compiling with Lazarus 2.2.6 (64bit) and FPC3.2.2 under windows, I get this message

"Fatal: Kann system nicht finden verwendet von xmm. Stellen Sie sicher, daß alle .ppu-Dateien eines Packages sich in dessem Ausgabeverzeichnis befinden. ppu im falschen Verzeichnis=C:\lazarus\fpc\3.2.2\units\x86_64-win64\rtl\system.ppu.."

Does that help ?

EDIT: When copying system.ppu across as requested, the message goes away but then the complaint is about objpas.ppu...

EDIT2: When simply copying all x86-win64 ppus across to the program's output directory, the only remaining error is the undeclared identifier MEM_RESERVE.

Wwhat is specific about this code that the compiler seems to expect all ppus in the program's output directory ?
« Last Edit: July 09, 2025, 03:38:48 pm by Nitorami »

Thaddy

  • Hero Member
  • *****
  • Posts: 18729
  • To Europe: simply sell USA bonds: dollar collapses
Re: internal Compiler Error
« Reply #3 on: July 09, 2025, 03:21:04 pm »
Naming your file xmm is a bit like little Bobby drop tables.
Asking for trouble.
« Last Edit: July 09, 2025, 03:22:40 pm by Thaddy »
If Europe sells their USA bonds the USD will collapse. Europe can affort that given average state debts. The USA can't affort that. Just an advice...

paule32

  • Hero Member
  • *****
  • Posts: 645
  • One in all. But, not all in one.
Re: internal Compiler Error
« Reply #4 on: July 09, 2025, 05:25:14 pm »
the Problem lay in the using of Command Line Options...

I have to use always -B (build all new) - then I compile/work
When I use without   -B (and with -Ur) - problems begin
When I use with  -Us -Ur the problems begin, too - but a little bit other than the line above ...

It is not a problem, that I share the source code.
The thinking is an artefact on fibodev, he would not public his code - but now, he give me green light to publish it.
MS-IIS - Internet Information Server, Apache, PHP/HTML/CSS, MinGW-32/64 MSys2 GNU C/C++ 13 (-stdc++20), FPC 3.2.2
A Friend in need, is a Friend indeed.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 12659
  • FPC developer.
Re: internal Compiler Error
« Reply #5 on: July 09, 2025, 06:38:30 pm »
marcov: Setting -dDLLEXPORT avoids these error messages.

When compiling with Lazarus 2.2.6 (64bit) and FPC3.2.2 under windows, I get this message

"Fatal: Kann system nicht finden verwendet von xmm. Stellen Sie sicher, daß alle .ppu-Dateien eines Packages sich in dessem Ausgabeverzeichnis befinden. ppu im falschen Verzeichnis=C:\lazarus\fpc\3.2.2\units\x86_64-win64\rtl\system.ppu.."

I have a default FPC 32+64 install, and it works fine, but:

Code: Pascal  [Select][+][-]
  1. Free Pascal Compiler version 3.3.1 [2025/06/12] for x86_64
  2. Copyright (c) 1993-2025 by Florian Klaempfl and others
  3. Target OS: Win64 for x64
  4. Compiling xmm.pas
  5. xmm.pas(236,71) Error: Identifier not found "MEM_RESERVE"
  6. xmm.pas(584) Fatal: There were 1 errors compiling module, stopping
  7. Fatal: Compilation aborted
  8. Error: c:\pp64\bin\x86_64-win64\ppcx64.exe returned an error exitcode
  9.  

Quote
EDIT: When copying system.ppu across as requested, the message goes away but then the complaint is about objpas.ppu...

That is normal, that is the "system" unit add-on for Delphi and objfpc modes.

Quote
EDIT2: When simply copying all x86-win64 ppus across to the program's output directory, the only remaining error is the undeclared identifier MEM_RESERVE.

Wwhat is specific about this code that the compiler seems to expect all ppus in the program's output directory ?

Any compilation expects the RTL to be reachable. This is normally done by the -Fu line in fpc.cfg which is done by the installer.

paule32

  • Hero Member
  • *****
  • Posts: 645
  • One in all. But, not all in one.
Re: internal Compiler Error
« Reply #6 on: July 09, 2025, 06:52:47 pm »
Code: Bash  [Select][+][-]
  1. T:\a>grep MEM_RE *.pas
  2. File windows.pas:
  3.   MEM_RESERVE     = $00002000;

The current Code state: https://github.com/minifpc/miniRTL/tree/main
MS-IIS - Internet Information Server, Apache, PHP/HTML/CSS, MinGW-32/64 MSys2 GNU C/C++ 13 (-stdc++20), FPC 3.2.2
A Friend in need, is a Friend indeed.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 12659
  • FPC developer.
Re: internal Compiler Error
« Reply #7 on: July 09, 2025, 09:25:27 pm »
Code: Bash  [Select][+][-]
  1. T:\a>grep MEM_RE *.pas
  2. File windows.pas:
  3.   MEM_RESERVE     = $00002000;

Which you don't USES in unit XMM.


paule32

  • Hero Member
  • *****
  • Posts: 645
  • One in all. But, not all in one.
Re: internal Compiler Error
« Reply #8 on: July 10, 2025, 01:18:13 pm »
@marcov:

can you provide the Command Line inclusive the options, you compile xmm.pas ?

I would be glad when CLI contains -Us and/or -Ur

Thanksfully thanks
MS-IIS - Internet Information Server, Apache, PHP/HTML/CSS, MinGW-32/64 MSys2 GNU C/C++ 13 (-stdc++20), FPC 3.2.2
A Friend in need, is a Friend indeed.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 12659
  • FPC developer.
Re: internal Compiler Error
« Reply #9 on: July 10, 2025, 04:12:36 pm »
Code: Pascal  [Select][+][-]
  1. fpc -Ur -dDLLEXPORT xmm
  2. Free Pascal Compiler version 3.3.1 [2025/06/12] for x86_64
  3. Copyright (c) 1993-2025 by Florian Klaempfl and others
  4. Target OS: Win64 for x64
  5. Compiling xmm.pas
  6. 585 lines compiled, 0.0 sec

Only change I  made is

Code: Pascal  [Select][+][-]
  1. uses windows;

after the interface line.

For the release 32+64 installer I need to select the 64-bit target, so addition -P and -T lines appear:

Code: Pascal  [Select][+][-]
  1. fpc -Px86_64 -Twin64 -Ur -dDLLEXPORT xmm
  2. Free Pascal Compiler version 3.2.2 [2021/05/15] for x86_64
  3. Copyright (c) 1993-2021 by Florian Klaempfl and others
  4. Target OS: Win64 for x64
  5. Compiling xmm.pas
  6. 585 lines compiled, 0.4 sec
  7.  

-Us is not necessary, that should only be used to compile a system unit.
« Last Edit: July 10, 2025, 04:14:36 pm by marcov »

paule32

  • Hero Member
  • *****
  • Posts: 645
  • One in all. But, not all in one.
Re: internal Compiler Error
« Reply #10 on: July 10, 2025, 06:23:32 pm »
you are sure that is all ?
I get the Output below:

Code: Bash  [Select][+][-]
  1. T:\a\miniFPC\TinyFPC>fpc.exe -Px86_64 -Twin64 -Ur -dDLLEXPORT xmm.pas
  2. Free Pascal Compiler version 3.2.2-r0d122c49 [2025/07/05] for x86_64
  3. Copyright (c) 1993-2021 by Florian Klaempfl and others
  4. Target OS: Win64 for x64
  5. Compiling xmm.pas
  6. Compiling windows.pas
  7. Compiling objpas.pas
  8. Compiling system.pas
  9. system.pas(20,1) Fatal: Internal error 2016060303
  10. Fatal: Compilation aborted
  11. Error: C:\FPC\3.2.2\win64\fpc\bin\x86_64-win64\ppcx64.exe returned an error exitcode

Code: Pascal  [Select][+][-]
  1. // ---------------------------------------------------------------------------------------
  2. // Copyright(c) 2025 @paule32 and @fibonacci
  3. // ---------------------------------------------------------------------------------------
  4.  
  5. unit system;
  6.  
  7. {$mode objfpc}{$H+}
  8. {$modeswitch advancedrecords}
  9. {$macro on}
  10.  
  11. // @@todo: reorder functions; interface vs implementation mismatch
  12.  
  13. // system.pas(9,1) Error: Internal error 2016060303
  14.  
  15. // IE 2006012304 means "compile system.pas first", and happens on latest trunk
  16.  
  17. {$WARN 6058 off : Call to subroutine "$1" marked as inline is not inlined}
  18.  
  19. interface  // <-- this is line 20 in system.pas
« Last Edit: July 10, 2025, 06:29:51 pm by paule32 »
MS-IIS - Internet Information Server, Apache, PHP/HTML/CSS, MinGW-32/64 MSys2 GNU C/C++ 13 (-stdc++20), FPC 3.2.2
A Friend in need, is a Friend indeed.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 12659
  • FPC developer.
Re: internal Compiler Error
« Reply #11 on: July 10, 2025, 07:31:25 pm »
Yes, standard FPC 32+64 install.  RTLs are by default never recompiled, so that is on you. To my knowledge the System unit must always be compiled separately with -Us.

paule32

  • Hero Member
  • *****
  • Posts: 645
  • One in all. But, not all in one.
Re: internal Compiler Error
« Reply #12 on: July 10, 2025, 07:32:21 pm »
okay...
after some fruggle work, it seems that I had did done.
The FPC output follows.
Is it possible to presume the Warning's and Note's that appear during the compile ?

Code: Bash  [Select][+][-]
  1. T:\a\miniFPC\TinyFPC>fpc.exe -Px86_64 -Twin64 -Us -Ur -dDLLEXPORT system.pas
  2. Free Pascal Compiler version 3.2.2-r0d122c49 [2025/07/05] for x86_64
  3. Copyright (c) 1993-2021 by Florian Klaempfl and others
  4. Target OS: Win64 for x64
  5. Compiling system.pas
  6. objects.inc(330,3) Note: Local variable "vmt" not used
  7. objects.inc(690,10) Warning: Function result does not seem to be set
  8. objects.inc(725,10) Warning: Function result does not seem to be set
  9. strings.inc(120,3) Note: Local variable "idx" is assigned but never used
  10. strings.inc(210,10) Warning: Function result does not seem to be set
  11. strings.inc(526,47) Warning: function result variable of a managed type does not seem to be initialized
  12. strings.inc(720,10) Warning: Function result does not seem to be set
  13. strings.inc(817,10) Warning: Function result does not seem to be set
  14. unicode.inc(78,10) Warning: Function result does not seem to be set
  15. unicode.inc(258,22) Warning: Arithmetic "+" on untyped pointer is unportable to {$T+}, suggest typecast
  16. ustrings.inc(130,10) Warning: Function result does not seem to be set
  17. system.pas(749,10) Warning: Function result does not seem to be set
  18. system.pas(857,4) Warning: ASM reader switch is not possible inside asm statement, "INTEL" will be effective only for next
  19. system.pas(930,3) Note: Local variable "eletype" is assigned but never used
  20. system.pas(930,12) Note: Local variable "eletypemngd" is assigned but never used
  21. exceptions64.inc(238,3) Note: Local variable "ex_rip" is assigned but never used
  22. exceptions64.inc(239,3) Note: Local variable "except_signal" is
  23. assigned but never used
  24. exceptions64.inc(240,3) Note: Local variable "reset_fpu" is assigned
  25. but never used
  26. 10542 lines compiled, 0.1 sec
  27. 11 warning(s) issued
  28. 7 note(s) issued
  29.                                                                                                                        
  30. T:\a\miniFPC\TinyFPC>fpc.exe -Px86_64 -Twin64 -Ur -dDLLEXPORT xmm.pas
  31. Free Pascal Compiler version 3.2.2-r0d122c49 [2025/07/05] for x86_64
  32. Copyright (c) 1993-2021 by Florian Klaempfl and others
  33. Target OS: Win64 for x64
  34. Compiling xmm.pas
  35. Compiling objpas.pas
  36. Compiling windows.pas
  37. 1532 lines compiled, 0.0 sec
MS-IIS - Internet Information Server, Apache, PHP/HTML/CSS, MinGW-32/64 MSys2 GNU C/C++ 13 (-stdc++20), FPC 3.2.2
A Friend in need, is a Friend indeed.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 12659
  • FPC developer.
Re: internal Compiler Error
« Reply #13 on: July 10, 2025, 09:36:12 pm »
Showing of notes and warnings depends on -v lines in the fpc.cfg.

ALLIGATOR

  • Sr. Member
  • ****
  • Posts: 395
  • I use FPC [main] 💪🐯💪
Re: internal Compiler Error
« Reply #14 on: July 11, 2025, 10:27:44 am »
FPC [git main]

Code: Pascal  [Select][+][-]
  1. C:\fpclaztrunk\fpc\bin\x86_64-win64\fpc.exe -vewnhibq -dDLLEXPORT -n -FuC:\fpclaztrunk\fpc\units\x86_64-win64\rtl xmm.pas

Code: [Select]
(1002) Target OS: Win64 for x64
(3104) Compiling xmm.pas
(1008) 585 lines compiled, 0.0 sec
I may seem rude - please don't take it personally

 

TinyPortal © 2005-2018