Opened 4 years ago

Closed 3 years ago

#62141 closed defect (fixed)

fpc@3.2.0: build for arm64 on macports

Reported by: kencu (Ken) Owned by: kamischi (Karl-Michael Schindler)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc:
Port: fpc

Description

This ticket is to track success getting a version of fpc (and then Lazarus) building and running on arm64 macOS.

We are working on this branch <https://github.com/kamischi/macports-ports/tree/kms-fpc-update-arm>.

To start, I have built this through on arm64 BigSur to this point:

[ 99%] Compiled package vcl-compat
make[2]: Leaving directory `/opt/local/var/macports/build/_Users_Shared_kencurepos_kamischi_macports-ports_lang_fpc/fpc/work/fpcbuild-3.2.0/fpcsrc/packages'
make[1]: Leaving directory `/opt/local/var/macports/build/_Users_Shared_kencurepos_kamischi_macports-ports_lang_fpc/fpc/work/fpcbuild-3.2.0/fpcsrc'
/opt/local/bin/gecho Build > build-stamp.aarch64-darwin
/opt/local/bin/gecho Build > base.build-stamp.aarch64-darwin
make: Leaving directory `/opt/local/var/macports/build/_Users_Shared_kencurepos_kamischi_macports-ports_lang_fpc/fpc/work/fpcbuild-3.2.0/fpcsrc'
sh: line 1: 80199 Killed: 9               ../ppca64 -WM11.0 -Fu../../rtl/units/aarch64-darwin -ap -v0 -XR/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk msgdif.pp
Command failed: ../ppca64 -WM11.0 -Fu../../rtl/units/aarch64-darwin -ap -v0  -XR/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk msgdif.pp &&  ../ppca64 -WM11.0 -Fu../../rtl/units/aarch64-darwin -ap -v0  -XR/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk msg2inc.pp
Exit code: 137
Error: Failed to build fpc: command execution failed
Error: See /opt/local/var/macports/logs/_Users_Shared_kencurepos_kamischi_macports-ports_lang_fpc/fpc/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets to report a bug.
Error: Processing of port fpc failed

This sysroot error occurred many times:

clang: warning: using sysroot for 'MacOSX' but targeting 'iPhone' [-Wincompatible-sysroot]

Trying to run the compiler fails:

% ./fpcsrc/compiler/ppca64       
zsh: killed     ./fpcsrc/compiler/ppca64

full log attached.

Attachments (1)

fpc-3.2.0-build-arm64-MacOS.txt.zip (25.0 KB) - added by kencu (Ken) 4 years ago.

Download all attachments as: .zip

Change History (5)

Changed 4 years ago by kencu (Ken)

comment:1 Changed 4 years ago by kencu (Ken)

The system recognizes it:

% file ./fpcsrc/compiler/ppca64
./fpcsrc/compiler/ppca64: Mach-O 64-bit executable arm64

I cannot seem to find any crashlogs, strangely... and running it under lldb gives me nothing but the same error.

Hmm....

comment:2 Changed 4 years ago by kencu (Ken)

interestingly, there is this compiler also generated, and it seems to work just fine:

 % file ppcrossa64
ppcrossa64: Mach-O 64-bit executable x86_64

% ./ppcrossa64
Free Pascal Compiler version 3.2.0 [2021/01/24] for aarch64
Copyright (c) 1993-2020 by Florian Klaempfl and others
./ppcrossa64 [options] <inputfile> [options]
 Put + after a boolean switch option to enable it, - to disable it.
  @<x>   Read compiler options from <x> in addition to the default fpc.cfg
  -a     The compiler does not delete the generated assembler file
      -a5        Don't generate Big Obj COFF files for GNU Binutils older than 2.25 (Windows, NativeNT)
      -al        List sourcecode lines in assembler file
      -an        List node info in assembler file (-dEXTDEBUG compiler)
      -ao        Add an extra option to external assembler call (ignored for internal)
      -ap        Use pipes instead of creating temporary assembler files
      -ar        List register allocation/release info in assembler file
      -at        List temp allocation/release info in assembler file
  -A<x>  Output format:
      -Adefault  Use default assembler
  -b     Generate browser info
      -bl        Generate local symbol info
  -B     Build all modules
  -C<x>  Code generation options:

comment:3 Changed 3 years ago by kamischi (Karl-Michael Schindler)

The latest version (3.2.2) builds and runs on arm. I think this ticket can be closed.

comment:4 Changed 3 years ago by kencu (Ken)

Resolution: fixed
Status: assignedclosed

thank you

Note: See TracTickets for help on using tickets.