@@ -1668,7 +1668,7 @@ def _get_crate_dirname(crate):
1668
1668
"""
1669
1669
return crate .output .dirname
1670
1670
1671
- def _portable_link_flags (lib , use_pic , ambiguous_libs , get_lib_name , for_windows ):
1671
+ def _portable_link_flags (lib , use_pic , ambiguous_libs , get_lib_name , for_windows = False , for_darwin = False ):
1672
1672
artifact = get_preferred_artifact (lib , use_pic )
1673
1673
if ambiguous_libs and artifact .path in ambiguous_libs :
1674
1674
artifact = ambiguous_libs [artifact .path ]
@@ -1706,7 +1706,7 @@ def _portable_link_flags(lib, use_pic, ambiguous_libs, get_lib_name, for_windows
1706
1706
artifact .basename .startswith ("libtest-" ) or artifact .basename .startswith ("libstd-" ) or
1707
1707
artifact .basename .startswith ("test-" ) or artifact .basename .startswith ("std-" )
1708
1708
):
1709
- return ["-lstatic=%s" % get_lib_name (artifact )]
1709
+ return [] if for_darwin else [ "-lstatic=%s" % get_lib_name (artifact )]
1710
1710
return [
1711
1711
"-lstatic=%s" % get_lib_name (artifact ),
1712
1712
"-Clink-arg=-l%s" % (get_lib_name (artifact ) if not for_windows else artifact .basename ),
@@ -1738,7 +1738,7 @@ def _make_link_flags_darwin(linker_input_and_use_pic_and_ambiguous_libs):
1738
1738
("link-arg=-Wl,-force_load,%s" % get_preferred_artifact (lib , use_pic ).path ),
1739
1739
])
1740
1740
else :
1741
- ret .extend (_portable_link_flags (lib , use_pic , ambiguous_libs , get_lib_name_default , for_windows = False ))
1741
+ ret .extend (_portable_link_flags (lib , use_pic , ambiguous_libs , get_lib_name_default , for_darwin = True ))
1742
1742
return ret
1743
1743
1744
1744
def _make_link_flags_default (linker_input_and_use_pic_and_ambiguous_libs ):
@@ -1755,7 +1755,7 @@ def _make_link_flags_default(linker_input_and_use_pic_and_ambiguous_libs):
1755
1755
"link-arg=-Wl,--no-whole-archive" ,
1756
1756
])
1757
1757
else :
1758
- ret .extend (_portable_link_flags (lib , use_pic , ambiguous_libs , get_lib_name_default , for_windows = False ))
1758
+ ret .extend (_portable_link_flags (lib , use_pic , ambiguous_libs , get_lib_name_default ))
1759
1759
return ret
1760
1760
1761
1761
def _libraries_dirnames (linker_input_and_use_pic_and_ambiguous_libs ):
0 commit comments