Recent

Author Topic: Trunk FPC fails to install on aarch64  (Read 3889 times)

Grahame Grieve

  • Full Member
  • ***
  • Posts: 224
Trunk FPC fails to install on aarch64
« on: December 02, 2021, 01:27:06 pm »
Trev, I've tried following the instructions on https://wiki.lazarus.freepascal.org/Installing_Lazarus_on_macOS to get Lazarus working. Unfortunately I need the trunk version of FPC to get the generics stuff to compile. And that won't install - I followed your instructions and my trunk Lazarus is working fine, but when I install the trunk FPC, I get an error

> git clone -b main https://gitlab.com/freepascal.org/fpc/source.git fpc_main

yep fine

> make distclean all FPC=/usr/local/lib/fpc/3.2.2/ppcx64 OS_TARGET=darwin CPU_TARGET=aarch64 OPT="-XR/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/"

Yep fine, with a changed path to the latest SDK. Note that I'm on an M1 so aarch64 not x86_64

> sudo make install OS_TARGET=darwin CPU_TARGET=aarch64

fails pretty quickly with:

/Users/grahame/work/lazarus/fpc_main/utils/fpcm/bin/aarch64-darwin/fpcmake -p -Taarch64-darwin Makefile.fpc
make[3]: /Users/grahame/work/lazarus/fpc_main/utils/fpcm/bin/aarch64-darwin/fpcmake: No such file or directory
make[3]: *** [fpc_install] Error 1
make[2]: *** [rtl_distinstall] Error 2
make[1]: *** [installbase] Error 2
make: *** [installall] Error 2

/Users/grahame/work/lazarus/fpc_main/utils/fpcm exists, but it doesn't have any sub-directories. I'm not sure where to go next?

trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1813
  • Former Delphi 1-7, 10.2 user
Re: Trunk FPC fails to install on aarch64
« Reply #1 on: December 02, 2021, 10:39:25 pm »
> make distclean all FPC=/usr/local/lib/fpc/3.2.2/ppcx64 OS_TARGET=darwin CPU_TARGET=aarch64 OPT="-XR/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/"

Yep fine, with a changed path to the latest SDK. Note that I'm on an M1 so aarch64 not x86_64

MacOSX.sdk should be a soft link to the latest SDK. It is on both my M1 and Intel Mac minis (M1 listing below):

Code: Text  [Select][+][-]
  1. trev@macmini8 [/Users/trev] $ ls -l /Library/Developer/CommandLineTools/SDKs/
  2. total 0
  3. lrwxr-xr-x  1 root  wheel   14 Oct 28 21:41 MacOSX.sdk -> MacOSX12.0.sdk
  4. drwxr-xr-x  8 root  wheel  256 Apr 27  2021 MacOSX10.15.sdk
  5. drwxr-xr-x  7 root  wheel  224 Oct 28 21:41 MacOSX11.3.sdk
  6. lrwxr-xr-x  1 root  wheel   14 Oct 28 21:41 MacOSX11.sdk -> MacOSX11.3.sdk
  7. drwxr-xr-x  7 root  wheel  224 Sep 18 23:12 MacOSX12.0.sdk
  8. lrwxr-xr-x  1 root  wheel   14 Oct 28 21:41 MacOSX12.sdk -> MacOSX12.0.sdk

Quote
> sudo make install OS_TARGET=darwin CPU_TARGET=aarch64

fails pretty quickly with:
[...]
I'm not sure where to go next?

I'll check later today when I get a moment. It may just be that the installation for the development version of FPC is currently broken for aarch64 due to recent changes.
« Last Edit: December 02, 2021, 10:41:15 pm by trev »
Lazarus 2.3, FPC 3.3.1 macOS 12.1 x86_64 Xcode 13.2
Lazarus 2.3, FPC 3.3.1 macOS 12.1 aarch64 Xcode 13.2
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 amd64 VM

trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1813
  • Former Delphi 1-7, 10.2 user
Re: Trunk FPC fails to install on aarch64
« Reply #2 on: December 03, 2021, 12:24:33 am »
> make distclean all FPC=/usr/local/lib/fpc/3.2.2/ppcx64 OS_TARGET=darwin CPU_TARGET=aarch64 OPT="-XR/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/"

Argh, I just noticed that you used ppcx64 instead of ppca64 in the above command line.

I retraced your steps after fixing that and it installed without issue. You must have missed the note:

Quote
Note: When building a native aarch64 Free Pascal Compiler (ppca64) for an Apple Silicon M1 processor Mac, change the CPU_TARGET in the instructions below from x86_64 (Intel 64 bit) to aarch64 (ARM 64 bit - Apple Silicon M1) and change any reference to ppcx64 to ppca64
« Last Edit: December 03, 2021, 12:28:45 am by trev »
Lazarus 2.3, FPC 3.3.1 macOS 12.1 x86_64 Xcode 13.2
Lazarus 2.3, FPC 3.3.1 macOS 12.1 aarch64 Xcode 13.2
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 amd64 VM

Grahame Grieve

  • Full Member
  • ***
  • Posts: 224
Re: Trunk FPC fails to install on aarch64
« Reply #3 on: December 04, 2021, 08:27:41 pm »
Sigh, that's embarrassing. I'm sorry I wasted your time with that. I did not miss the note but I only gleaned it's general intent and missed that in the command line.

Now my trunk Lazarus is complaining about not finding fppkg.cfg, and I wasn't sure about how to sort that out, but it seems to run OK without me having to sort it out. Back to working on openSSL... thanks

trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1813
  • Former Delphi 1-7, 10.2 user
Re: Trunk FPC fails to install on aarch64
« Reply #4 on: December 04, 2021, 11:40:29 pm »
Sigh, that's embarrassing. I'm sorry I wasted your time with that.

No worries - it happens to the best of us. I missed it the first few times I read your post.
Lazarus 2.3, FPC 3.3.1 macOS 12.1 x86_64 Xcode 13.2
Lazarus 2.3, FPC 3.3.1 macOS 12.1 aarch64 Xcode 13.2
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 amd64 VM

trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1813
  • Former Delphi 1-7, 10.2 user
Re: Trunk FPC fails to install on aarch64
« Reply #5 on: December 04, 2021, 11:54:46 pm »
Now my trunk Lazarus is complaining about not finding fppkg.cfg, and I wasn't sure about how to sort that out, but it seems to run OK without me having to sort it out. Back to working on openSSL... thanks

fppkg is the Free Pascal Packages download program which debuted in FPC 3.0.0. Does fppkg list -l show a list of installed packages? For example:

Code: Text  [Select][+][-]
  1. trev@macmini8 [/Users/trev] $ fppkg list -l
  2. Warning: The directory "//etc/fppkgconf.d/" of the include-mask "//etc/fppkgconf.d/*.conf" does not exist
  3. Name                 fpc            user           Available    
  4. aspell               3.3.1          -              -            
  5. bfd                  3.3.1          -              -            
  6. bzip2                3.3.1          -              -    
  7. [...]
Lazarus 2.3, FPC 3.3.1 macOS 12.1 x86_64 Xcode 13.2
Lazarus 2.3, FPC 3.3.1 macOS 12.1 aarch64 Xcode 13.2
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 amd64 VM

 

TinyPortal © 2005-2018