Recent

Author Topic: FPC 3.2.0rc1 released!  (Read 39388 times)

AlexTP

  • Hero Member
  • *****
  • Posts: 2383
    • UVviewsoft
Re: FPC 3.2.0rc1 released!
« Reply #75 on: June 16, 2020, 10:25:54 am »
« Last Edit: June 16, 2020, 10:29:01 am by Alextp »

PascalDragon

  • Hero Member
  • *****
  • Posts: 5446
  • Compiler Developer
Re: FPC 3.2.0rc1 released!
« Reply #76 on: June 16, 2020, 01:26:47 pm »
From what I can see revision 41967 (which is even older than your mails) has not been merged back to fixes. So no, FPC 3.2 will not have that fix.

Fred vS

  • Hero Member
  • *****
  • Posts: 3158
    • StrumPract is the musicians best friend
Re: FPC 3.2.0rc1 released!
« Reply #77 on: June 16, 2020, 01:37:49 pm »
Only fpc installed from official FreeBSD pkg is working (fpc 3.0.4).

Code: Bash  [Select][+][-]
  1. $ sudo pkg install fpc
  2. $ sudo pkg install lang/fpc-units

fpc installed from source (3.0.4, 3.2.0 or 3.3.1) produce not working executable.

http://free-pascal-general.1045716.n5.nabble.com/Segmentation-fault-with-cthreads-on-FreeBSD-td5735669.html#a5735673
 
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

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11382
  • FPC developer.
Re: FPC 3.2.0rc1 released!
« Reply #78 on: June 16, 2020, 01:39:43 pm »
Only fpc installed from official FreeBSD pkg is working (fpc 3.0.4).

Code: Bash  [Select][+][-]
  1. $ sudo pkg install fpc
  2. $ sudo pkg install lang/fpc-units

fpc installed from source (3.0.4, 3.2.0 or 3.3.1) produce not working executable.

http://free-pascal-general.1045716.n5.nabble.com/Segmentation-fault-with-cthreads-on-FreeBSD-td5735669.html#a5735673

It works if you make sure ld points to ld.bfd.

Fred vS

  • Hero Member
  • *****
  • Posts: 3158
    • StrumPract is the musicians best friend
Re: FPC 3.2.0rc1 released!
« Reply #79 on: June 16, 2020, 01:43:49 pm »
Quote
It works if you make sure ld points to ld.bfd.

Ha, ok, thanks.

And how do you do this, why FreeBSD pkg do it ok and not gmake MakeFile of fpc source?
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

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11382
  • FPC developer.
Re: FPC 3.2.0rc1 released!
« Reply #80 on: June 16, 2020, 01:49:05 pm »
Quote
It works if you make sure ld points to ld.bfd.

Ha, ok, thanks.

And how do you do this, why FreeBSD pkg do it ok and not gmake MakeFile of fpc source?

pkg install installs prepackaged binaries, probably made on a system with the tweak (or a hack to make FPC call ld.bfd directly) Ports tree is a build only solution

Fred vS

  • Hero Member
  • *****
  • Posts: 3158
    • StrumPract is the musicians best friend
Re: FPC 3.2.0rc1 released!
« Reply #81 on: June 16, 2020, 01:57:33 pm »
Quote
pkg install installs prepackaged binaries, probably made on a system with the tweak (or a hack to make FPC call ld.bfd directly) Ports tree is a build only solution

Hum, ok (I was thinking that you are the creator of the FreeBSD pkg).

Do you think that using the -k parameter could do the trick?

Something like this?:

Code: Pascal  [Select][+][-]
  1. fpc -kld.bfd myprog
« Last Edit: June 16, 2020, 01:59:32 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

trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2020
  • Former Delphi 1-7, 10.2 user
Re: FPC 3.2.0rc1 released!
« Reply #82 on: June 16, 2020, 02:05:58 pm »
I installed FPC 3.04 from source on FreeBSD 12-STABLE r361007 amd64 with no issues.

I have ld soft-linked to ld.bfd.  I also compile the world + kernel without issue.

Quote
trev@shadow [/usr/local/bin] $ ls -l ld*
lrwxr-xr-x   1 root  wheel         6 26 Jan 21:57 ld -> ld.bfd
-r-xr-xr-x   3 root  wheel  11570136 25 Jan 10:01 ld.bfd
-r-xr-xr-x   2 root  wheel   4464056 25 Jan 10:01 ld.gold
-r-xr-xr-x  74 root  wheel       377  5 Oct  2019 ld.lld60
-r-xr-xr-x  83 root  wheel       377  7 Sep  2019 ld.lld80
-r-xr-xr-x  86 root  wheel       377 17 Apr 14:54 ld.lld90
-r-xr-xr-x  74 root  wheel       377  5 Oct  2019 ld64.lld60
-r-xr-xr-x  83 root  wheel       377  7 Sep  2019 ld64.lld80
-r-xr-xr-x  86 root  wheel       377 17 Apr 14:54 ld64.lld90

Fred vS

  • Hero Member
  • *****
  • Posts: 3158
    • StrumPract is the musicians best friend
Re: FPC 3.2.0rc1 released!
« Reply #83 on: June 16, 2020, 02:18:58 pm »
Quote
I have ld soft-linked to ld.bfd.

Thanks for the tip!
[EDIT]
Yes it solves the problems.

But tricky.

On my FreeBSD 12 OS, there are 2 binaries /usr/local/bin/ld.bfd and /usr/local/bin/ld.

And /usr/local/bin/ld is a binary, not a symlink to ld.bfd.

If I may (and this without any hostility, please trust me) it would be great to have a build-in solution in fpc himself.
For example in fpc-compiler code something like this:

Code: Pascal  [Select][+][-]
  1. {$IFDEF freebsd}
  2. // use ld.bfd
  3. {$ENDIF}

With FreeBSD there are only few distros (FreeBSD, Ghost, ...) that use the same architecture, with ld.bfd in same directory, so no risk of incompatibilities.

 
« Last Edit: June 16, 2020, 08:56:11 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: FPC 3.2.0rc1 released!
« Reply #84 on: June 16, 2020, 06:20:11 pm »
For fpc 3.2.0 In /compiler/systems/t_bsd.pas, line 163:

Code: Pascal  [Select][+][-]
  1. procedure TLinkerBSD.SetDefaultInfo;
  2. var
  3.   LdProgram: string='ld';
  4. begin
  5.   if (target_info.system in (systems_openbsd+[system_x86_64_dragonfly]))
  6.  or (target_info.system in (systems_freebsd+[system_x86_64_freebsd])) then      // Add this
  7.    LdProgram:='ld.bfd';
  8.  

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

zamronypj

  • Full Member
  • ***
  • Posts: 133
    • Fano Framework, Free Pascal web application framework
Re: FPC 3.2.0rc1 released!
« Reply #85 on: June 17, 2020, 02:32:17 am »
Issue I report on mailing list

http://free-pascal-general.1045716.n5.nabble.com/Segmentation-fault-with-cthreads-on-FreeBSD-td5735669.html#a5735673

I was using older FreeBSD 12.

Few days ago, I setup new fresh FreeBSD 12.1 installation. Latest binutils (2.33) does not ship with ld.bfd anymore. So symlink ld to ld.bfd workaround does not work anymore.

I install FPC 3.0.4 from source. Initially, it compiles fine but generated executable cause segmentation fault when executed. Compiling same exact program second time however works flawlessly and executable works. I have no idea why.
Fano Framework, Free Pascal web application framework https://fanoframework.github.io
Apache module executes Pascal program like scripting language https://zamronypj.github.io/mod_pascal/
Github https://github.com/zamronypj

Fred vS

  • Hero Member
  • *****
  • Posts: 3158
    • StrumPract is the musicians best friend
Re: FPC 3.2.0rc1 released!
« Reply #86 on: June 17, 2020, 02:44:59 am »
Quote
Latest binutils (2.33) does not ship with ld.bfd anymore. So symlink ld to ld.bfd workaround does not work anymore.

Hello.

Not sure to understand.
Are you saying that binutils (2.33) does not give ld.bfd but ld yes.

And that using ld from binutils (2.33) your program test compiles + runs ok?

« Last Edit: June 17, 2020, 03:08:37 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: FPC 3.2.0rc1 released!
« Reply #87 on: June 17, 2020, 03:07:48 am »
Quote
Not sure to understand.
Are you saying that binutils (2.33) does not give ld.bfd but ld yes.

Hum, I have downloaded last FreeBSD pkg binutils-2.33.1_2,1.txz but it gives here both ld.bfd and ld.

But, warning, it is not impossible that between 2 sub versions, there can be strange change in FreeBSD package.

(And imho the way that FreeBSD manage his packages is **more** than strange.)
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

zamronypj

  • Full Member
  • ***
  • Posts: 133
    • Fano Framework, Free Pascal web application framework
Re: FPC 3.2.0rc1 released!
« Reply #88 on: June 17, 2020, 03:10:42 am »
FreeBSD 12.1 does not have ld.bfd anymore

https://lists.freebsd.org/pipermail/freebsd-current/2018-November/072212.html

A few minutes a go, I just setup another fresh FreeBSD 12.1 X86_64, install FPC 3.0.4 using fpc-3.0.4.x86_64-freebsd11.tar

Using fresh installed FreeBSD and FPC 3.0.4, I compile
Code: Pascal  [Select][+][-]
  1. program test;
  2. {$IFDEF UNIX}
  3. uses cthreads;
  4. {$ENDIF}
  5. begin
  6.      writeln('test');
  7. end.
Compilation works but executable causes segmentation fault. Compiling second time, same segmentation fault.

Then I install binutils

Code: Bash  [Select][+][-]
  1. #pkg install binutils
which install binutils 2.33. Compiling again and this time executable works.

I observe that no ld.bfd binary, and ld still symlink to ld.lld. So I guess it fixed because I install binutils.
Fano Framework, Free Pascal web application framework https://fanoframework.github.io
Apache module executes Pascal program like scripting language https://zamronypj.github.io/mod_pascal/
Github https://github.com/zamronypj

trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2020
  • Former Delphi 1-7, 10.2 user
Re: FPC 3.2.0rc1 released!
« Reply #89 on: June 17, 2020, 03:14:08 am »
Few days ago, I setup new fresh FreeBSD 12.1 installation. Latest binutils (2.33) does not ship with ld.bfd anymore. So symlink ld to ld.bfd workaround does not work anymore.

FreeBSD 12.1-STABLE amd64 r361007.

I just cd /usr/ports/devel/binutils/ and make deinstall && make install and:

Quote
====> Compressing man pages (compress-man)
===>  Installing for binutils-2.33.1_2,1
===>  Checking if binutils is already installed
===>   Registering installation for binutils-2.33.1_2,1
Installing binutils-2.33.1_2,1...

$ ls -l /usr/local/bin/ld*
-r-xr-xr-x   4 root  wheel  11495128 17 Jun 11:10 /usr/local/bin/ld
-r-xr-xr-x   4 root  wheel  11495128 17 Jun 11:10 /usr/local/bin/ld.bfd
-r-xr-xr-x   2 root  wheel   4570328 17 Jun 11:10 /usr/local/bin/ld.gold
-r-xr-xr-x  74 root  wheel       377  5 Oct  2019 /usr/local/bin/ld.lld60
-r-xr-xr-x  83 root  wheel       377  7 Sep  2019 /usr/local/bin/ld.lld80
-r-xr-xr-x  86 root  wheel       377 17 Apr 14:54 /usr/local/bin/ld.lld90
-r-xr-xr-x  74 root  wheel       377  5 Oct  2019 /usr/local/bin/ld64.lld60
-r-xr-xr-x  83 root  wheel       377  7 Sep  2019 /usr/local/bin/ld64.lld80
-r-xr-xr-x  86 root  wheel       377 17 Apr 14:54 /usr/local/bin/ld64.lld90

$ /usr/local/bin/ld -v
GNU ld (GNU Binutils) 2.33.1

$ /usr/local/bin/ld.bfd -v
GNU ld (GNU Binutils) 2.33.1

So, yes, Binutils v2.33.1 does still install ld.bfd as well as an ld binary which is in fact ld.bfd too. My symlink from earlier in the year has been wiped out and replaced with the ld.bfd binary.

 

TinyPortal © 2005-2018