Simplify implementation of -Z gcc-ld

- The logic is now unified for all targets (wasm targets should also be supported now)
- Additional "symlink" files like `ld64` are eliminated
- lld-wrapper is used for propagating the correct lld flavor
- Cleanup "unwrap or exit" logic in lld-wrapper
This commit is contained in:
Vadim Petrochenkov
2022-05-24 23:29:15 +03:00
parent 1b5e1215ef
commit 2984bf674f
8 changed files with 71 additions and 122 deletions

View File

@@ -105,12 +105,7 @@ impl Command {
}
Program::Lld(ref p, flavor) => {
let mut c = process::Command::new(p);
c.arg("-flavor").arg(match flavor {
LldFlavor::Wasm => "wasm",
LldFlavor::Ld => "gnu",
LldFlavor::Link => "link",
LldFlavor::Ld64 => "darwin",
});
c.arg("-flavor").arg(flavor.as_str());
if let LldFlavor::Wasm = flavor {
// LLVM expects host-specific formatting for @file
// arguments, but we always generate posix formatted files