[fpc-devel] Alignment issue on macOS 13 with Xcode 15 and up

Karl-Michael Schindler karl-michael.schindler at web.de
Wed Oct 4 12:19:42 CEST 2023



> Am 04.10.2023 um 12:00 schrieb fpc-devel-request at lists.freepascal.org:
> 
> Date: Tue, 3 Oct 2023 12:25:33 +0200
> From: Karl-Michael Schindler <karl-michael.schindler at web.de>
> To: fpc-devel at lists.freepascal.org
> Subject: [fpc-devel] Alignment issue on macOS 13 with Xcode 15 and up
> Message-ID: <55BCF6ED-4FDA-4E0C-B1CF-33085119B93B at web.de>
> Content-Type: text/plain; charset=us-ascii
> 
> Hi.
> 
> There is an alignment issue on macOS 13 with Xcode 15 and up. As much as I understand this commit on the main branch
> 
> https://gitlab.com/freepascal.org/fpc/source/-/commit/51fdbb5524512dc3279d0cca38d44b38160b8111
> 
> fixes it.
> 
> I propose that this patch is also applied to the 3.2.2-fixes branch and is also included in the 3.2.4 release.
> 
> Greetings - Michael.

Actually, the patch is not sufficient to fix the issue. When building the 3.2.2 version on macOS 13 arm with the command line tools from Xcode 15 it breaks with:

… many, many ld warnings about pointer alignment similar to the next 3
ld: warning: pointer not aligned at _THREADVARLIST_$CHARSET+0xC from /opt/local/var/macports/build/_Users_michael_Developer_macports-ports_lang_fpc/fpc/work/fpcbuild-3.2.2/fpcsrc/rtl/units/x86_64-darwin/charset.o
ld: warning: pointer not aligned at _THREADVARLIST_$CHARSET+0x24 from /opt/local/var/macports/build/_Users_michael_Developer_macports-ports_lang_fpc/fpc/work/fpcbuild-3.2.2/fpcsrc/rtl/units/x86_64-darwin/charset.o
ld: warning: pointer not aligned at _THREADVARLIST_$FPWIDESTRING+0xC from /opt/local/var/macports/build/_Users_michael_Developer_macports-ports_lang_fpc/fpc/work/fpcbuild-3.2.2/fpcsrc/rtl/units/x86_64-darwin/fpwidestring.o
ld: pointer not 4-byte aligned at __DATA_CONST+0x9A6, fix alignment or disable chained fixups
An error occurred while linking  pp.pas(252,36) Error: Error while linking
pp.pas(252,36) Fatal: There were 1 errors compiling module, stopping
Fatal: Compilation aborted
make[3]: *** [ppc] Error 1
make[3]: Leaving directory `/opt/local/var/macports/build/_Users_michael_Developer_macports-ports_lang_fpc/fpc/work/fpcbuild-3.2.2/fpcsrc/compiler'
make[2]: *** [cycle] Error 2
make[2]: Leaving directory `/opt/local/var/macports/build/_Users_michael_Developer_macports-ports_lang_fpc/fpc/work/fpcbuild-3.2.2/fpcsrc/compiler'
make[1]: *** [compiler_cycle] Error 2
make[1]: Leaving directory `/opt/local/var/macports/build/_Users_michael_Developer_macports-ports_lang_fpc/fpc/work/fpcbuild-3.2.2/fpcsrc'
make: *** [build-stamp.aarch64-darwin] Error 2

With the command line tools of Xcode 14 it runs through without any warning nor error. Would a patch from this commit (https://gitlab.com/freepascal.org/fpc/source/-/blob/82dd70e72f3ab33b1b8737f743e1cdd009d9c8a1/compiler/x86_64/cpupara.pas) help?

Michael.



More information about the fpc-devel mailing list