(sess: &Session, codegen_results: &CodegenResults, out_filename: &Path)
| 91 | } |
| 92 | |
| 93 | fn link_rlib(sess: &Session, codegen_results: &CodegenResults, out_filename: &Path) { |
| 94 | let mut file_list = Vec::<&Path>::new(); |
| 95 | for obj in codegen_results |
| 96 | .modules |
| 97 | .iter() |
| 98 | .filter_map(|m| m.object.as_ref()) |
| 99 | { |
| 100 | file_list.push(obj); |
| 101 | } |
| 102 | for lib in codegen_results.crate_info.used_libraries.iter() { |
| 103 | if let NativeLibKind::Static { |
| 104 | bundle: None | Some(true), |
| 105 | .. |
| 106 | } = lib.kind |
| 107 | { |
| 108 | sess.err(format!( |
| 109 | "adding native library to rlib not supported yet: {}", |
| 110 | lib.name |
| 111 | )); |
| 112 | } |
| 113 | } |
| 114 | |
| 115 | create_archive( |
| 116 | &file_list, |
| 117 | codegen_results.metadata.raw_data(), |
| 118 | out_filename, |
| 119 | ); |
| 120 | } |
| 121 | |
| 122 | fn link_exe( |
| 123 | sess: &Session, |
no test coverage detected