Recent

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

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1388
Re: Lazarus and FPC on macOS Big Sur 11
« Reply #15 on: November 25, 2020, 12:09:26 pm »
Thanks for testing ! Final questions.
Did it crash (crash report) ? Or was it a safety issue ?

nummer8

  • Jr. Member
  • **
  • Posts: 64
Re: Lazarus and FPC on macOS Big Sur 11
« Reply #16 on: November 25, 2020, 01:15:14 pm »
No crash. If I try to start the app I got the message
"You can't open the app FPC.... because this app is not supported on this Mac"
(translated the message)
Hope it helps

adderthorn

  • New Member
  • *
  • Posts: 15
Re: Lazarus and FPC on macOS Big Sur 11
« Reply #17 on: November 25, 2020, 03:15:33 pm »
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.

For me this is a brand new mac. I didn't copy from an old mac. I could probably run the latest binaries using Rosetta but was hoping to compile a native build of Lazarus. I got FPC working.

adderthorn

  • New Member
  • *
  • Posts: 15
Re: Lazarus and FPC on macOS Big Sur 11
« Reply #18 on: November 25, 2020, 07:06:46 pm »
Okay, tried to take an update for FPC, recompile and then was able to compile lazarus with M1. Very exciting!

MiR

  • Full Member
  • ***
  • Posts: 153
Re: Lazarus and FPC on macOS Big Sur 11
« Reply #19 on: December 10, 2020, 01:37:06 am »
@DonAlfredo: My Macbook Air M1 arrived today, second thing I tried was running fpcupdeluxe, but it fails (1.8.2f) Is there a way I can help to make it work?

Starting it from Bundle gives a message that I do not have enough rights to start the app, direct start gives this:

Error:
./fpcupdeluxe-aarch64-darwin-cocoa.app/Contents/MacOS/fpcupdeluxe-aarch64-darwin-cocoa
zsh: killed

sudo dtruss ./fpcupdeluxe-aarch64-darwin-cocoa.app/Contents/MacOS/fpcupdeluxe-aarch64-darwin-cocoa
dtrace: system integrity protection is on, some features will not be available

dtrace: failed to execute ./fpcupdeluxe-aarch64-darwin-cocoa.app/Contents/MacOS/fpcupdeluxe-aarch64-darwin-cocoa: Malformed Mach-o file

Michael
« Last Edit: December 10, 2020, 01:40:28 am by MiR »

trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1207
  • Former Delphi 1-7, 10.2 User
Re: Lazarus and FPC on macOS Big Sur 11
« Reply #20 on: December 10, 2020, 03:12:01 am »
@MIR: Did you do the  CTRL-CLICK dance to bypass Gatekeeper? The fact  fpcupdeluxe-aarch64-darwin-cocoa was being killed suggests not.
o Lazarus 2.1.0 r64368, FPC 3.3.1 r48100, macOS 10.14.6, Xcode 11.3.1
o Lazarus 2.1.0 r64392, FPC 3.3.1 Jan 13 21:24, macOS 11.1 (aarch64), Xcode 12.3
o Lazarus 2.1.0 r61574, FPC 3.3.1 r42318, FreeBSD 12.1 amd64 (VMware VM)
o Lazarus 2.1.0 r61574, FPC 3.0.4, Ubuntu 20.04 (Parallels VM)

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1388
Re: Lazarus and FPC on macOS Big Sur 11
« Reply #21 on: December 10, 2020, 06:19:26 am »
@MiR
A wrong binary was uploaded by me. Please download fpcupdeluxe-aarch64-darwin-cocoa again. It should work !
Please note: aarch64-darwin is still work-in-progress.

Edit:
Another upload for darwin arm64 is also available.
https://github.com/LongDirtyAnimAlf/fpcupdeluxe/releases/download/1.8.2f/fpcupdeluxe-aarch64-darwin-cocoa-cross.zip
It has been codesigned on my Windows PC. Would be interesting to know if this one also works on your system. Please test. Thanks.
« Last Edit: December 10, 2020, 06:40:16 am by DonAlfredo »

MiR

  • Full Member
  • ***
  • Posts: 153
Re: Lazarus and FPC on macOS Big Sur 11
« Reply #22 on: December 10, 2020, 10:47:06 am »
Unfortunately both do not work. The error message is different, it now says that the file is corrupt and the only option is to delete it.

Result is the same for both new files from github.

Systemlog revealed that Gatekeeper is standing in the way (Yes, I used CTRL-Click):

10.12.2020, 10:14:56 com.apple.xpc.launchd[1]: Coalition Cache Hit: app<application.com.company.fpcupdeluxe-aarch64-darwin-cocoa.860843.860848(501)> [9961]
10.12.2020, 10:15:07 com.apple.xpc.launchd[1]: removing service since it exited with consistent failure - OS_REASON_EXEC | Gatekeeper policy blocked execution

Next step then was to declare Terminal as a Developer Tool, after this step I could actually start fpcupdeluxe from within Terminal.

But build failed:
Code: [Select]
fpcupdeluxe: Executing: /usr/bin/git log -n 1 --grep=^git-svn-id: (working dir: /Users/ring/fpcupdeluxe/fpcsrc)
fpcupdeluxe: info: FPCNativeInstaller (GetModule: FPC): FPC was at revision: 45643
fpcupdeluxe: info: FPCNativeInstaller (GetModule: FPC): FPC is now at revision: 45643
fpcupdeluxe: info: FPCNativeInstaller (GetModule: FPC): No FPC patches defined.
fpcupdeluxe: info: FPCNativeInstaller (BuildModule: FPC): Building module FPC...
fpcupdeluxe: info: FPC native builder: Detected source version FPC (source): 3.2.0
fpcupdeluxe: info: FPCNativeInstaller (BuildModule: FPC): To compile this FPC, we need (required) a compiler with version 3.2.0 or 3.2.0
fpcupdeluxe: info: FPCNativeInstaller (CheckAndGetTools): Looking for a bootstrap compiler from official FPC bootstrap binaries.
fpcupdeluxe: info: FPCNativeInstaller (CheckAndGetTools): Looking for official FPC bootstrapper with version 3.2.0
fpcupdeluxe: info: FPCNativeInstaller (CheckAndGetTools): Now looking for a better [version] bootstrap compiler from Github FPCUP(deluxe) releases.
fpcupdeluxe: info: FPCNativeInstaller (CheckAndGetTools): Looking online for a FPCUP(deluxe) bootstrapper with name: fpcup-3_2_0-aarch64-darwin-ppca64
fpcupdeluxe: ERROR: FPCNativeInstaller (CheckAndGetTools): No bootstrapper local and online. Fatal. Stopping.
Found valid make application.
fpcupdeluxe: ERROR: FPCNativeInstaller (BuildModuleCustom: FPC): FPC bootstrap version error: 0.0.0 ! Should never happen: expect many errors !!
fpcupdeluxe: info: FPCNativeInstaller (BuildModuleCustom: FPC): Running CleanModule once more before building FPC from sources, due to previous CleanModule failure.
fpcupdeluxe: info: FPCNativeInstaller (CleanModule: FPC): Running  distclean failed: could not find cleanup compiler. Will try again later
fpcupdeluxe: info: FPCNativeInstaller (CleanModule: FPC): Now building FPC revision 45643
fpcupdeluxe: Executing: /usr/bin/make --jobs=8 FPMAKEOPT=--threads=8 PP=/Users/ring/fpcupdeluxe/fpcbootstrap/ppca64 FPCMAKE=/Users/ring/fpcupdeluxe/fpc/bin/aarch64-darwin/fpcmake PPUMOVE=/Users/ring/fpcupdeluxe/fpc/bin/aarch64-darwin/ppumove PREFIX=/Users/ring/fpcupdeluxe/fpc INSTALL_PREFIX=/Users/ring/fpcupdeluxe/fpc FPCDIR=/Users/ring/fpcupdeluxe/fpcsrc INSTALL_BINDIR=/Users/ring/fpcupdeluxe/fpc/bin/aarch64-darwin OS_SOURCE=darwin CPU_SOURCE=aarch64 OS_TARGET=darwin CPU_TARGET=aarch64 OVERRIDEVERSIONCHECK=1 REVSTR=45643 REVINC=force OPT=-Fl/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib -WM10.8 -Sg -vw-n-h-l-d-u-t-p-c- --directory=/Users/ring/fpcupdeluxe/fpcsrc all install (working dir: /Users/ring/fpcupdeluxe/fpcsrc)
Makefile:135: *** Compiler /Users/ring/fpcupdeluxe/fpcbootstrap/ppca64 not found.  Stop.

fpcupdeluxe: ERROR: FPCNativeInstaller (CleanModule: FPC): Error running /usr/bin/make for FPC failed with exit code 512
. Details:


ERROR: Fpcupdeluxe fatal error !

trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1207
  • Former Delphi 1-7, 10.2 User
Re: Lazarus and FPC on macOS Big Sur 11
« Reply #23 on: December 10, 2020, 11:18:10 am »
@MIR: You can compile both FPC + Lazarus from source - see the Wiki article ARM64/AArch64/Apple Silicon Support. This works for me on the base M1 Mac mini.
o Lazarus 2.1.0 r64368, FPC 3.3.1 r48100, macOS 10.14.6, Xcode 11.3.1
o Lazarus 2.1.0 r64392, FPC 3.3.1 Jan 13 21:24, macOS 11.1 (aarch64), Xcode 12.3
o Lazarus 2.1.0 r61574, FPC 3.3.1 r42318, FreeBSD 12.1 amd64 (VMware VM)
o Lazarus 2.1.0 r61574, FPC 3.0.4, Ubuntu 20.04 (Parallels VM)

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1388
Re: Lazarus and FPC on macOS Big Sur 11
« Reply #24 on: December 10, 2020, 11:22:04 am »
@MiR
Thanks for this feedback ! Very useful.
As said, arm64-darwin is still a moving target for fpcupdeluxe: I am also very interested to know if you are able to get the cross-app running (a bit).
Will look into a suitable bootstrapper for FPC.


MiR

  • Full Member
  • ***
  • Posts: 153
Re: Lazarus and FPC on macOS Big Sur 11
« Reply #25 on: December 10, 2020, 11:29:01 am »
Thinking about the error message, it makes a lot of sense.

We only have trunk compiler on aarch64 so the search for stable fpc must fail. I tried to build both stable.git and trunk.git for fpc, same result for both.

@DonAlfredo: Can I override this check in some way? I looked through settings+ but the right side of the dialog is greyed out for me.

@trev: Thank you, I already did that yesterday, my point is that I would like to help DonAlfredo to make fpcupdeluxe work on M1 chipssets so others have a smoother transition.


DonAlfredo

  • Hero Member
  • *****
  • Posts: 1388
Re: Lazarus and FPC on macOS Big Sur 11
« Reply #26 on: December 10, 2020, 11:32:56 am »
This message includes a screenshot on how to override the compiler in Setup+.
You need to select the target os and cpu first !

MiR

  • Full Member
  • ***
  • Posts: 153
Re: Lazarus and FPC on macOS Big Sur 11
« Reply #27 on: December 10, 2020, 11:39:00 am »
I would love to change those settings but.....  :'(

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1388
Re: Lazarus and FPC on macOS Big Sur 11
« Reply #28 on: December 10, 2020, 11:44:31 am »
That is a good one ...  ;)
Will build new up-binaries. Stay tuned !
 :D

MiR

  • Full Member
  • ***
  • Posts: 153
Re: Lazarus and FPC on macOS Big Sur 11
« Reply #29 on: December 10, 2020, 11:53:56 am »
Success.....

I created a symlink to my local build of fpc-trunk in fpcbootstrap directory and tweaked fpc options to include path to my commandlinetools:

-FD/Library/Developer/CommandLineTools/usr/bin -XR/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk

and I have a native lazarus built with fpcupdeluxe on my mac.....

To automate the setting of -FD and -XR I'd propose to use this command:

xcrun --show-sdk-path
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk

and then later include both -FD and -XR in you custom fpc.cfg

This last step is also valid for builds of x64_64, I had to do those tweaks a while ago to make lazarus compile on my 'old' x86_64 mac.

« Last Edit: December 10, 2020, 11:57:22 am by MiR »

 

TinyPortal © 2005-2018