From 8846d79765798c19727e5fd42e4bfb2ba80c3378 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Fri, 23 Feb 2024 13:10:31 +0200 Subject: [PATCH] aedi: silence duplicate libraries linker warnings --- aedi/state.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/aedi/state.py b/aedi/state.py index 9f6442aa..733b32d8 100644 --- a/aedi/state.py +++ b/aedi/state.py @@ -100,20 +100,23 @@ class BuildState: 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