diff options
author | pg <pg@yandex-team.com> | 2025-02-26 20:01:13 +0300 |
---|---|---|
committer | pg <pg@yandex-team.com> | 2025-02-26 20:56:14 +0300 |
commit | 73f2e377bb4a5061f08f495a61340b482d355565 (patch) | |
tree | 8cd52119cd045f030f4c35dc718229d382d2f233 /build/scripts/link_o.py | |
parent | 725f044263c17a834658ee8bc14d2839d829914b (diff) | |
download | ydb-73f2e377bb4a5061f08f495a61340b482d355565.tar.gz |
v2
commit_hash:b1ef83d5b70569b92f918e825d5e290cc8e3c886
Diffstat (limited to 'build/scripts/link_o.py')
-rw-r--r-- | build/scripts/link_o.py | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/build/scripts/link_o.py b/build/scripts/link_o.py new file mode 100644 index 0000000000..298f7ee16c --- /dev/null +++ b/build/scripts/link_o.py @@ -0,0 +1,29 @@ +import subprocess +import sys +import os + + +def flt(args): + for a in args: + if a == '-o': + yield '-Wl,-r' + yield '-fuse-ld=lld' + yield '-nodefaultlibs' + yield '-nostartfiles' + yield '-Wl,-no-pie' + yield '-o' + elif a.endswith('.o'): + yield a + elif '--ld' in a: + yield a + elif '--target' in a: + yield a + + +if '-apple-macos' in str(sys.argv): + cmd = sys.argv[1:] +else: + cmd = [sys.argv[1]] + list(flt(sys.argv[2:])) + + +subprocess.check_call(cmd) |