Recent

Author Topic: Lazarus and FPC on macOS Big Sur 11  (Read 1043 times)

Igor Kokarev

  • Sr. Member
  • ****
  • Posts: 271
Lazarus and FPC on macOS Big Sur 11
« on: November 13, 2020, 01:01:09 pm »
Hi,

I just upgraded macOS Catalina to final macOS Big Sur 11.0.1
with Xcode 12.2 for Intel iMac.

Lazarus 2.0.10 (Cocoa) and FPC 3.2.0 work fine on first glance.

P.S. The only issue I found - no Subversion in Big Sur and Xcode. Brew couldn't install SVN on Big Sur.

mischi

  • Full Member
  • ***
  • Posts: 143
Re: Lazarus and FPC on macOS Big Sur 11
« Reply #1 on: November 13, 2020, 01:14:33 pm »
I favor fink and macports over homebrew. Have a look into them. They act on separate directories and leave /usr/local alone. I expect macports to be there with svn in short time. fink might take a bit longer.

MiR

  • Full Member
  • ***
  • Posts: 118
Re: Lazarus and FPC on macOS Big Sur 11
« Reply #2 on: November 13, 2020, 08:00:25 pm »
I cannot rebuild fpc stable in fpcupdeluxe:

/Users/ring/fpcupdeluxe/fpcbootstrap/ppcx64 -Ur -Xs -O2 -n -Fux86_64 -Fusystems -Fu/Users/ring/fpcupdeluxe/fpcsrc/rtl/units/x86_64-darwin -Fix86_64 -FEx86_64/bin/x86_64-darwin -FUx86_64/units/x86_64-darwin -dRELEASE -WM10.8 -Sg -vw-n-h-l-d-u-t-p-c-   -dREVINC -dx86_64 -dGDB -dBROWSERLOG -Fux86 -Fix86 pp.pas
ld: library not found for -lc


trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1073
  • Former Delphi 1-7, 10.2 User
Re: Lazarus and FPC on macOS Big Sur 11
« Reply #3 on: November 14, 2020, 06:59:52 am »
I just upgraded macOS Catalina to final macOS Big Sur 11.0.1
[...]
P.S. The only issue I found - no Subversion in Big Sur and Xcode. Brew couldn't install SVN on Big Sur.

As I think Jonas pointed out to me, there is no svn in Catalina either (it may remain after an upgrade from Mojave which caught me out - svn was not included in Xcode 11.4 onwards). You can, however, use git for FPC + Lazarus repositories.
o Lazarus v2.1.0 r63871, FPC v3.3.1 r47164, macOS 10.14.6, Xcode 11.3.1
o Lazarus v2.1.0 r64160, FPC v3.3.1 Nov 27 21:16:31, macOS 11.0.1 (aarch64), Xcode 12.2
o Lazarus v2.1.0 r61574, FPC v3.3.1 r42318, FreeBSD 12.1 amd64 (VMware VM)
o Lazarus v2.1.0 r61574, FPC v3.0.4, Ubuntu 20.04 (PD VM)

dbannon

  • Hero Member
  • *****
  • Posts: 1214
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Lazarus and FPC on macOS Big Sur 11
« Reply #4 on: November 14, 2020, 11:04:51 am »
..... You can, however, use git for FPC + Lazarus repositories.

That would be at https://github.com/graemeg
But they are only trunk.  I tend to develop with trunk but do my releases with the latest official release.  If Apple users (other than me, I still use Sierra) cannot get Lazarus release or fixes source, we'll need to do something .....

Davo
Lazarus 2, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng

trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1073
  • Former Delphi 1-7, 10.2 User
Re: Lazarus and FPC on macOS Big Sur 11
« Reply #5 on: November 14, 2020, 11:03:06 pm »
Lazarus release installs come with source. FPC release source is a required download available as an archive. Not sure about fixes as I've never used it. I mostly use trunk for FPC + Lazarus.
o Lazarus v2.1.0 r63871, FPC v3.3.1 r47164, macOS 10.14.6, Xcode 11.3.1
o Lazarus v2.1.0 r64160, FPC v3.3.1 Nov 27 21:16:31, macOS 11.0.1 (aarch64), Xcode 12.2
o Lazarus v2.1.0 r61574, FPC v3.3.1 r42318, FreeBSD 12.1 amd64 (VMware VM)
o Lazarus v2.1.0 r61574, FPC v3.0.4, Ubuntu 20.04 (PD VM)

dbannon

  • Hero Member
  • *****
  • Posts: 1214
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Lazarus and FPC on macOS Big Sur 11
« Reply #6 on: November 14, 2020, 11:51:53 pm »

> Lazarus release installs come with source.
Good, I did not know that, I just use SVN

> FPC release source is a required download available as an archive.
Maybe not an issue as FPC release cycle is a lot slower.

> Not sure about fixes as I've never used it. I mostly use trunk for FPC + Lazarus.
Well, fixes is, effectively, the on going beta of next release. So, pretty important that it be tested in real life situations.

I could get really, really controversial and raise the on going topic of moving to git .....

(he ducks his head quickly.)

Davo
Lazarus 2, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng

Igor Kokarev

  • Sr. Member
  • ****
  • Posts: 271
Re: Lazarus and FPC on macOS Big Sur 11
« Reply #7 on: November 21, 2020, 12:36:10 pm »
Two observations about Big Sur and Lazarus:

1. Lazarus 2.0 fixes branch can't be compiled itself on Apple Silicon (DTK or M1) for aarch64 using FPC 3.2.1 (fixes tree).

Lazarus Trunk can be successfully compiled with FPC 3.3.1 Trunk. So I think that Lazarus Trunk has some corrections for Apple Silicon.

If you plan to compile future Lazarus 2.0.11 for Apple Silicon it necessary to add some corrections.

2. On any Mac with Big Sur. I downloaded Lazarus 2.0 fixes branch from SVN on Intel Mac. Then I zipped sources folder, copy to Windows PC via Dropbox, and then copied ZIP archive to another iMac Intel by local network. Unpacked ZIP. Unpacked Lazarus sources compiled correctly with FPC 3.2.1 fixes branch, but it cannot be launched - macOS says in Terminal that I have no rights to run lazarus (a long message), startlazarus or lazbuild. Even with chmod +x ...
I tried two times to recompile Lazarus.

Then I downloaded again Lazarus 2.0 fixes branch sources via git on this iMac, compiled with the same FPC 3.2.1 fixes, and now everything runs correctly, even without any call of chmod +x ...

So it seems that macOS quarantines downloaded sources and marks app bundles as untrusted. I have no idea why it happens. I have a guess that if re-create APP bundles of Lazarus manually it will solve this strange problem.
« Last Edit: November 21, 2020, 12:43:38 pm by Igor Kokarev »

trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1073
  • Former Delphi 1-7, 10.2 User
Re: Lazarus and FPC on macOS Big Sur 11
« Reply #8 on: November 22, 2020, 02:00:57 am »
You may need to grant various things "Full Disk Access" in the Preferences > Security & Privacy - Privacy tab in Big Sur - at least that was my experience during the betas when copying executable files/apps from elsewhere.
o Lazarus v2.1.0 r63871, FPC v3.3.1 r47164, macOS 10.14.6, Xcode 11.3.1
o Lazarus v2.1.0 r64160, FPC v3.3.1 Nov 27 21:16:31, macOS 11.0.1 (aarch64), Xcode 12.2
o Lazarus v2.1.0 r61574, FPC v3.3.1 r42318, FreeBSD 12.1 amd64 (VMware VM)
o Lazarus v2.1.0 r61574, FPC v3.0.4, Ubuntu 20.04 (PD VM)

adderthorn

  • New Member
  • *
  • Posts: 11
Re: Lazarus and FPC on macOS Big Sur 11
« Reply #9 on: November 24, 2020, 09:06:04 pm »
Two observations about Big Sur and Lazarus:

1. Lazarus 2.0 fixes branch can't be compiled itself on Apple Silicon (DTK or M1) for aarch64 using FPC 3.2.1 (fixes tree).

Lazarus Trunk can be successfully compiled with FPC 3.3.1 Trunk. So I think that Lazarus Trunk has some corrections for Apple Silicon.

If you plan to compile future Lazarus 2.0.11 for Apple Silicon it necessary to add some corrections.

2. On any Mac with Big Sur. I downloaded Lazarus 2.0 fixes branch from SVN on Intel Mac. Then I zipped sources folder, copy to Windows PC via Dropbox, and then copied ZIP archive to another iMac Intel by local network. Unpacked ZIP. Unpacked Lazarus sources compiled correctly with FPC 3.2.1 fixes branch, but it cannot be launched - macOS says in Terminal that I have no rights to run lazarus (a long message), startlazarus or lazbuild. Even with chmod +x ...
I tried two times to recompile Lazarus.

Then I downloaded again Lazarus 2.0 fixes branch sources via git on this iMac, compiled with the same FPC 3.2.1 fixes, and now everything runs correctly, even without any call of chmod +x ...

So it seems that macOS quarantines downloaded sources and marks app bundles as untrusted. I have no idea why it happens. I have a guess that if re-create APP bundles of Lazarus manually it will solve this strange problem.

How did you compile on ASi? Did you build FPC on the ASi mac first or cross compile?

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2532
    • havefunsoft.com
Re: Lazarus and FPC on macOS Big Sur 11
« Reply #10 on: November 24, 2020, 09:30:46 pm »
How did you compile on ASi? Did you build FPC on the ASi mac first or cross compile?
1. Install Xcode on either ASi or Intel macOS
2. Install fpc 3.2.0 official release
3. follow the steps given on the wiki page
Patron Cocoa Widgetset development https://www.patreon.com/skalogryz

adderthorn

  • New Member
  • *
  • Posts: 11
Re: Lazarus and FPC on macOS Big Sur 11
« Reply #11 on: November 24, 2020, 10:53:38 pm »
How did you compile on ASi? Did you build FPC on the ASi mac first or cross compile?
1. Install Xcode on either ASi or Intel macOS
2. Install fpc 3.2.0 official release
3. follow the steps given on the wiki page

I should have looked at the Big Sur wiki page! Fantastic work that this happened so quickly!

Edit: Running into some issues compiling Lazarus on ASi. Tried running:

Code: [Select]
make LCL_PLATFORM=cocoa CPU_TARGET=aarch64 bigide
Which then ends up producing the following error

Code: [Select]
lib/aarch64-darwin/cocoa/tatextelements.s:543:9: error: invalid operand for instruction
        add     x0,w0,w0,lsr #63
                   ^
lib/aarch64-darwin/cocoa/tatextelements.s:544:9: error: invalid operand for instruction
        asr     w0,x0,#1
                   ^
lib/aarch64-darwin/cocoa/tatextelements.s:546:9: error: invalid operand for instruction
        add     x1,w1,w1,lsr #63
                   ^
lib/aarch64-darwin/cocoa/tatextelements.s:547:9: error: invalid operand for instruction
        asr     w1,x1,#1
                   ^
lib/aarch64-darwin/cocoa/tatextelements.s:3832:9: error: invalid operand for instruction
        add     x0,w0,w0,lsr #63
                   ^
lib/aarch64-darwin/cocoa/tatextelements.s:3833:9: error: invalid operand for instruction
        asr     w1,x0,#1
                   ^
lib/aarch64-darwin/cocoa/tatextelements.s:3835:9: error: invalid operand for instruction
        add     x0,w0,w0,lsr #63
                   ^
lib/aarch64-darwin/cocoa/tatextelements.s:3836:9: error: invalid operand for instruction
        asr     w0,x0,#1
                   ^
lib/aarch64-darwin/cocoa/tatextelements.s:3934:9: error: invalid operand for instruction
        add     x0,w0,w0,lsr #63
                   ^
lib/aarch64-darwin/cocoa/tatextelements.s:3935:9: error: invalid operand for instruction
        asr     w1,x0,#1
                   ^
lib/aarch64-darwin/cocoa/tatextelements.s:3937:9: error: invalid operand for instruction
        add     x0,w0,w0,lsr #63
                   ^
lib/aarch64-darwin/cocoa/tatextelements.s:3938:9: error: invalid operand for instruction
        asr     w0,x0,#1
                   ^
make[2]: *** [tachartlazaruspkg.ppu] Error 1
make[1]: *** [bigide] Error 2
make: *** [bigidecomponents] Error 2

Build Log: https://gist.github.com/adderthorn/ac93eb4bf53fddb7d7c0406e257a0b61

Is this something I made a mistake on during compilation?
« Last Edit: November 24, 2020, 11:55:23 pm by adderthorn »

Igor Kokarev

  • Sr. Member
  • ****
  • Posts: 271
Re: Lazarus and FPC on macOS Big Sur 11
« Reply #12 on: November 25, 2020, 09:44:53 am »
If you install Big Sur on a new Mac or another SSD drive. At the end of installation Big Sur will offer you import settings from your old Mac (or old SSD drive).

It really works great, macOS copied all my settings, home directory, files, Lazarus, FPC, codesign certificates, etc. I've got exact copy of my previous macOS installation. No need to configure macOS from a scratch.

I tried this approach on two Macs (Intel > Intel). I had large SSD drive. With Disk Utility I created a second partition for Big Sur. After the installation macOS copied all settings/files from Catalina. And now I have two installations of macOS - Big Sur and old Catalina. So I can test apps in old Catalina and use new Big Sur on the same Mac.

I didn't test copying from Intel to Apple M1.
« Last Edit: November 25, 2020, 09:48:22 am by Igor Kokarev »

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1364
Re: Lazarus and FPC on macOS Big Sur 11
« Reply #13 on: November 25, 2020, 10:37:41 am »
To steal this thread for a request.
I have tried to cross-build fpcupdeluxe for Darwin arm64 from my Windows PC.
As I do not have a Mac, I would like to ask you to test it ? If it starts, I am ok.
Thanks.
https://github.com/LongDirtyAnimAlf/fpcupdeluxe/releases/download/1.8.2e/fpcupdeluxe-aarch64-darwin-cocoa.zip

nummer8

  • Jr. Member
  • **
  • Posts: 61
Re: Lazarus and FPC on macOS Big Sur 11
« Reply #14 on: November 25, 2020, 12:01:11 pm »
I tried it on a mac book pro with Big Sur.
it would not start.  %)

 

TinyPortal © 2005-2018