File tree 1 file changed +6
-1
lines changed
compiler/rustc_codegen_ssa/src/back
1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -2079,9 +2079,14 @@ fn add_local_native_libraries(
2079
2079
NativeLibKind :: Framework { as_needed } => {
2080
2080
cmd. link_framework ( name, as_needed. unwrap_or ( true ) )
2081
2081
}
2082
- NativeLibKind :: Static { whole_archive, .. } => {
2082
+ NativeLibKind :: Static { whole_archive, bundle , .. } => {
2083
2083
if whole_archive == Some ( true )
2084
2084
|| ( whole_archive == None && default_to_whole_archive ( sess, crate_type, cmd) )
2085
+ // Backward compatibility case: this can be a rlib (so `+whole-archive` cannot
2086
+ // be added explicitly if necessary, see the error in `fn link_rlib`) compiled
2087
+ // as an executable due to `--test`. Use whole-archive implicitly, like before
2088
+ // the introduction of native lib modifiers.
2089
+ || ( bundle != Some ( false ) && sess. opts . test )
2085
2090
{
2086
2091
cmd. link_whole_staticlib (
2087
2092
name,
You can’t perform that action at this time.
0 commit comments