#1 2020-04-22 13:24:32

George
Member
Registered: 2016-04-05
Posts: 140

Lazarus 2.0.8 & FPC 3.0.4

Hello!

Just installed Lazarus 2.0.8 (win64) which comes with FPC 3.0.4.

Tried to compile sample "04 - HTTP Client-Server".
Can't compile with error: PFPCInterfaceData = TypInfo.PInterfaceData; (SynFPCTypInfo)

Found in documentation:

If you want to use the FPC trunk, please modify line #262 in Synopse.inc to enable the FPC_PROVIDE_ATTR_TABLE conditional and support the latest trunk RTTI changes.
{$if not defined(VER3_0) and not defined(VER3_2) and not defined(VER2)}
    {$define FPC_PROVIDE_ATTR_TABLE} // to be defined since SVN 42356-42411
    // on compilation error in SynFPCTypInfo, undefine the above conditional
    // see https://lists.freepascal.org/pipermail/ … 00612.html
{$ifend}

It is undefined by default.
Unit "typinfo" In FPC 3.0.4, does not contain PInterfaceData (as well as PVmtMethodParam, PIntfMethodTable, PIntfMethodEntry).

So, does this mean, that latest mORMot 1.8 does not support box version of Lazarus and FPC?
As i see, FPC 3.0.4 is not new, and seems, should be supported, because mORMot supports all recent Delphi and FPC is main target for mORMot 2.0.

FPC trunk SVN 40491

Is it actual recommended version from 2018 year?

Can someone clarify?

Last edited by George (2020-04-22 14:51:39)

Offline

#2 2020-04-22 18:32:32

macfly
Member
From: Brasil
Registered: 2016-08-20
Posts: 374

Re: Lazarus 2.0.8 & FPC 3.0.4

Please see this topic:

https://synopse.info/forum/viewtopic.php?id=5361

It seems safe to use FPC 3.2.

I'm using for some weeks and no problem so far.

Offline

#3 2020-04-22 20:00:36

George
Member
Registered: 2016-04-05
Posts: 140

Re: Lazarus 2.0.8 & FPC 3.0.4

Thanks, will try)

Offline

#4 2020-04-23 16:19:34

moctes
Member
From: Mexico
Registered: 2013-05-11
Posts: 129

Re: Lazarus 2.0.8 & FPC 3.0.4

There are snapshots with with fpc 3.2 RC/fixes available here:

Lazarus 2.0.8 - FPC 3.2 RC/FIXES

I haven't tested myself because I'm already on trunk but maybe it's worth trying with them

Offline

#5 2020-04-23 21:25:09

George
Member
Registered: 2016-04-05
Posts: 140

Re: Lazarus 2.0.8 & FPC 3.0.4

Nice, now demo project pass build. 

By the way, 2020-04 lazarus-2.0.8-fpc-3.2.0_fixes-44680 not works.
I can't run empty form project due error (don't work if Application.DoubleBuffered).
If i disable it, error appear in another module. I have many problems with empty project.
Suppose that issue comes from compiler itself.

Will test another version.
---
https://synopse.info/forum/viewtopic.ph … 695#p31695
FPC: "fixes3.2" and Lazarus: "fixes2.0" works.

Last edited by George (2020-04-23 21:55:15)

Offline

#6 2020-04-24 04:51:14

mpv
Member
From: Ukraine
Registered: 2012-03-24
Posts: 1,539
Website

Re: Lazarus 2.0.8 & FPC 3.0.4

TApplication is a partt of Lazarus (LCL) sources, so most likely DoubleBuffered is a Lazarus problem, not a compiler.

Offline

#7 2020-04-24 08:38:43

George
Member
Registered: 2016-04-05
Posts: 140

Re: Lazarus 2.0.8 & FPC 3.0.4

It may be a lot of bugs in Lazarus or just one bug with cardinal values in compiler.
Since 2.0.8 is stable version, more likely it was bug in compiler.

Offline

#8 2020-04-24 15:39:40

George
Member
Registered: 2016-04-05
Posts: 140

Re: Lazarus 2.0.8 & FPC 3.0.4

program test;

{$mode objfpc}
{$H+}

begin
  // don't show empty heaptrc output
  {$IF DECLARED(GlobalSkipIfNoLeaks)}
  GlobalSkipIfNoLeaks := True;
  {$ENDIF}
  WriteLn('Hello, from lazarus!');
  ReadLn;
end.

Release build, disabled debug.
Stock Lazarus 2.0.8 + FPC 3.0.4; cross to win32 = 31,0 KB (exe size)
Lazarus: "fixes2.0" + FPC "fixes3.2" (fpcupdeluxe); cross to win32 = 33,0 KB (exe size)

2 kb diff. What it could be?

Offline

#9 2020-04-24 15:55:09

macfly
Member
From: Brasil
Registered: 2016-08-20
Posts: 374

Re: Lazarus 2.0.8 & FPC 3.0.4

I believe that these differences between versions are normal. And this difference is still small.

To find out what's more, you would have to compare the source code between the versions.

Offline

#10 2020-04-24 16:40:19

George
Member
Registered: 2016-04-05
Posts: 140

Re: Lazarus 2.0.8 & FPC 3.0.4

you would have to compare the source code between the versions.

If you mean ASM, then unfortunately, i have no enough practice to make decision that additional 2kb comes due compiler or LCL changes, and not comes from fpcupdeluxe.
Here is ASM for both files, in case someone can and would like to check)
test (onlinedisassembler)
test_fpcupdeluxe (onlinedisassembler)

Last edited by George (2020-04-24 16:41:08)

Offline

#11 2020-04-24 17:00:53

macfly
Member
From: Brasil
Registered: 2016-08-20
Posts: 374

Re: Lazarus 2.0.8 & FPC 3.0.4

Just out of curiosity, why do you believe this difference was caused by fpcdeluxe (which is just an installer)?

It is absolutely normal, for me, to have a difference, as they are different versions of the compiler and Lazarus.

Or did I get it wrong and is it the same version of Lazarus + FPC?

Offline

#12 2020-04-24 17:25:17

George
Member
Registered: 2016-04-05
Posts: 140

Re: Lazarus 2.0.8 & FPC 3.0.4

Well, this message says that new compiler even better and produce smaller code.
Second point, while fpcupdeluxe works, which is awesome, it has "specific look" and does a lot operations that make some caution feeling, especially when use it first time.
I decided to try it in my DEV machine when found, that AB recommended this tool.
You may say, fpcupdeluxe is open source, 100% safe. It downloads sources on the fly and compile it.
So, it's just some portion of caution smile

About difference, 2kb is nothing.
Especially if compare sizes of .net applications (with all required deps).

Last edited by George (2020-04-24 17:58:43)

Offline

#13 2020-04-24 17:44:04

macfly
Member
From: Brasil
Registered: 2016-08-20
Posts: 374

Re: Lazarus 2.0.8 & FPC 3.0.4

Got it.

But it is difficult to make this comparison because they are different versions of FPC and Lazarus.
If you believe that something has been added by fpcdeluxe  "in background" the ideal would be to compile with the same version.
The difference should only be the setup with and without fpcdeluxe.

NOTE: If this test project is a console application, and you have not added the LCL as a dependency, I believe it is not using the LCL.

Offline

#14 2020-04-24 21:56:39

urhen
Member
Registered: 2020-02-13
Posts: 36

Re: Lazarus 2.0.8 & FPC 3.0.4

AFAIK FPC got a lot new optimizations which require more bytes (bigger opcode) in the binary but are faster on the CPU. It also know new extensions like AVX etc.
I doubt that fpcupdeluxe adds anything suspicious to your compiler but you still can use the makefiles and build FPC with that.

Offline

Board footer

Powered by FluxBB