macOS version detection broken in configure
Carlo Cabrera
carlo.cabrera at me.com
Thu Oct 21 00:16:07 UTC 2021
> On 21 Oct 2021, at 04:03, Hans Åberg <haberg-1 at telia.com> wrote:
>
>
>> On 20 Oct 2021, at 18:59, Carlo Cabrera <carlo.cabrera at me.com> wrote:
>>
>> A library built with the correct linker options (`-undefined dynamic_lookup`)
>> should produce this output (built on macOS 10.15):
>>
>> ❯ otool -hV lib/libgmp.10.dylib
>> lib/libgmp.10.dylib:
>> Mach header
>> magic cputype cpusubtype caps filetype ncmds sizeofcmds flags
>> MH_MAGIC_64 X86_64 ALL 0x00 DYLIB 14 1632 NOUNDEFS DYLDLINK TWOLEVEL NO_REEXPORTED_DYLIBS
>
> This what the MacPorts version does:
>
> % otool -hV /opt/local/lib/libgmp.10.dylib
> Mach header
> magic cputype cpusubtype caps filetype ncmds sizeofcmds flags
> MH_MAGIC_64 X86_64 ALL 0x00 DYLIB 14 1616 NOUNDEFS DYLDLINK TWOLEVEL NO_REEXPORTED_DYLIBS
>
MacPorts sets `MACOSX_DEPLOYMENT_TARGET` in their build environment. This likely
elides the insertion of the linker flags `configure` is meant to generate, but
it seems to not hurt.
Correct behaviour from the `configure` script probably shouldn't depend on the
user setting environment variables to avoid misdetection of the OS version.
More information about the gmp-bugs
mailing list