File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
compiler/rustc_codegen_ssa/src/back Expand file tree Collapse file tree 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(
20792079 NativeLibKind :: Framework { as_needed } => {
20802080 cmd. link_framework ( name, as_needed. unwrap_or ( true ) )
20812081 }
2082- NativeLibKind :: Static { whole_archive, .. } => {
2082+ NativeLibKind :: Static { whole_archive, bundle , .. } => {
20832083 if whole_archive == Some ( true )
20842084 || ( 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 )
20852090 {
20862091 cmd. link_whole_staticlib (
20872092 name,
You can’t perform that action at this time.
0 commit comments