aboutsummaryrefslogtreecommitdiffstats
path: root/build/scripts/link_fat_obj.py
diff options
context:
space:
mode:
authorsomov <somov@yandex-team.ru>2022-02-10 16:45:47 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:45:47 +0300
commita5950576e397b1909261050b8c7da16db58f10b1 (patch)
tree7ba7677f6a4c3e19e2cefab34d16df2c8963b4d4 /build/scripts/link_fat_obj.py
parent81eddc8c0b55990194e112b02d127b87d54164a9 (diff)
downloadydb-a5950576e397b1909261050b8c7da16db58f10b1.tar.gz
Restoring authorship annotation for <somov@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'build/scripts/link_fat_obj.py')
-rw-r--r--build/scripts/link_fat_obj.py74
1 files changed, 37 insertions, 37 deletions
diff --git a/build/scripts/link_fat_obj.py b/build/scripts/link_fat_obj.py
index c189668b9e..c21a6f4cd8 100644
--- a/build/scripts/link_fat_obj.py
+++ b/build/scripts/link_fat_obj.py
@@ -4,10 +4,10 @@ import sys
from process_whole_archive_option import ProcessWholeArchiveOption
-YA_ARG_PREFIX = '-Ya,'
-
-
-def get_args():
+YA_ARG_PREFIX = '-Ya,'
+
+
+def get_args():
parser = argparse.ArgumentParser()
parser.add_argument('--obj')
parser.add_argument('--globals-lib')
@@ -17,9 +17,9 @@ def get_args():
parser.add_argument('--with-own-obj', action='store_true', default=False)
parser.add_argument('--with-global-srcs', action='store_true', default=False)
- groups = {}
- args_list = groups.setdefault('default', [])
- for arg in sys.argv[1:]:
+ groups = {}
+ args_list = groups.setdefault('default', [])
+ for arg in sys.argv[1:]:
if arg == '--with-own-obj':
groups['default'].append(arg)
elif arg == '--globals-lib':
@@ -27,40 +27,40 @@ def get_args():
elif arg == '--with-global-srcs':
groups['default'].append(arg)
elif arg.startswith(YA_ARG_PREFIX):
- group_name = arg[len(YA_ARG_PREFIX):]
- args_list = groups.setdefault(group_name, [])
- else:
- args_list.append(arg)
-
- return parser.parse_args(groups['default']), groups
-
-
+ group_name = arg[len(YA_ARG_PREFIX):]
+ args_list = groups.setdefault(group_name, [])
+ else:
+ args_list.append(arg)
+
+ return parser.parse_args(groups['default']), groups
+
+
def strip_suppression_files(srcs):
return [s for s in srcs if not s.endswith('.supp')]
-def main():
- args, groups = get_args()
-
- # Inputs
- auto_input = groups['input']
-
- # Outputs
+def main():
+ args, groups = get_args()
+
+ # Inputs
+ auto_input = groups['input']
+
+ # Outputs
lib_output = args.lib
obj_output = args.obj
-
- # Dependencies
- global_srcs = groups['global_srcs']
+
+ # Dependencies
+ global_srcs = groups['global_srcs']
global_srcs = strip_suppression_files(global_srcs)
global_srcs = ProcessWholeArchiveOption(args.arch).construct_cmd(global_srcs)
- peers = groups['peers']
-
- # Tools
- linker = groups['linker']
- archiver = groups['archiver']
-
+ peers = groups['peers']
+
+ # Tools
+ linker = groups['linker']
+ archiver = groups['archiver']
+
do_link = linker + ['-o', obj_output, '-Wl,-r', '-nodefaultlibs', '-nostartfiles'] + global_srcs + auto_input
- do_archive = archiver + [lib_output] + peers
+ do_archive = archiver + [lib_output] + peers
do_globals = None
if args.globals_lib:
do_globals = archiver + [args.globals_lib] + auto_input + global_srcs
@@ -84,8 +84,8 @@ def main():
if glob_res:
sys.exit(glob_res)
- sys.exit(call(do_archive))
-
-
-if __name__ == '__main__':
- main()
+ sys.exit(call(do_archive))
+
+
+if __name__ == '__main__':
+ main()