Recent

Author Topic: Persistent MacOS Arm M chip linker error  (Read 5569 times)

SaintSeiya84

  • Newbie
  • Posts: 5
Persistent MacOS Arm M chip linker error
« on: June 28, 2025, 09:04:52 pm »
Hi
This linked error (Segmentation Fault) has been mentioned several times but it has not being fixed. Not in trunk, not in stable versions.
I have tried compiling Lazarus from source directly, from FPCUPDeluxe, in an M1, and now on an M4 Mac mini. Reinstalled CommandLineTools, XCode, etc
No matter what I do still fails, only the x86 macos version works on Apple silicon.
If I download a precompiled binary for Apple silicon, the moment I add or remove components that will trigger a rebuild of the IDE it will fail again.
Is there an actual fix for this?

Code: Pascal  [Select][+][-]
  1. /Users/raulito/Documents/Lazarus-main/ide/main.pp(444,35) Hint: (5024) Parameter "Sender" not used
  2. (9009) Assembling main
  3. (3104) Compiling colortty.pas
  4. (3104) Compiling laztty.pas
  5. (9009) Assembling laztty
  6. /Users/raulito/Documents/Lazarus-main/ide/colortty.pas(84,38) Warning: (6018) unreachable code
  7. /Users/raulito/Documents/Lazarus-main/ide/colortty.pas(73,47) Hint: (5024) Parameter "Sender" not used
  8. /Users/raulito/Documents/Lazarus-main/ide/colortty.pas(73,81) Hint: (5024) Parameter "LogIndent" not used
  9. /Users/raulito/Documents/Lazarus-main/ide/colortty.pas(74,16) Hint: (5024) Parameter "Handled" not used
  10. (9009) Assembling colortty
  11. /Users/raulito/Documents/Lazarus-main/ide/lazarus.pp(78,5) Hint: (5023) Unit "FPCUnitTestRunner" not used in Lazarus
  12. (9009) Assembling lazarus
  13. (9022) Compiling resource ../units/aarch64-darwin/cocoa/lazarus.or
  14. (9015) Linking ../lazarus
  15. -macosx_version_min has been renamed to -macos_version_min
  16. ld: warning: -multiply_defined is obsolete
  17. ld: warning: ignoring duplicate libraries: '-lc'
  18. ld: warning: no platform load command found in '/Users/raulito/Documents/Lazarus-main/units/aarch64-darwin/cocoa/lazarus.or', assuming: macOS
  19. ./../ppaslink.sh: line 9: 47103 Segmentation fault: 11  /Library/Developer/CommandLineTools/usr/bin/ld -weak_framework AppKit -weak_framework UserNotifications -order_file ../symbol_order.fpc -multiply_defined suppress -L. -o ../lazarus `cat ../link46516.res` -filelist ../linkfiles46516.res
  20. An error occurred while linking
  21. Error: (9013) Error while linking
  22. Fatal: (10026) There were 1 errors compiling module, stopping
  23. Fatal: (1018) Compilation aborted
  24. make[2]: *** [lazarus] Error 1
  25. make[1]: *** [bigide] Error 2
« Last Edit: June 28, 2025, 09:06:42 pm by SaintSeiya84 »

SaintSeiya84

  • Newbie
  • Posts: 5
Re: Persistent MacOS Arm M chip linker error
« Reply #1 on: June 28, 2025, 10:52:11 pm »
Is there anybody in the Lazarus community who actually compiles on an M chip?

cdbc

  • Hero Member
  • *****
  • Posts: 2807
    • http://www.cdbc.dk
Re: Persistent MacOS Arm M chip linker error
« Reply #2 on: June 28, 2025, 10:56:21 pm »
Hi
Yup, AFAIK @Thaddy does and there are a few more, whom I can't remember...  ;D
Just hang on for a little bit and someone will 'come up for air'  :D
Regards Benny
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE6/QT6 -> FPC Release -> Lazarus Release &  FPC Main -> Lazarus Main

SaintSeiya84

  • Newbie
  • Posts: 5
Re: Persistent MacOS Arm M chip linker error
« Reply #3 on: June 28, 2025, 11:13:02 pm »
Thanks! apologies if I sound desperate  :-[

Nimbus

  • Jr. Member
  • **
  • Posts: 89
Re: Persistent MacOS Arm M chip linker error
« Reply #4 on: June 28, 2025, 11:20:11 pm »
I built both FPC and Lazarus with '-WM10.15' option (can be set in fpcupdeluxe Setup window), it would throw some warning but seems to work pretty much fine afterwards. This is the only workaround I am aware of.

SaintSeiya84

  • Newbie
  • Posts: 5
Re: Persistent MacOS Arm M chip linker error
« Reply #5 on: June 28, 2025, 11:23:05 pm »
Thanks @Nimbus Let me try that.
Since I'm new where should I set that flag? in the compilation command or in a config file?
like

Code: Pascal  [Select][+][-]
  1.  make clean bigide -WM10.15

Nimbus

  • Jr. Member
  • **
  • Posts: 89
Re: Persistent MacOS Arm M chip linker error
« Reply #6 on: June 28, 2025, 11:39:18 pm »
Not sure about the command line, I'm using fpcupdeluxe so have set it there
« Last Edit: July 04, 2025, 12:02:37 am by Nimbus »

SaintSeiya84

  • Newbie
  • Posts: 5
Re: Persistent MacOS Arm M chip linker error
« Reply #7 on: June 28, 2025, 11:48:45 pm »
Great! thanks!
For future reference in case another user stumble upon this
just tested the command line option and it also worked too:

Code: Pascal  [Select][+][-]
  1. make clean bigide OPT="-WM10.15"

You saved my day  :D

BVale

  • New Member
  • *
  • Posts: 11
Re: Persistent MacOS Arm M chip linker error
« Reply #8 on: July 08, 2025, 10:29:45 am »
 
Is there anybody in the Lazarus community who actually compiles on an M chip?

Are you serious? Apple stopped selling Intel Macs in 2023, and macOS 26, coming this year, will be the last version to support Intel Macs.

If this kind of question — “Who actually compiles on an M chip?” — is still being asked seriously in 2025, then it says more about the mindset of Lazarus macOS developers than anything else.

And in case you missed it: Apple officially dropped support for macOS 10.15 on June 30, 2025.
So compiling with -WM10.15 is now basically a game of luck — not a reliable or future-proof solution.

If Lazarus can’t (or won’t) properly support Apple Silicon in 2025, then let’s be honest: Lazarus is effectively dead on macOS.

Thaddy

  • Hero Member
  • *****
  • Posts: 19241
  • Glad to be alive.
Re: Persistent MacOS Arm M chip linker error
« Reply #9 on: July 08, 2025, 10:40:09 am »
Is there anybody in the Lazarus community who actually compiles on an M chip?
In fact most of the Mac adepts here have now M series hardware. I changed my intel because it broke.(due to old age and a spinning drive) Otherwise I would also be on Intel, frankly.
Then again, my Raspberry's also run AARCH64 so it was inevitable to upgrade eventually.
I do not recognize any linker errors (on M series, I have M4, not M4 pro so maybe there is something else wrong?
Add -WM10.15 to the options. I believe that was already explained here on the forum?
OTOH Copilot came up with yet another option: -macos_version_min=11.0 because that plays nicer with newer xcode.
« Last Edit: July 08, 2025, 10:50:26 am by Thaddy »
objects are fine constructs. You can even initialize them with constructors.

BVale

  • New Member
  • *
  • Posts: 11
Re: Persistent MacOS Arm M chip linker error
« Reply #10 on: July 08, 2025, 12:36:58 pm »
@thaddy The linker issues started to occur with a certain macOS and Apple developer tools update. If you update your OS, then that issue will occur for you as well.

dbannon

  • Hero Member
  • *****
  • Posts: 3822
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Persistent MacOS Arm M chip linker error
« Reply #11 on: July 08, 2025, 01:16:06 pm »
BVale, I suspect we have established already that few if any of the FPC devs own current M based apple machines with the offending OS. Its a classic open source situation, if 'we' want a solution to this problem, its going to come from the users who have the hardware/software where the problem lies.

Maybe thats you ? Work out what the problem is, make a patch file, send it in. I suggest you use fpc main to do your tests.

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

Thaddy

  • Hero Member
  • *****
  • Posts: 19241
  • Glad to be alive.
Re: Persistent MacOS Arm M chip linker error
« Reply #12 on: July 08, 2025, 03:53:25 pm »
@thaddy The linker issues started to occur with a certain macOS and Apple developer tools update. If you update your OS, then that issue will occur for you as well.
Then I would add Add -WM11.0 (I guess) or the suggestion from CoPilot, essentially the same. I am aware of that but did not upgrade yet. Anyway that should fix the matter. I had to fix it like that in a similar fashion when I received my Mac Mini M4 last year. (Which I use almost exclusively for development, not much else)

It is a documented compiler switch:
 -WM<x>     Minimum Mac OS X deployment version: 10.4, 10.5.1, ... (Darwin)
« Last Edit: July 08, 2025, 04:45:44 pm by Thaddy »
objects are fine constructs. You can even initialize them with constructors.

BVale

  • New Member
  • *
  • Posts: 11
Re: Persistent MacOS Arm M chip linker error
« Reply #13 on: July 08, 2025, 06:00:42 pm »
BVale, I suspect we have established already that few if any of the FPC devs own current M based apple machines with the offending OS. Its a classic open source situation, if 'we' want a solution to this problem, its going to come from the users who have the hardware/software where the problem lies.

Maybe thats you ? Work out what the problem is, make a patch file, send it in. I suggest you use fpc main to do your tests.

Davo
You basically just put it in other words: Lazarus is currently dead on macOS in its current state.

Don’t get me wrong—I really, really like Lazarus, and it’s frustrating to see where things are right now. If there’s a dot release and new users can’t even use it on current hardware and software, then I’m sorry—but it’s only a matter of time before it dies on that platform.

If the devs don’t have the necessary macOS hardware or funds for development, they could always ask the community. There are ways to raise money if the will is there.

In the end, I personally solved the issue by buying Delphi and Parallels and rewrote the software I need for my work using FMX.
Unfortunately, I don’t have the skills to fix low-level things like linker errors.

Thaddy

  • Hero Member
  • *****
  • Posts: 19241
  • Glad to be alive.
Re: Persistent MacOS Arm M chip linker error
« Reply #14 on: July 08, 2025, 09:18:53 pm »
Well, adding the correct -WM option for the version is not very low level, unless you mean that the option is listed way down the options list.... I think you gave up too soon.
BTW quite a few of the core team have several versions of macs, including M4 and M4 pro based.
« Last Edit: July 08, 2025, 09:21:28 pm by Thaddy »
objects are fine constructs. You can even initialize them with constructors.

 

TinyPortal © 2005-2018