eb-local.elfcheck¶
- module eb-local.elfcheck src/elfcheck.zig[source][autodoc]¶
eb-local check: what a program built by hand on EESSI depends on, and whether it can run here. It reads the ELF file’s loader (PT_INTERP), run paths (DT_RPATH, DT_RUNPATH) and needed libraries (DT_NEEDED), finds each library as the loader would, and reports what breaks the “no LD_LIBRARY_PATH, one CPU target” rule: a foreign architecture, the host’s loader or libraries under an EESSI stack, RUNPATH, a library not found, and run paths into another CPU target’s software tree.
Types¶
Error sets¶
- pub const ParseError = error{ NotElf64, Unsupported, Truncated, Damaged } || sys.Error || Allocator.Error[source][autodoc]¶
Why
parseread nothing:NotElf64for a file too short for an ELF header or without the ELF magic,Unsupportedfor a 32-bit or big-endian one,Truncatedwhen the file ends before a part its headers name, andDamagedfor a header field out of bounds, a string with no end, or a read that fails.
Functions¶
- pub fn parse(a: Allocator, fd: sys.fd_t) ParseError!Elf[source][autodoc]¶
The dynamic-linking facts of the 64-bit little-endian ELF file open as
fd; every string is copied intoa.
- pub fn machineName(m: u16) []const u8[source][autodoc]¶
The name
checkprints for the ELF machinem:x86_64,aarch64,riscv64,i386,arm, or “another architecture”.
- pub fn loaderRoot(interp: []const u8) []const u8[source][autodoc]¶
The loader’s root directory from
PT_INTERP(dirname(dirname(interp))), or"/"when the interpreter path has fewer than two parent directories.
- pub fn expandOrigin(a: Allocator, dir: []const u8, origin: []const u8) Allocator.Error![]const u8[source][autodoc]¶
dirwith $ORIGIN and ${ORIGIN} replaced byorigin.
- pub fn targetOf(path: []const u8) ?[]const u8[source][autodoc]¶
The CPU target of an EESSI software tree a path lies in: the parts after
/software/linux/up to the nextsoftware,modulesoraccel, as EESSI and EESSI-extend lay out their trees; null outside one.