Recent

Author Topic: Updating of macOS 11.5.x corrupts FPC on M1 Mac  (Read 3814 times)

Igor Kokarev

  • Sr. Member
  • ****
  • Posts: 349
Updating of macOS 11.5.x corrupts FPC on M1 Mac
« on: August 12, 2021, 02:28:52 pm »
Since macOS 11.5 every new update (11.5.1, 11.5.2) damages FPC 3.2.2 binaries or configuration on M1-powered Mac.

Symptoms:

FPC refuses to cross-compile for x86_64/darwin.
Compilation for aarch64/darwin works fine.

Code: Pascal  [Select][+][-]
  1. Mac-mini-Igor:~ mac$ fpc -Px86_64
  2. Error: /usr/local/bin/ppcx64 can't be executed, error message: Failed to execute "/usr/local/bin/ppcx64", error code: 127

Code: Pascal  [Select][+][-]
  1. bash-3.2$ lazbuild --cpu=x86_64 --build-mode=Release --build-all --recursive MyApp.lpi
  2. Hint: (lazarus) [RunTool] "/usr/local/bin/fpc" "-iWTOTP" "-Px86_64"
  3. Warning: [TPCTargetConfigCache.Update] cannot find real compiler for this platform: Compiler="/usr/local/bin/fpc" Options="-Px86_64" RealCompiler=""
  4. TProject.DoLoadStateFile Statefile not found: /Users/mac/Dev/MyApp/lib/x86_64-darwin/MyApp.compiled
  5. Error: /usr/local/bin/ppcx64 can't be executed, error message: Failed to execute "/usr/local/bin/ppcx64", error code: 127
  6. Error: (lazarus) Compile Project, Mode: Release, CPU: x86_64, Target: MyApp: stopped with exit code 1
  7. Error: (lazbuild) failed compiling of project /Users/mac/Dev/MyApp/MyApp.lpi


Native aarch64/darwin compiler works fine:
Code: Pascal  [Select][+][-]
  1. bash-3.2$ fpc -Paarch64
  2. Free Pascal Compiler version 3.2.2 [2021/05/16] for aarch64
  3. <...>

Solution:

I found a simple workaround. Reinstallation of fpc-3.2.2.intelarm64-macosx.dmg cures FPC configuration and now FPC works correctly again.

It seems that this problem doesn't appear on Intel Macs. Only on M1 Macs.
« Last Edit: August 12, 2021, 02:43:46 pm by Igor Kokarev »

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 9706
  • FPC developer.
Re: Updating of macOS 11.5.x corrupts FPC on M1 Mac
« Reply #1 on: August 12, 2021, 02:44:56 pm »
Maybe OS X reapplies some security policy/permission every update?

Igor Kokarev

  • Sr. Member
  • ****
  • Posts: 349
Re: Updating of macOS 11.5.x corrupts FPC on M1 Mac
« Reply #2 on: August 12, 2021, 03:03:53 pm »
Yes, but native ARM compiler continue to work.

Probably Jonas can check this issue on his M1 Mac?

trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1698
  • Former Delphi 1-7, 10.2 user
Re: Updating of macOS 11.5.x corrupts FPC on M1 Mac
« Reply #3 on: August 13, 2021, 01:27:29 am »
I have not had this issue on my M1 Mac mini which I just this morning updated from 11.5.1 to 11.5.2. I have FPC 3.3.1, 3.2.0 and 3.2.2 all installed and the compiler binaries all still execute without any issues (both native aarch64 and x86_64).
« Last Edit: August 13, 2021, 01:29:10 am by trev »
Lazarus 2.3, FPC 3.3.1 macOS 12.0.1 x86_64 Xcode 13.1
Lazarus 2.3, FPC 3.3.1 macOS 12.0.1 aarch64 Xcode 13.1
Lazarus 2.3, FPC 3.2.2 FreeBSD 13.0 amd64 VM
Lazarus 2.3, FPC 3.2.2 FreeBSD 12.2 amd64 VM
Lazarus 2.1 r61574 FPC 3.0.4 Ubuntu 20.04 VM
Lazarus 2.0.10 FPC 3.2.0 Win10 VM

Igor Kokarev

  • Sr. Member
  • ****
  • Posts: 349
Re: Updating of macOS 11.5.x corrupts FPC on M1 Mac
« Reply #4 on: August 13, 2021, 01:47:47 pm »
Interesting. I had this issue twice after updating to 11.5.1 and 11.5.2

My macOS installation is a clean (without Time Machine or import) when I purchased Mac Mini M1 in March.

trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1698
  • Former Delphi 1-7, 10.2 user
Re: Updating of macOS 11.5.x corrupts FPC on M1 Mac
« Reply #5 on: August 14, 2021, 01:09:13 am »
My macOS installation is a clean (without Time Machine or import) when I purchased Mac Mini M1 in March.

I did exactly the same as you, started completely clean with no TM backups or settings migration.

Does the system log reveal more details about why the x86_64 binaries are no longer being executed?
Lazarus 2.3, FPC 3.3.1 macOS 12.0.1 x86_64 Xcode 13.1
Lazarus 2.3, FPC 3.3.1 macOS 12.0.1 aarch64 Xcode 13.1
Lazarus 2.3, FPC 3.2.2 FreeBSD 13.0 amd64 VM
Lazarus 2.3, FPC 3.2.2 FreeBSD 12.2 amd64 VM
Lazarus 2.1 r61574 FPC 3.0.4 Ubuntu 20.04 VM
Lazarus 2.0.10 FPC 3.2.0 Win10 VM

Igor Kokarev

  • Sr. Member
  • ****
  • Posts: 349
Re: Updating of macOS 11.5.x corrupts FPC on M1 Mac
« Reply #6 on: August 16, 2021, 02:36:12 pm »
Sorry, I didn't explore system logs.

If this issue will occur again with future update of macOS, I'll try to check logs.

 

TinyPortal © 2005-2018