Skip to content

Commit b1cb117

Browse files
author
Alessandro Patti
committed
Use -filelist when linking swift_library as the list of objects can be too long
1 parent 9282bc5 commit b1cb117

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

swift/internal/linking.bzl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,11 @@ def _register_static_library_link_action(
5858
)
5959
args = actions.args()
6060
args.add_all(command_line)
61-
args.add_all(objects)
61+
args.add("-filelist")
62+
objects_args = actions.args()
63+
objects_args.set_param_file_format("multiline")
64+
objects_args.use_param_file("%s", use_always=True)
65+
objects_args.add_all(objects)
6266

6367
env = cc_common.get_environment_variables(
6468
action_name = CPP_LINK_STATIC_LIBRARY_ACTION_NAME,
@@ -68,7 +72,7 @@ def _register_static_library_link_action(
6872

6973
actions.run(
7074
executable = archiver_path,
71-
arguments = [args],
75+
arguments = [args, objects_args],
7276
env = env,
7377
# TODO(allevato): It seems like the `cc_common` APIs should have a way to get this value
7478
# so that it can be handled consistently for the toolchain in use.

0 commit comments

Comments
 (0)