pub struct Provider {
pub release: Version,
pub sysroot: PathBuf,
pub stubs: PathBuf,
pub gcc_startup: PathBuf,
pub compiler_runtime: PathBuf,
pub descriptor: String,
}Expand description
A parsed provider descriptor. Its paths are absolute and have no ..
components; Provider::validate_files checks what they contain.
Fields§
§release: VersionThe glibc release (glibc field), one of RELEASES.
sysroot: PathBufThe release’s headers, startup objects, nonshared archives and loader
(sysroot field).
stubs: PathBufThe link stubs of SONAMES and their linker names (stubs field).
gcc_startup: PathBufThe GCC directory with crtbegin.o and crtend.o (gcc-startup field).
compiler_runtime: PathBufThe libgcc_s stub, libgcc_s.so and libgcc_s.so.1
(compiler-runtime field).
descriptor: StringThe descriptor text exactly as read.
Implementations§
Source§impl Provider
impl Provider
Sourcepub fn load(path: &Path) -> Result<Self, String>
pub fn load(path: &Path) -> Result<Self, String>
Reads and parses the descriptor at PATH (see Provider::parse).
§Errors
When the file cannot be read, or Provider::parse rejects it.
Sourcepub fn parse(text: &str) -> Result<Self, String>
pub fn parse(text: &str) -> Result<Self, String>
Parses a version-1 descriptor: the FORMAT line, then exactly the six
tab-separated fields target, glibc, sysroot, stubs, gcc-startup
and compiler-runtime, in any order. It checks only the text; see
Provider::validate_files for the files.
§Errors
When the text is over 16 KiB, has CR characters or no final newline, has
another format line, has an unknown, duplicate, empty or control-character
field, lacks a field, names a target other than x86_64-unknown-linux-gnu
or a glibc outside RELEASES, or has a path that is relative or contains
...
Static archives linked into every executable, relative to the sysroot. glibc 2.28 merged libpthread_nonshared.a into libc_nonshared.a.
Sourcepub fn validate_selection(&self, requested: Version) -> Result<(), String>
pub fn validate_selection(&self, requested: Version) -> Result<(), String>
Checks that the provider is for exactly the REQUESTED glibc release.
§Errors
When REQUESTED differs from Provider::release; there is no fallback to
another release.
Sourcepub fn validate_files(&self) -> Result<(), String>
pub fn validate_files(&self) -> Result<(), String>
Checks the provider’s files: each directory exists; the headers
(features.h), startup objects, loader and nonshared
archives are in the sysroot; crtbegin.o and
crtend.o are in Provider::gcc_startup; the libgcc_s stub is in
Provider::compiler_runtime; and every stub and linker name is in
Provider::stubs. Each must resolve, after following symbolic links, to a
regular file inside its directory, and each linker name to the same file as
its soname. It does not check file contents.
§Errors
When a directory or file is missing, resolves outside its directory, or a linker name resolves to another file than its soname.