Build failure on macOS Sonoma 14.0 beta
Marc Culler
marc.culler at gmail.com
Wed Sep 20 22:45:05 CEST 2023
I have found a workaround -- NOT A FIX -- for this problem.
I learned by reading the release notes for XCode 15 that Apple rewrote the
linker for XCode 15. They also made the old linker available by using
-ld64 as a linker option. Sure enough, if I add
$ export LDFLAGS="-ld64"
then my build works fine, even with the "arm long set of options" that I
had been using for several years.
Apple says that the old linker will be removed from a later release of
XCode.
I think this is a bug in Apple's new linker, which causes it to incorrectly
report out-of-range branch commands, even in functions which are written in
assembly language and which contain no branch commands whatsoever.
I hope that the GMP project will try and succeed at getting Apple to fix
this bug. (I have given up trying to get Apple to fix bugs. They just
ignore me.)
- Marc
On Wed, Sep 20, 2023 at 12:14 PM Marc Culler <marc.culler at gmail.com> wrote:
> And one more --
>
> The build fails in the same way when I remove --enable-fat but use
> export CFLAGS="-arch x86_64 -mmacosx-version-min=10.9 -mno-avx -mno-avx2
> -mno-bmi2"
>
> I am concluding that Apple has silently dropped support for old Intel CPUs
> which are supported by OSX 10.9.
>
> - Marc
>
> On Wed, Sep 20, 2023 at 12:01 PM Marc Culler <marc.culler at gmail.com>
> wrote:
>
>> One more data point -- I do get a successful build if I omit the
>> --enable-fat option. That means no CFLAGS and configuring with:
>>
>> $ ./configure --with-pic --prefix=XXXXXX
>>
>> In this case the compiler options include:
>> -mtune=skylake -march=broadwell
>>
>> - Marc
>>
>> On Wed, Sep 20, 2023 at 11:49 AM Marc Culler <marc.culler at gmail.com>
>> wrote:
>>
>>> With no CFLAGS and using
>>>
>>> $ ./configure --with-pic --enable-fat --prefix=XXXXX
>>>
>>> I get almost the same error (the difference being the distance of the
>>> branch), namely:
>>>
>>> ld: branch8 out of range 378633 in ___gmpn_add_nc_x86_64
>>>
>>> - Marc
>>>
>>> On Wed, Sep 20, 2023 at 11:25 AM Hans Åberg <haberg-1 at telia.com> wrote:
>>>
>>>>
>>>>
>>>> > On 20 Sep 2023, at 16:36, Marc Culler <marc.culler at gmail.com> wrote:
>>>> >
>>>> > …macOS Sonoma beta…
>>>> …
>>>> > …using: "Apple clang version 15.0.0
>>>> > (clang-1500.0.40.1)"
>>>>
>>>> The same compiler version is now available on MacOS 13, together with
>>>> Xcode 15.
>>>>
>>>>
More information about the gmp-bugs
mailing list