[fpc-devel] Fatal: Invalid PPU-File entry: 242

Bart bartjunk64 at gmail.com
Thu Apr 30 16:26:54 CEST 2020


Hi,

Given that I have fpctrunk installed in c:\pp
This implies that there is a c:\pp\units\i386-win32\rtl folder and in
that folder there is (a.o.) the file system.ppu

Now I have a test.pas file that simply consists of "begin end."

When I add c:\pp\units\i386-win32\rtl to the units path (yes, I know
that is stupid, but please have a little patience, you'll find out why
later on) and then try to compile test.pas I get confusing results:

fpc 3.2.0RC1
C:\Users\Bart\LazarusProjecten\ConsoleProjecten>fpc -vu
-Fuc:\pp\units\i386-win32\rtl test.pas
Free Pascal Compiler version 3.2.0rc1 [2020/02/29] for i386
Copyright (c) 1993-2020 by Florian Klaempfl and others
Target OS: Win32 for i386
Compiling test.pas
(PROGRAM)  Registering new unit SYSTEM
(PROGRAM)  Load from PROGRAM (implementation) unit SYSTEM
(SYSTEM)   Loading unit SYSTEM
(SYSTEM)   PPU Name: C:\pp\units\i386-win32\rtl\system.ppu
(SYSTEM)   PPU Time: 2020/03/31 22:15:34
(SYSTEM)   PPU Flags: 4224
(SYSTEM)   PPU Crc: 5E999730
(SYSTEM)   PPU Crc: E5978BE9 (intfc)
(SYSTEM)   PPU Crc: E4BD4DAF (indc)
(SYSTEM)   Number of definitions: 3470
(SYSTEM)   Number of symbols: 9654
Fatal: Invalid PPU-File entry: 242
Fatal: Compilation aborted
Error: C:\devel\fpc\3.2.0\bin\i386-Win32\ppc386.exe returned an error exitcode

OK, I point the compiler to the wrong rtl units and it barfs.
I understand that.

Now fpc 3.0.4
C:\Users\Bart\LazarusProjecten\ConsoleProjecten>fpc -vu
-Fuc:\pp\units\i386-win32\rtl test.pas
Free Pascal Compiler version 3.0.4rc1 [2017/07/03] for i386
Copyright (c) 1993-2017 by Florian Klaempfl and others
Target OS: Win32 for i386
Compiling test.pas
(PROGRAM)  Registering new unit SYSTEM
(PROGRAM)  Load from PROGRAM (implementation) unit SYSTEM
(SYSTEM)   Loading unit SYSTEM
(SYSTEM)   PPU Name: C:\pp\units\i386-win32\rtl\system.ppu
(SYSTEM)   PPU Invalid Version 207
^^^^ OK, it rejects that, but it investigates a next candidate
(SYSTEM)   PPU Name: C:\devel\fpc\3.0.4\units\i386-win32\rtl\system.ppu
(SYSTEM)   PPU Time: 2017/07/03 14:35:04
(SYSTEM)   PPU Flags: 159873
(SYSTEM)   PPU Crc: 1898640E
(SYSTEM)   PPU Crc: F0C5F6F0 (intfc)
(SYSTEM)   PPU Crc: D83A3C78 (indc)
(SYSTEM)   Number of definitions: 4852
(SYSTEM)   Number of symbols: 11930
....
(SYSINITPAS) Finished loading unit SYSINITPAS
Linking test.exe
2 lines compiled, 0.1 sec, 25152 bytes code, 1252 bytes data

Now I try to compile with fpc trunk and set the -Fu to the folder that
contians the system.ppu for fpc 3.2.0

C:\Users\Bart\LazarusProjecten\ConsoleProjecten>fpc -vu
-Fuc:\devel\fpc\3.2.0\units\i386-win32\rtl test.pas
Free Pascal Compiler version 3.3.1 [2020/03/31] for i386
Copyright (c) 1993-2020 by Florian Klaempfl and others
Target OS: Win32 for i386
Compiling test.pas
(PROGRAM)  Registering new unit SYSTEM
(PROGRAM)  Load from PROGRAM (implementation) unit SYSTEM
(SYSTEM)   Loading unit SYSTEM
(SYSTEM)   PPU Name: C:\devel\fpc\3.2.0\units\i386-win32\rtl\system.ppu
(SYSTEM)   PPU Invalid Header (no PPU at the begin)
(SYSTEM)   PPU Name: C:\pp\units\i386-win32\rtl\system.ppu
(SYSTEM)   PPU Time: 2020/03/31 22:15:34
(SYSTEM)   PPU Flags: 4224
(SYSTEM)   PPU Crc: 5E999730
(SYSTEM)   PPU Crc: E5978BE9 (intfc)
(SYSTEM)   PPU Crc: E4BD4DAF (indc)
(SYSTEM)   Number of definitions: 3470
(SYSTEM)   Number of symbols: 9654
...
(SYSINITPAS) Finished loading unit SYSINITPAS
Linking test.exe
2 lines compiled, 0.1 sec, 28112 bytes code, 1300 bytes data

So, it seems I can point fpc 3.0.4 and fpc 3.3.1 to the wrong
system.ppu, it will simply ignore it and find the one specified in
fpc.cfg.
Not so for fpc 3.2.0 RC1.

Why is that?

Why did I even test this?
Well, it turns out that when you build Lazarus, at some point the
compiler is called with Fuc:\pp\units\i386-win32\rtl GOK why.
And since I have system.ppu of fpc trunk there, it refuses to build Lazarus.

(Note: If I rename the c:\pp folder, fpc 3.2.0RC1 build Lazarus just fine)

I asked about this on Lazarus devel ML, but got no response there.

So, at this moment in time my main question is:
Is the error that fpc 3.2.0RC1 throws correct?
And, if that is the case: why don't 3.0.4 and trunk error out in
similar conditions?
(Does it only error out if the fouc system.ppu is newer than the
current compiler version?)

-- 
Bart


More information about the fpc-devel mailing list