Warn of custom rpath, fix mednafen rpath

This commit is contained in:
Wildan M 2026-09-03 01:54:35 +07:00
parent 6f01f60c5f
commit 6ce7869dda
No known key found for this signature in database
GPG Key ID: 01AC53185C679C79
2 changed files with 22 additions and 18 deletions

View File

@ -17,9 +17,9 @@ dependencies = [
]
script = """
DYNAMIC_INIT
export SDL_LIBS="-lSDL2 -lorbital $("${TARGET}-pkg-config" --libs osmesa) -lstdc++"
COOKBOOK_CONFIGURE_FLAGS+=(
--without-libflac
--disable-rpath
)
cookbook_configure
"""

View File

@ -87,23 +87,27 @@ fn auto_deps_from_dynamic_linking(
let object::build::elf::Dynamic::String { tag, val } = dynamic else {
continue;
};
if *tag == object::elf::DT_NEEDED {
let Ok(name) = str::from_utf8(val) else {
continue;
};
if let Ok(relative_path) = path.strip_prefix(rel_path)
&& verbose
{
log_to_pty!(logger, "DEBUG: {} needs {}", relative_path.display(), name);
let Ok(name) = str::from_utf8(val) else {
continue;
};
let path_rel = path
.strip_prefix(rel_path)
.ok()
.filter(|_| verbose)
.map(|s| s.display());
match *tag {
object::elf::DT_NEEDED => {
if let Some(path_rel) = path_rel {
log_to_pty!(logger, "DEBUG: {} needs {}", path_rel, name);
}
needed.insert(name.to_string());
}
needed.insert(name.to_string());
} else {
log_to_pty!(
logger,
"DEBUG: autopath failed {} is outside {}",
path.display(),
rel_path.display()
);
object::elf::DT_RPATH | object::elf::DT_RUNPATH => {
if let Some(path_rel) = path_rel {
log_to_pty!(logger, "DEBUG: {} uses runpath {}", path_rel, name);
}
}
_ => {} // DT_SONAME
}
}
}
@ -148,7 +152,7 @@ fn auto_deps_from_dynamic_linking(
if verbose {
for name in missing {
log_to_pty!(logger, "INFO: {} missing", name);
log_to_pty!(logger, "INFO: missing {}", name);
}
}