Pass -no_deduplicate to darwin ld.
This disables slow code deduplication pass and speeds up yt/core/unittests
linking from 32 to 3 seconds.
@@ -1566,7 +1566,9 @@ class LD(Linker):
if is_positive('USE_LTO'):
# https://github.com/android-ndk/ndk/issues/498
self.ld_flags.append('-Wl,-plugin-opt,-emulated-tls')
- if target.is_macos and not self.tc.is_clang:
+ if target.is_macos:
+ self.ld_flags.append('-Wl,-no_deduplicate')
+ if not self.tc.is_clang:
self.ld_flags.append('-Wl,-no_compact_unwind')
self.link_pie_executables = target.is_android
