pub enum Unsupported {
Format {
target: String,
format: &'static str,
},
MsvcAbi {
target: String,
},
Machine {
target: String,
},
StaticStub {
target: String,
},
}Expand description
A target, or a combination of a target and a mode, that has no line here.
Four variants and they are different kinds of answer. A format is not supported yet and will be. The MSVC ABI is waiting on something that is not code. A static glibc link is not a thing this scheme can produce at all. The distinction matters to somebody reading the message, because only some of them are worth waiting for.
Variants§
Format
The target’s object format is neither ELF nor PE, and the linker for it wants a different line rather than a different spelling of this one.
Fields
MsvcAbi
A Windows target in Microsoft’s ABI rather than mingw-w64’s.
Refused for two reasons and the second one is the one that matters. lld-link takes a
different command line rather than a different set of flags: /MACHINE:, /SUBSYSTEM:,
/DEFAULTLIB: and a response file, which is its own work. And the import libraries a program
in that ABI links against come from the Windows SDK and the universal CRT, which
spec/cross-compile/08-sysroots.md section 8.6 says cannot be redistributed, so there is
nothing to produce on this side and a user has to point at an installed one themselves.
Machine
A PE target whose architecture has no machine type among the ones a PE linker writes.
Unreachable through the target table, which has three mingw-w64 rows and an ARM64EC one that the MSVC ABI refuses first. It is a variant rather than a panic because the table is data and a row added to it should produce a sentence rather than a crash.
StaticStub
A static link against a libc that is a stub.
spec/cross-compile/09-libc-stubs.md section 9.1 is the reason: a stub carries the names a
library exports and none of the code behind them, which is everything a dynamic link needs
and nothing a static one does. glibc’s own libc.a is several megabytes of objects that
cannot be synthesized from a description of an interface, so this combination is refused
here rather than failing later with several thousand undefined symbols.
Every crate::link::Libc::Stub target, which is glibc and also bionic, the BSDs and
illumos. musl is the exception rather than the rule here, because musl is the one whose libc
we build from source.
Trait Implementations§
Source§impl Clone for Unsupported
impl Clone for Unsupported
Source§fn clone(&self) -> Unsupported
fn clone(&self) -> Unsupported
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Unsupported
impl Debug for Unsupported
Source§impl Display for Unsupported
impl Display for Unsupported
impl Eq for Unsupported
Source§impl Error for Unsupported
impl Error for Unsupported
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()