diff options
author | nechda <nechda@yandex-team.com> | 2024-11-07 21:01:46 +0300 |
---|---|---|
committer | nechda <nechda@yandex-team.com> | 2024-11-07 21:14:06 +0300 |
commit | 78f8d3bf9f1e44abd6880b0a2660ed53fef15d58 (patch) | |
tree | df4b531f9d964f25226e2ebf6cfc4b85d850a53a | |
parent | bd9e9d1e41e0605e465d6d022cd5231bd8b82cab (diff) | |
download | ydb-78f8d3bf9f1e44abd6880b0a2660ed53fef15d58.tar.gz |
Enable mold linker only under flag
commit_hash:88f3c9f91eafb63005672effecfca95cd50444b5
-rw-r--r-- | build/ymake.core.conf | 2 | ||||
-rwxr-xr-x | build/ymake_conf.py | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/build/ymake.core.conf b/build/ymake.core.conf index 90e73a793a..fdb50d6784 100644 --- a/build/ymake.core.conf +++ b/build/ymake.core.conf @@ -818,7 +818,7 @@ _LINKER_ID= # GCC does not support -fuse-ld with an executable path, # only -fuse-ld=gold or -fuse-ld=lld. when ($_LINKER_ID != "" && $_DEFAULT_LINKER_ID != "" && $CLANG == "yes" && $NEED_PLATFORM_PEERDIRS == "yes") { - when ($_LINKER_ID in [ "gold", "lld" ]) { + when ($_LINKER_ID in [ "gold", "lld", "mold" ]) { PEERDIR+=build/platform/${_LINKER_ID} } } diff --git a/build/ymake_conf.py b/build/ymake_conf.py index 8ed86d8cde..982dce80fc 100755 --- a/build/ymake_conf.py +++ b/build/ymake_conf.py @@ -1640,6 +1640,7 @@ class Linker(object): BFD = 'bfd' LLD = 'lld' GOLD = 'gold' + MOLD = 'mold' def __init__(self, tc, build): """ @@ -1651,6 +1652,9 @@ class Linker(object): self.type = self._get_default_linker_type() def _get_default_linker_type(self): + if (self.build.host.is_linux or self.build.host.is_macos) and is_positive('USE_MOLD_LINKER'): + return Linker.MOLD + if not self.tc.is_from_arcadia or is_positive('EXPORT_CMAKE'): # External (e.g. system) toolchain: disable linker selection logic return None |