Recent

Author Topic: Compiling Lazarus from source code  (Read 482 times)

PetrHlozek

  • New Member
  • *
  • Posts: 12
Compiling Lazarus from source code
« on: April 30, 2025, 07:09:24 pm »
Hi,

I just cloned the main branch of the lazarus repository from gitlab and tried to compile it with:

Code: Pascal  [Select][+][-]
  1. make clean all LCL_PLATFORM=cocoa bigide

Unfortunately the linking process ended with this error:

Code: Pascal  [Select][+][-]
  1. (9022) Compiling resource ../units/aarch64-darwin/cocoa/lazarus.or
  2. (9015) Linking ../lazarus
  3. -macosx_version_min has been renamed to -macos_version_min
  4. ld: warning: -multiply_defined is obsolete
  5. ld: warning: ignoring duplicate libraries: '-lc'
  6. ld: warning: no platform load command found in '/Users/petr/tmp/lazarus/units/aarch64-darwin/cocoa/lazarus.or', assuming: macOS
  7. ./../ppaslink.sh: line 9: 52644 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 ../link52054.res` -filelist ../linkfiles52054.res
  8. An error occurred while linking
  9. Error: (9013) Error while linking
  10. Fatal: (10026) There were 1 errors compiling module, stopping
  11. Fatal: (1018) Compilation aborted
  12. make[2]: *** [lazarus] Error 1
  13. make[1]: *** [ide] Error 2
  14. make: *** [ide] Error 2

FPC version 3.2.2 [2021/05/16] for aarch64, macOS Sonoma 15.4.1 (24E263), M1

I tried to Google it but nothing useful. Do you know what I do wrong, please? Thanks a lot.


Petr

TRon

  • Hero Member
  • *****
  • Posts: 4353
Re: Compiling Lazarus from source code
« Reply #1 on: April 30, 2025, 07:15:26 pm »
I tried to Google it but nothing useful. Do you know what I do wrong, please? Thanks a lot.
Why use google when we (the forum software) have our own search ?

Have a look at the macos subforum and be amazed how much issues (including yours) related to macos (especially Mx/aarch64) are mentioned.
« Last Edit: April 30, 2025, 07:18:35 pm by TRon »
Today is tomorrow's yesterday.

PetrHlozek

  • New Member
  • *
  • Posts: 12
Re: Compiling Lazarus from source code
« Reply #2 on: April 30, 2025, 07:37:08 pm »
Oh, that's a lot of issues!

It seems I have to wait until apple fixes the bug :(.

TRon

  • Hero Member
  • *****
  • Posts: 4353
Re: Compiling Lazarus from source code
« Reply #3 on: April 30, 2025, 07:55:37 pm »
Nothing to do with Apple... well ... they had the urge to change things therefor fpc/lazarus needs to accommodate.

Please read through this thread for a workaround (hint skip through to last page for the literal workaround instructions).

At least it will be able to fix the issue as you reported (no idea about the others).

If not mistaken the option can be provided on the build command-line with FPCOPT=xxx (it might also be OPT=xxx) where xxx is the options or options that are passed to the compiler (use double quotes for multiple options).
« Last Edit: April 30, 2025, 08:02:45 pm by TRon »
Today is tomorrow's yesterday.

PetrHlozek

  • New Member
  • *
  • Posts: 12
Re: Compiling Lazarus from source code
« Reply #4 on: May 01, 2025, 05:04:47 pm »
I used this solution:

https://forum.lazarus.freepascal.org/index.php/topic,70698.msg553691.html#msg553691

On my system, the fpc.cfg was located in

Code: Pascal  [Select][+][-]
  1. /private/etc/fpc.cfg

Now it works, Lazarus is compiled and running. There are some issues but it runs and compiles my application. Unfortunately it crashes just after start but I'll create a new thread for that.

TRon

  • Hero Member
  • *****
  • Posts: 4353
Re: Compiling Lazarus from source code
« Reply #5 on: May 01, 2025, 06:02:24 pm »
I used this solution:
The my suggested solution does the same thing as ^^ that solution^^ but from the command-line for single use during the build.

Nothing wrong by making it permanent but to let know it is the same thing  :)
Today is tomorrow's yesterday.

 

TinyPortal © 2005-2018