summaryrefslogtreecommitdiff
path: root/config/darwin.config
diff options
context:
space:
mode:
Diffstat (limited to 'config/darwin.config')
-rw-r--r--config/darwin.config11
1 files changed, 11 insertions, 0 deletions
diff --git a/config/darwin.config b/config/darwin.config
index 7d59262a..3f6fbe11 100644
--- a/config/darwin.config
+++ b/config/darwin.config
@@ -49,6 +49,10 @@ if sdk_root is None:
elif not os.path.exists(sdk_root):
raise FatalError("Determined SDK path %s does not exist. Is your XCode installation broken?" % sdk_root);
+ret = shell.check_output(['xcodebuild', '-version']).strip()
+assert(ret.startswith('Xcode'))
+xcode_version = tuple(int(c) for c in ret.split()[1].split('.'))
+
min_osx_sdk_version = min_osx_sdk_version or '10.11'
sdk='-mmacosx-version-min=%s -isysroot %s' % (min_osx_sdk_version, sdk_root)
@@ -71,6 +75,11 @@ elif target_arch == Architecture.ARM64:
arch_ldflags += ' -arch arm64 -m64 -Wl,-arch,arm64'
arch_cflags += ' -Wno-error=format-nonliteral '
+# Starting with XCode 14, clang emits code that makes all binaries incompatible
+# with older XCode versions. Disable that feature.
+arch_objcflags = ''
+if xcode_version >= (14, 0):
+ arch_objcflags = ' -fno-objc-msgsend-selector-stubs '
incl_dir = os.path.join(prefix, 'include')
@@ -86,6 +95,8 @@ for f in ['CFLAGS', 'CCASFLAGS', 'CXXFLAGS', 'OBJCFLAGS', 'OBJCXXFLAGS']:
env[f] += ' %s ' % incflag
if sdk not in env[f]:
env[f] += ' %s ' % sdk
+env['OBJCFLAGS'] += arch_objcflags
+env['OBJCXXFLAGS'] += arch_objcflags
# To ensure that AC_CHECK_HEADER etc detect the right headers
if arch_cflags not in env['CPPFLAGS']: