@@ -26,7 +26,7 @@ load("//rust:rust_common.bzl", "BuildInfo")
26
26
load ("//rust/private:rustc.bzl" , "get_linker_and_args" )
27
27
28
28
# buildifier: disable=bzl-visibility
29
- load ("//rust/private:utils.bzl" , "find_cc_toolchain" , "get_preferred_artifact" )
29
+ load ("//rust/private:utils.bzl" , "find_cc_toolchain" , "get_lib_name_default" , " get_preferred_artifact" )
30
30
31
31
# TODO(hlopko): use the more robust logic from rustc.bzl also here, through a reasonable API.
32
32
def _get_libs_for_static_executable (dep ):
@@ -116,11 +116,11 @@ def _generate_cc_link_build_info(ctx, cc_lib):
116
116
for linker_input in cc_lib [CcInfo ].linking_context .linker_inputs .to_list ():
117
117
for lib in linker_input .libraries :
118
118
if lib .static_library :
119
- linker_flags .append ("-lstatic={}" .format (lib .static_library . owner . name ))
119
+ linker_flags .append ("-lstatic={}" .format (get_lib_name_default ( lib .static_library ) ))
120
120
linker_search_paths .append (lib .static_library .dirname )
121
121
compile_data .append (lib .static_library )
122
122
elif lib .pic_static_library :
123
- linker_flags .append ("-lstatic={}" .format (lib .pic_static_library . owner . name ))
123
+ linker_flags .append ("-lstatic={}" .format (get_lib_name_default ( lib .pic_static_library ) ))
124
124
linker_search_paths .append (lib .pic_static_library .dirname )
125
125
compile_data .append (lib .pic_static_library )
126
126
0 commit comments