forked from lix-project/lix
Fix macOS build
This commit is contained in:
parent
55849e153e
commit
0eb22db311
|
@ -39,18 +39,12 @@ std::set<std::string> runResolver(const Path & filename)
|
||||||
throw SysError("statting '%s'", filename);
|
throw SysError("statting '%s'", filename);
|
||||||
|
|
||||||
if (!S_ISREG(st.st_mode)) {
|
if (!S_ISREG(st.st_mode)) {
|
||||||
logError({
|
printError("file '%s' is not a regular MACH binary", filename);
|
||||||
.name = "Regular MACH file",
|
|
||||||
.hint = hintfmt("file '%s' is not a regular file", filename)
|
|
||||||
});
|
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
if (st.st_size < sizeof(mach_header_64)) {
|
if (st.st_size < sizeof(mach_header_64)) {
|
||||||
logError({
|
printError("file '%s' is too short for a MACH binary", filename);
|
||||||
.name = "File too short",
|
|
||||||
.hint = hintfmt("file '%s' is too short for a MACH binary", filename)
|
|
||||||
});
|
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -72,19 +66,13 @@ std::set<std::string> runResolver(const Path & filename)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (mach64_offset == 0) {
|
if (mach64_offset == 0) {
|
||||||
logError({
|
printError("could not find any mach64 blobs in file '%1%', continuing...", filename);
|
||||||
.name = "No mach64 blobs",
|
|
||||||
.hint = hintfmt("Could not find any mach64 blobs in file '%1%', continuing...", filename)
|
|
||||||
});
|
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
} else if (magic == MH_MAGIC_64 || magic == MH_CIGAM_64) {
|
} else if (magic == MH_MAGIC_64 || magic == MH_CIGAM_64) {
|
||||||
mach64_offset = 0;
|
mach64_offset = 0;
|
||||||
} else {
|
} else {
|
||||||
logError({
|
printError("Object file has unknown magic number '%1%', skipping it...", magic);
|
||||||
.name = "Magic number",
|
|
||||||
.hint = hintfmt("Object file has unknown magic number '%1%', skipping it...", magic)
|
|
||||||
});
|
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue