--- tools/build/src/tools/darwin.jam.orig +++ tools/build/src/tools/darwin.jam @@ -431,6 +431,7 @@ local support-ppc64 = 1 ; osx-version ?= $(.host-osx-version) ; + local osx-version-split = [ regex.split $(osx-version) \\. ] ; switch $(osx-version) { @@ -440,7 +441,7 @@ } case * : - if $(osx-version) && ! [ version.version-less [ regex.split $(osx-version) \\. ] : 10 6 ] + if $(osx-version) && ! [ version.version-less $(osx-version-split) : 10 6 ] { # When targeting 10.6: # - gcc 4.2 will give a compiler errir if ppc64 compilation is requested @@ -452,7 +453,16 @@ { case combined : { - if $(address-model) = 32_64 { + if ! [ version.version-less $(osx-version-split) : 11 0 ] + { + # macOS 11.0 "Big Sur" and later is always 64-bit ... + if ( $(address_model) = 32 || $(address_model) = 32_64 ) { + echo "'address_model' contains 32; macOS 11 or later builds 64 only; overriding" ; + address-model = 64 ; + } + # ... and "combined" means Intel and ARM + options = -arch x86_64 -arch arm64 ; + } else if $(address-model) = 32_64 { if $(support-ppc64) { options = -arch i386 -arch ppc -arch x86_64 -arch ppc64 ; } else { @@ -500,8 +510,18 @@ case arm : { + if ! [ version.version-less $(osx-version-split) : 11 0 ] + { + # macOS 11.0 "Big Sur" and later is always 64-bit + if ( $(address_model) = 32 || $(address_model) = 32_64 ) { + echo "'address_model' contains 32; macOS 11 or later builds 64 only; overriding" ; + address-model = 64 ; + } + } if $(instruction-set) { options = -arch$(_)$(instruction-set) ; + } else if $(address-model) = 64 { + options = -arch arm64 ; } else { options = -arch arm ; }