fix: wire relibc ldso rpath support patch

This commit is contained in:
2026-05-07 07:50:45 +01:00
parent 853073f216
commit 8664e7ade1
2 changed files with 22 additions and 0 deletions
@@ -0,0 +1,20 @@
diff --git a/src/ld_so/dso.rs b/src/ld_so/dso.rs
index afb4c7c1..1aab77c7 100644
--- a/src/ld_so/dso.rs
+++ b/src/ld_so/dso.rs
@@ -722,7 +722,14 @@ impl DSO {
elf::DT_NEEDED => needed.push(entry),
elf::DT_JMPREL => jmprel = Some(ptr as usize),
- elf::DT_RUNPATH => runpath = Some(entry), // FIXME(andypython): rpath
+ elf::DT_RUNPATH => runpath = Some(entry),
+ elf::DT_RPATH => {
+ // DT_RPATH is the older form; DT_RUNPATH takes precedence.
+ // Only use RPATH if RUNPATH was not already set.
+ if runpath.is_none() {
+ runpath = Some(entry);
+ }
+ }
elf::DT_STRTAB => strtab_offset = Some(relative_idx),
elf::DT_STRSZ => strtab_size = Some(val),
elf::DT_SONAME => soname = Some(entry),
+2
View File
@@ -58,6 +58,8 @@ patches = [
# to prevent recursive include chain (stdint.h → sys/types.h → pthread.h)
# from seeing undefined size_t when gnulib wrappers are present
"P3-stddef-reorder.patch",
# ld.so: parse DT_RPATH in addition to DT_RUNPATH (RUNPATH takes precedence per gABI)
"P3-ldso-rpath-support.patch",
]
[build]