@@ -1609,7 +1609,7 @@ def _get_crate_dirname(crate):
1609
1609
"""
1610
1610
return crate .output .dirname
1611
1611
1612
- def _portable_link_flags (lib , use_pic , ambiguous_libs , get_lib_name , for_windows ):
1612
+ def _portable_link_flags (lib , use_pic , ambiguous_libs , get_lib_name , for_windows = False , for_macos = False ):
1613
1613
artifact = get_preferred_artifact (lib , use_pic )
1614
1614
if ambiguous_libs and artifact .path in ambiguous_libs :
1615
1615
artifact = ambiguous_libs [artifact .path ]
@@ -1647,7 +1647,7 @@ def _portable_link_flags(lib, use_pic, ambiguous_libs, get_lib_name, for_windows
1647
1647
artifact .basename .startswith ("libtest-" ) or artifact .basename .startswith ("libstd-" ) or
1648
1648
artifact .basename .startswith ("test-" ) or artifact .basename .startswith ("std-" )
1649
1649
):
1650
- return ["-lstatic=%s" % get_lib_name (artifact )]
1650
+ return [] if for_macos else [ "-lstatic=%s" % get_lib_name (artifact )]
1651
1651
return [
1652
1652
"-lstatic=%s" % get_lib_name (artifact ),
1653
1653
"-Clink-arg=-l%s" % (get_lib_name (artifact ) if not for_windows else artifact .basename ),
@@ -1679,7 +1679,7 @@ def _make_link_flags_darwin(linker_input_and_use_pic_and_ambiguous_libs):
1679
1679
("link-arg=-Wl,-force_load,%s" % get_preferred_artifact (lib , use_pic ).path ),
1680
1680
])
1681
1681
else :
1682
- ret .extend (_portable_link_flags (lib , use_pic , ambiguous_libs , get_lib_name_default , for_windows = False ))
1682
+ ret .extend (_portable_link_flags (lib , use_pic , ambiguous_libs , get_lib_name_default , for_macos = True ))
1683
1683
return ret
1684
1684
1685
1685
def _make_link_flags_default (linker_input_and_use_pic_and_ambiguous_libs ):
@@ -1696,7 +1696,7 @@ def _make_link_flags_default(linker_input_and_use_pic_and_ambiguous_libs):
1696
1696
"link-arg=-Wl,--no-whole-archive" ,
1697
1697
])
1698
1698
else :
1699
- ret .extend (_portable_link_flags (lib , use_pic , ambiguous_libs , get_lib_name_default , for_windows = False ))
1699
+ ret .extend (_portable_link_flags (lib , use_pic , ambiguous_libs , get_lib_name_default ))
1700
1700
return ret
1701
1701
1702
1702
def _libraries_dirnames (linker_input_and_use_pic_and_ambiguous_libs ):
0 commit comments