mirror of
https://github.com/ziglang/zig.git
synced 2026-02-21 00:35:10 +00:00
use an explicit error set to fix a compilation error
this function has conditionally compiled out code in it about looking for native glibc.
This commit is contained in:
parent
6fcf6716be
commit
2246812184
@ -481,13 +481,30 @@ pub const NativeTargetInfo = struct {
|
||||
};
|
||||
}
|
||||
|
||||
pub const AbiAndDynamicLinkerFromFileError = error{
|
||||
FileSystem,
|
||||
SystemResources,
|
||||
SymLinkLoop,
|
||||
ProcessFdQuotaExceeded,
|
||||
SystemFdQuotaExceeded,
|
||||
UnableToReadElfFile,
|
||||
InvalidElfClass,
|
||||
InvalidElfVersion,
|
||||
InvalidElfEndian,
|
||||
InvalidElfFile,
|
||||
InvalidElfMagic,
|
||||
Unexpected,
|
||||
UnexpectedEndOfFile,
|
||||
NameTooLong,
|
||||
};
|
||||
|
||||
pub fn abiAndDynamicLinkerFromFile(
|
||||
file: fs.File,
|
||||
cpu: Target.Cpu,
|
||||
os: Target.Os,
|
||||
ld_info_list: []const LdInfo,
|
||||
cross_target: CrossTarget,
|
||||
) !NativeTargetInfo {
|
||||
) AbiAndDynamicLinkerFromFileError!NativeTargetInfo {
|
||||
var hdr_buf: [@sizeOf(elf.Elf64_Ehdr)]u8 align(@alignOf(elf.Elf64_Ehdr)) = undefined;
|
||||
_ = try preadFull(file, &hdr_buf, 0, hdr_buf.len);
|
||||
const hdr32 = @ptrCast(*elf.Elf32_Ehdr, &hdr_buf);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user