Skip to content

Commit e841eb9

Browse files
committed
Add support for windows linker args
1 parent f1021ef commit e841eb9

13 files changed

Lines changed: 4335 additions & 2209 deletions

File tree

Cargo.lock

Lines changed: 8 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ jobserver = "0.1.30"
5858
leb128 = "0.2.5"
5959
libc = "0.2.171"
6060
libloading = "0.9.0"
61+
target-lexicon = "0.13.5"
6162
memchr = "2.6.0"
6263
memmap2 = "0.9.0"
6364
mimalloc = { version = "0.1", default-features = false }

libwild/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ libloading = { workspace = true, optional = true }
3535
linker-layout = { path = "../linker-layout", version = "0.8.0" }
3636
linker-trace = { path = "../linker-trace", version = "0.8.0" }
3737
linker-utils = { path = "../linker-utils", version = "0.8.0" }
38+
target-lexicon = { workspace = true }
3839
memchr = { workspace = true }
3940
memmap2 = { workspace = true }
4041
object = { workspace = true }

libwild/src/arch.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,20 @@ pub(crate) enum Architecture {
1414
LoongArch64,
1515
}
1616

17+
impl Architecture {
18+
/// Convert a `target_lexicon::Architecture` to an `Architecture`.
19+
/// Panics if the architecture is not supported.
20+
pub const fn from_target_lexicon(arch: target_lexicon::Architecture) -> Self {
21+
match arch {
22+
target_lexicon::Architecture::X86_64 => Self::X86_64,
23+
target_lexicon::Architecture::Aarch64(_) => Self::AArch64,
24+
target_lexicon::Architecture::Riscv64(_) => Self::RISCV64,
25+
target_lexicon::Architecture::LoongArch64 => Self::LoongArch64,
26+
_ => panic!("Unsupported architecture"),
27+
}
28+
}
29+
}
30+
1731
impl TryFrom<u16> for Architecture {
1832
type Error = crate::error::Error;
1933

0 commit comments

Comments
 (0)