pub struct LoaderOptions { /* private fields */ }Expand description
Dynamic loader options.
Implementations§
Source§impl LoaderOptions
impl LoaderOptions
Sourcepub fn glibc<P: Into<PathBuf>>(rootfs_dir: P) -> Result<Self, Error>
Available on crate feature glibc only.
pub fn glibc<P: Into<PathBuf>>(rootfs_dir: P) -> Result<Self, Error>
glibc only.Glibc-specific options.
Sourcepub fn musl<P: Into<PathBuf>>(rootfs_dir: P, arch: &str) -> Result<Self, Error>
Available on crate feature musl only.
pub fn musl<P: Into<PathBuf>>(rootfs_dir: P, arch: &str) -> Result<Self, Error>
musl only.Musl-specific options.
Sourcepub fn root<P: Into<PathBuf>>(self, root: P) -> Self
pub fn root<P: Into<PathBuf>>(self, root: P) -> Self
File system root.
Affects the interpreter path, but doesn’t affect library search directories.
Sourcepub fn search_dirs(self, search_dirs: Vec<PathBuf>) -> Self
pub fn search_dirs(self, search_dirs: Vec<PathBuf>) -> Self
Directories where to look for libraries after searching in the RUNPATH or in the
RPATH.
Use the following functions to initialize this field.
- Glibc:
glibc::get_search_dirs. - Musl:
musl::get_search_dirs.
Sourcepub fn search_dirs_override(self, search_dirs: Vec<PathBuf>) -> Self
pub fn search_dirs_override(self, search_dirs: Vec<PathBuf>) -> Self
Directories where to look for libraries before searching in the RUNPATH.
This list doesn’t affect RPATH-based lookup.
Use get_search_dirs_from_env to initialize this field.
Sourcepub fn page_size(self, page_size: u64) -> Self
pub fn page_size(self, page_size: u64) -> Self
Set page size.
Panics if the size is not a power of two.
Sourcepub fn lib(self, lib: Option<OsString>) -> Self
pub fn lib(self, lib: Option<OsString>) -> Self
Set library directory name.
This value is used to substitute $LIB variable in RPATH and RUNPATH.
When not set lib is used for 32-bit arhitectures and lib64 is used for 64-bit
architectures.
Sourcepub fn platform(self, platform: Option<OsString>) -> Self
pub fn platform(self, platform: Option<OsString>) -> Self
Set platform directory name.
This value is used to substitute $PLATFORM variable in RPATH and RUNPATH.
When not set the platform is interpolated based on Machine
(best-effort).
Sourcepub fn new_loader(self) -> DynamicLoader
pub fn new_loader(self) -> DynamicLoader
Create new dynamic loader using the current options.