Browse Source

Add start-end markers of response file to link cmd

tekireeva 1 year ago
parent
commit
157df07dbf
3 changed files with 7 additions and 2 deletions
  1. 1 1
      build/conf/linkers/ld.conf
  2. 3 0
      build/scripts/link_exe.py
  3. 3 1
      build/scripts/link_fat_obj.py

+ 1 - 1
build/conf/linkers/ld.conf

@@ -15,7 +15,7 @@ when ($OS_LINUX == "yes" || $OS_ANDROID == "yes" || $OS_CYGWIN == "yes" || $OS_N
     END_WHOLE_ARCHIVE_VALUE=-Wl,--no-whole-archive
     LD_STRIP_FLAG=-s
     _SONAME_OPTION=-soname
-    _LD_SRCS_GLOBALS=-Wl,--whole-archive ${rootrel;ext=.a:SRCS_GLOBAL} -Wl,--no-whole-archive ${rootrel;ext=.o:SRCS_GLOBAL} ${rootrel;ext=.supp:SRCS_GLOBAL}
+    _LD_SRCS_GLOBALS=-Wl,--whole-archive --ya-start-command-file ${rootrel;ext=.a:SRCS_GLOBAL} --ya-end-command-file -Wl,--no-whole-archive ${rootrel;ext=.o:SRCS_GLOBAL} ${rootrel;ext=.supp:SRCS_GLOBAL}
 }
 
 when ($_LD_WHOLE_ARCHIVE == "yes") {

+ 3 - 0
build/scripts/link_exe.py

@@ -2,6 +2,8 @@ import sys
 import subprocess
 import optparse
 
+import process_command_files as pcf
+
 from process_whole_archive_option import ProcessWholeArchiveOption
 
 
@@ -155,6 +157,7 @@ def parse_args():
 
 if __name__ == '__main__':
     opts, args = parse_args()
+    args = pcf.skip_markers(args)
 
     cmd = fix_blas_resolving(args)
     cmd = remove_excessive_flags(cmd)

+ 3 - 1
build/scripts/link_fat_obj.py

@@ -2,6 +2,8 @@ import argparse
 import subprocess
 import sys
 
+import process_command_files as pcf
+
 from process_whole_archive_option import ProcessWholeArchiveOption
 
 YA_ARG_PREFIX = '-Ya,'
@@ -19,7 +21,7 @@ def get_args():
 
     groups = {}
     args_list = groups.setdefault('default', [])
-    for arg in sys.argv[1:]:
+    for arg in pcf.iter_args(sys.argv[1:]):
         if arg == '--with-own-obj':
             groups['default'].append(arg)
         elif arg == '--globals-lib':