Recent

Author Topic: Preparing FPC 3.2.4, point out road blocks now  (Read 38109 times)

FPK

  • Moderator
  • Full Member
  • *****
  • Posts: 118
Preparing FPC 3.2.4, point out road blocks now
« on: October 25, 2021, 07:57:25 am »
Currently we are in the process of preparing the 3.2.4 release, mainly by merging stuff from main into fixes. If there are any problems with 3.2.2 prevent you from using 3.2.2, it is now the time to point this out :), i.e. if you are stuck with 3.0.4 for some reasons.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11382
  • FPC developer.
Re: Preparing FPC 3.2.4, point out road blocks now
« Reply #1 on: October 25, 2021, 09:29:11 am »
Test with the FIXES_3_2 branch, FPC 3.2.3 that is.

AlexTP

  • Hero Member
  • *****
  • Posts: 2384
    • UVviewsoft
Re: Preparing FPC 3.2.4, point out road blocks now
« Reply #2 on: October 25, 2021, 12:49:26 pm »

Fred vS

  • Hero Member
  • *****
  • Posts: 3158
    • StrumPract is the musicians best friend
Re: Preparing FPC 3.2.4, point out road blocks now
« Reply #3 on: October 25, 2021, 02:21:39 pm »
Currently we are in the process of preparing the 3.2.4 release, mainly by merging stuff from main into fixes. If there are any problems with 3.2.2 prevent you from using 3.2.2, it is now the time to point this out :), i.e. if you are stuck with 3.0.4 for some reasons.

Hello.

Nice!

Please, if possible, could you make work -Cg -k-pie -k-znow for Linux?

See here:
https://forum.lazarus.freepascal.org/index.php/topic,56842.0.html

It works perfectly with fpc 3.0.4 and fpc 3.3.1.

You may test it compiling a application using BGRABitmap or Zeos lib, no luck with fpc 3.2.0 or 3.2.2 but ok with fpc 3.0.4 / 3.3.1.

Thanks.

PS: It would be super great if this could be fixed:
https://gitlab.com/freepascal.org/fpc/source/-/issues/32367
But yes, I know, I dream and ask too much for this.

Fre;D
« Last Edit: October 25, 2021, 02:48:53 pm by Fred vS »
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

Fred vS

  • Hero Member
  • *****
  • Posts: 3158
    • StrumPract is the musicians best friend
Re: Preparing FPC 3.2.4, point out road blocks now
« Reply #4 on: October 25, 2021, 02:55:28 pm »
I wonder when the FreeBSD patch will be merged? https://github.com/Alexey-T/CudaText/blob/master/doc/freebsd-v12-support-for-fpc32.patch

Yes, please, mainly changing with this:

Code: Pascal  [Select][+][-]
  1.  if target_info.system in (systems_openbsd+systems_freebsd+[system_x86_64_dragonfly]) then
  2.  LdProgram:='ld.bfd';

And the rest of the patch too. ( Thanks Alex )
« Last Edit: October 25, 2021, 03:56:06 pm by Fred vS »
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

FPK

  • Moderator
  • Full Member
  • *****
  • Posts: 118
Re: Preparing FPC 3.2.4, point out road blocks now
« Reply #5 on: October 25, 2021, 09:08:25 pm »
I wonder when the FreeBSD patch will be merged? https://github.com/Alexey-T/CudaText/blob/master/doc/freebsd-v12-support-for-fpc32.patch

Is this a regression with regard to 3.2.2 or 3.0.4? If not, please do not glutter this thread with unrelated stuff.

AlexTP

  • Hero Member
  • *****
  • Posts: 2384
    • UVviewsoft
Re: Preparing FPC 3.2.4, point out road blocks now
« Reply #6 on: October 25, 2021, 09:10:16 pm »
No, it's not a regression, sorry.

Seenkao

  • Hero Member
  • *****
  • Posts: 546
    • New ZenGL.
Re: Preparing FPC 3.2.4, point out road blocks now
« Reply #7 on: October 25, 2021, 09:34:04 pm »
Сделать обработку оптимизации для каждой ОС. Ссылки и код.

Eng: Do optimization processing for each OS. Links and code:

https://forum.lazarus.freepascal.org/index.php/topic,56719.0.html
FPC 3.2.1, Linux-Debian 10
-al
Code: Pascal  [Select][+][-]
  1.   useEl^.rh2 := ry1 + 30 + 33;
  2. // assembler
  3. //      movaps  %xmm1,%xmm2
  4. //      movq    _$DRAWALL$_Ld1@GOTPCREL(%rip),%rdx
  5. //      addss   (%rdx),%xmm2
  6. //      movq    _$DRAWALL$_Ld48@GOTPCREL(%rip),%rdx
  7. //      addss   (%rdx),%xmm2
  8. //      movss   %xmm2,28(%rax)
  9. .Ll56:
  10.   useEl^.tx21 := rx1 + 5;
  11. // assembler
  12. //      movaps  %xmm0,%xmm2
  13. //      movq    _$DRAWALL$_Ld16@GOTPCREL(%rip),%rdx
  14. //      addss   (%rdx),%xmm2
  15. //      movss   %xmm2,56(%rax)

Interestingly, Delphi considers constants as a Double type, but sums constants at compile time, no matter in what order it go.
From Delphi 10.4 disassembler:
Code: ASM  [Select][+][-]
  1. Project1.dpr.10: R.rh2 := 30 + 33 + D + 28;
  2. 000000000040D51F F3480F5A0580280000 cvtss2sd xmm0,qword ptr [rel $00002880]
  3. 000000000040D528 F20F580528000000 addsd xmm0,qword ptr [rel $00000028]
  4. 000000000040D530 F2480F5AC0       cvtsd2ss xmm0,xmm0
  5. 000000000040D535 F30F1105A38C0000 movss dword ptr [rel $00008ca3],xmm0

Я проверил и для FPC/Lazarus, код получается подобный Delphi. Данная оптимизация работает на Windows. Но не работает на Linux.

При одном и том же коде паскаля это потеря примерно 8% скорости работы кода для Linux (где это используется).

Eng: I also checked for FPC/Lazarus, the code turns out to be similar to Delphi. This optimization works on Windows. But it doesn't work on Linux.

With the same pascal code, this is a loss of about 8% of the code speed for Linux (where it is used).
Rus: Стремлюсь к созданию минимальных и достаточно быстрых приложений.

Eng: I strive to create applications that are minimal and reasonably fast.
Working on ZenGL

FPK

  • Moderator
  • Full Member
  • *****
  • Posts: 118
Re: Preparing FPC 3.2.4, point out road blocks now
« Reply #8 on: October 25, 2021, 09:41:56 pm »
Currently we are in the process of preparing the 3.2.4 release, mainly by merging stuff from main into fixes. If there are any problems with 3.2.2 prevent you from using 3.2.2, it is now the time to point this out :), i.e. if you are stuck with 3.0.4 for some reasons.

Hello.

Nice!

Please, if possible, could you make work -Cg -k-pie -k-znow for Linux?

See here:
https://forum.lazarus.freepascal.org/index.php/topic,56842.0.html

It works perfectly with fpc 3.0.4 and fpc 3.3.1.

Can you please check after baa28faa19 with main/3.3.1? If it helps, I merge it.

Fred vS

  • Hero Member
  • *****
  • Posts: 3158
    • StrumPract is the musicians best friend
Re: Preparing FPC 3.2.4, point out road blocks now
« Reply #9 on: October 25, 2021, 11:47:02 pm »
Can you please check after baa28faa19 with main/3.3.1? If it helps, I merge it.

Hello Florian.

Downloaded commit of today 25/10/2021 23:10 : 5c7974fceb768f96853b4abc05cb122ac8ccfd0c
from https://gitlab.com/freepascal.org/fpc/source main branch.

Compiled + installed = OK.

Using -Cg -k-pie -k-znow for a program with BGRABitmap.

It compiles and link without any warning at linking.  ;D

Quote
Hint: (11030) Start of reading config file /etc/fpc.cfg
Hint: (11031) End of reading config file /etc/fpc.cfg
Free Pascal Compiler version 3.3.1 [2021/10/25] for x86_64
Copyright (c) 1993-2021 by Florian Klaempfl and others
(1002) Target OS: Linux for x86-64
(3104) Compiling strumpract.pas
...
(9015) Linking strumpract
(1008) 567509 lines compiled, 14.7 sec, 4011696 bytes code, 2594736 bytes data
(1021) 184 warning(s) issued
(1022) 3112 hint(s) issued
(1023) 407 note(s) issued

Result:

Code: Bash  [Select][+][-]
  1. fred@fredvs ~> file /home/fred/strumpract/src/strumpract

Quote
/home/fred/strumpract/src/strumpract: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.4.0, stripped

Conclusion, yes, perfect.

Fre;D
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

Fred vS

  • Hero Member
  • *****
  • Posts: 3158
    • StrumPract is the musicians best friend
Re: Preparing FPC 3.2.4, point out road blocks now
« Reply #10 on: October 25, 2021, 11:58:17 pm »
Ooooops, sorry but there is problem.

The program does not run any more with or without -Cg -k-pie -k-znow...  :-\

I try to debug it but not easy, no infos.

Not sure it comes from your commit, I will (try to) find from witch commit.
« Last Edit: October 26, 2021, 12:16:15 am by Fred vS »
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

Fred vS

  • Hero Member
  • *****
  • Posts: 3158
    • StrumPract is the musicians best friend
Re: Preparing FPC 3.2.4, point out road blocks now
« Reply #11 on: October 26, 2021, 02:14:50 am »
Hello.

After high fight I found the commit that makes me problems:
Commit ee10850a of 17 Oct, 2021: Reducing and aligning ...
https://gitlab.com/freepascal.org/fpc/source/-/commit/ee10850a5793b69b19dc82b9c28342bdd0018f2e

Since that commit all my applications do not run anymore.

So maybe your patch for fpc 3.2.4 for -Cg will work but I cannot test it with last trunk 3.3.1 ( because of this ee10850a commit ).

[Out of the subject of the topic]
For msegui and some other console apps (did not test LCL), there is a serious problem since commit ee10850a5793.

« Last Edit: October 26, 2021, 12:32:09 pm by Fred vS »
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

Fred vS

  • Hero Member
  • *****
  • Posts: 3158
    • StrumPract is the musicians best friend
Re: Preparing FPC 3.2.4, point out road blocks now
« Reply #12 on: October 26, 2021, 02:41:05 am »
The last for tonight, I promise.

I did try this:
Use the last trunk 3.3.1 but revert the change done in commit ee10850a ( replace all the files changed by those before commit ee10850a. )

FPC compile + install + run : OK.  :)

My apps: compiling + linking with or without -Cg + running : OK.  ;)
And the pie binary is created and runs too!

So last conclusion: OK for your commit baa28faa19 but not very OK for commit ee10850a.

Fre;D
« Last Edit: October 26, 2021, 01:30:41 pm by Fred vS »
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

PascalDragon

  • Hero Member
  • *****
  • Posts: 5446
  • Compiler Developer
Re: Preparing FPC 3.2.4, point out road blocks now
« Reply #13 on: October 26, 2021, 08:57:50 am »
PS: It would be super great if this could be fixed:
https://gitlab.com/freepascal.org/fpc/source/-/issues/32367
But yes, I know, I dream and ask too much for this.

This is not a regression and thus this has no place in this thread.

Eng: Do optimization processing for each OS. Links and code:

Is this a regression from 3.0.4 or 3.2.0? If not, then this has no place here.

dbannon

  • Hero Member
  • *****
  • Posts: 2786
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Preparing FPC 3.2.4, point out road blocks now
« Reply #14 on: October 26, 2021, 10:04:35 am »


OK, I pulled down fixes_3_2 from gitlab as a zip file (so fast !) and compiled with my existing FPC3.2.0. Compiled and installed cleanly but -

Code: Pascal  [Select][+][-]
  1. dbannon@dell:~/bin/FPC/fixes_3_2/SRC$ ../bin/fpc -iV
  2. 3.2.0

The version.pas file says -

Code: Pascal  [Select][+][-]
  1.     Copyright (c) 1998-2002 by Florian Klaempfl
  2. ....
  3.     const
  4.        { version string }
  5.        version_nr = '3';
  6.        release_nr = '2';
  7.        patch_nr   = '3';
  8.        minorpatch = '';

I have definitly NOT got my existing fpc -

Code: Pascal  [Select][+][-]
  1. dbannon@dell:~/bin/FPC$ ls -l fpc-3.2.0/bin/fpc
  2. -rwxr-xr-x 1 dbannon dbannon 513952 Jun 15  2020 fpc-3.2.0/bin/fpc
  3. dbannon@dell:~/bin/FPC$ ls -l fixes_3_2/bin/fpc
  4. -rwxr-xr-x 1 dbannon dbannon 518512 Oct 26 18:47 fixes_3_2/bin/fpc


Should I be surprised ?  Am I testing what I think I am testing ?

Davo
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

 

TinyPortal © 2005-2018