Fix the wrong removal of first linker arg in Windows. Linker argument file no longer include first program name argument. Small refactor of handling of linker response file. (#5010)

Co-authored-by: Evan Almloff <evanalmloff@gmail.com>
This commit is contained in:
qouteallandEvan Almloff authored and GitHub committed 2025-12-15 10:14:22 -06:00
1 parent 5929c09cec
commit da72b63b6f
3 files changed
+28 -12

No files matched your search

+1 -1
View File
@@ -2194,7 +2194,7 @@ impl BuildRequest {
// And then remove the rest of the rlibs
//
// We also need to insert the -force_load flag to force the linker to load the archive
let mut args: Vec<_> = rustc_args.link_args.iter().skip(1).cloned().collect();
let mut args: Vec<_> = rustc_args.link_args.clone();
if let Some(last_object) = args.iter().rposition(|arg| arg.ends_with(".o")) {
if archive_has_contents {
match self.linker_flavor() {