December 06, 2023

To build a binary support old macOS with clang, you can use options like -arch x86_64 -mmacosx-version-min=10.11

when link with ldc2 (1.36.0-beta), there will be a warning

object.o has version 13.0.0, which is newer than target minimum of 10.11.0

Is there a way to set the ldc2 generate same version object like clang option -mmacosx-version-min=10.11 ?

December 06, 2023

On Wednesday, 6 December 2023 at 10:40:39 UTC, d007 wrote:

>

To build a binary support old macOS with clang, you can use options like -arch x86_64 -mmacosx-version-min=10.11

when link with ldc2 (1.36.0-beta), there will be a warning

object.o has version 13.0.0, which is newer than target minimum of 10.11.0

Is there a way to set the ldc2 generate same version object like clang option -mmacosx-version-min=10.11 ?

You can try setting the version explicitly in the triple, e.g.
-mtriple=arm64-apple-macosx10.11.

From LDC 1.36.0-beta1 [1] you can use MACOSX_DEPLOYMENT_TARGET [2].

cheers,
Johan

[1] https://github.com/ldc-developers/ldc/pull/4534)

[2] https://developer.apple.com/library/archive/documentation/DeveloperTools/Conceptual/cross_development/Configuring/configuring.html