aedi: apply linker workaround to affected clang version only

xcode 15.0 and 15.0.1 have weak symbols compatibility issue, they were released with clang version 1500.0.40.1
the bug was fixed in xcode 15.1 which was shipped with clang version 1500.1.0.2.5
This commit is contained in:
alexey.lysiuk 2023-12-15 15:42:03 +02:00
parent 0a59773019
commit e8d8bba6ab

View file

@ -107,13 +107,12 @@ class BuildState:
# Workaround: Bump the minimum deployment target to iOS 15, macOS 12, watchOS 8 or tvOS 15,
# or add -Wl,-ld_classic to the OTHER_LDFLAGS build setting.
ld_classic_arg = '-Wl,-ld_classic'
check_args = ('clang', '-xc++', ld_classic_arg, '-')
check_code = b'int main() {}'
version_output = subprocess.run(('clang', '--version'), check=True, capture_output=True)
version_match = re.search(r'\(clang-([\d.]+)\)', version_output.stdout.decode('ascii'))
version = StrictVersion(version_match.group(1))
if subprocess.run(check_args, capture_output=True, input=check_code).returncode == 0:
self._linker_flags += f' {ld_classic_arg}'
os.unlink('a.out')
if version.major == 1500 and version.minor == 0:
self._linker_flags += ' -Wl,-ld_classic'
return self._linker_flags