Skip to content

Commit

Permalink
no message
Browse files Browse the repository at this point in the history
  • Loading branch information
alexey-lysiuk committed Feb 23, 2024
1 parent 5aea6f2 commit 0ffa111
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions aedi/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,20 +100,23 @@ def linker_flags(self) -> str:
if not self._linker_flags:
self._linker_flags = f'-L{self.lib_path}'

# Fix for Xcode 15.0 known issue with the new linker
# https://developer.apple.com/documentation/xcode-release-notes/xcode-15-release-notes#Known-Issues
# Binaries using symbols with a weak definition crash at runtime on iOS 14/macOS 12 or older.
# This impacts primarily C++ projects due to their extensive use of weak symbols. (114813650) (FB13097713)
# 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.

version_output = subprocess.run(('clang', '--version'), check=True, capture_output=True)
version_match = re.search(r'\(clang-([\d.]+)\)', version_output.stdout.decode('ascii'))

if version_match:
version = StrictVersion(version_match.group(1))

if version.major >= 1500:
# Silence ld: warning: ignoring duplicate libraries: '...'
self._linker_flags += ' -Wl,-no_warn_duplicate_libraries'

if version.major == 1500 and version.minor == 0:
# Fix for Xcode 15.0 known issue with the new linker
# https://developer.apple.com/documentation/xcode-release-notes/xcode-15-release-notes#Known-Issues
# Binaries using symbols with a weak definition crash at runtime on iOS 14/macOS 12 or older.
# This impacts primarily C++ projects due to their extensive use of weak symbols. (114813650) (FB13097713)
# 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.
self._linker_flags += ' -Wl,-ld_classic'

return self._linker_flags
Expand Down

0 comments on commit 0ffa111

Please sign in to comment.