Skip to content

ipk-verify: discover libraries via bundled libraries' own RUNPATH#3

Merged
mariotaku merged 1 commit into
mainfrom
claude/libegl-symbol-false-positive-frf6ep
Jun 26, 2026
Merged

ipk-verify: discover libraries via bundled libraries' own RUNPATH#3
mariotaku merged 1 commit into
mainfrom
claude/libegl-symbol-false-positive-frf6ep

Conversation

@mariotaku

Copy link
Copy Markdown
Member

Problem

A dependency that is bundled in a subdirectory — located at runtime through a library's own $ORIGIN-relative RUNPATH — was reported as a missing library with all its symbols undefined, even though the dynamic loader resolves it fine.

On apps-repo PR #190 this is the remaining libpulse red after the global-scope fix (#1):

required lib libpulse.so.0          :x:   * Library libpulsecommon-15.0.so is missing
                                          * Symbol pa_atou is undefined ... (187 pa_* symbols)
required lib libpulse-simple.so.0   :x:

But everything it needs is in the IPK:

lib/libpulse.so.0                       (DT_RUNPATH = $ORIGIN/pulseaudio)
lib/pulseaudio/libpulsecommon-15.0.so   (defines all 187 pa_* symbols)

libpulse.so.0 sits in lib/, its RUNPATH=$ORIGIN/pulseaudio points at lib/pulseaudio/, and the loader finds libpulsecommon-15.0.so there. So it works at runtime — the report is a false positive.

Root cause

  1. LibraryInfo::parse read DT_NEEDED/DT_SONAME but not DT_RUNPATH/DT_RPATH.
  2. Component::list_libs only scanned the executable's rpath dirs plus the top-level lib/ dir — it never recursed into subdirectories a bundled library locates through its own runpath.

So libpulsecommon-15.0.so was never collected → "missing library" + undefined pa_*.

Fix

  • Capture DT_RUNPATH/DT_RPATH into a new LibraryInfo.rpath field (non-serialized; firmware data format unchanged).
  • Turn list_libs into a breadth-first directory walk: starting from the executable's rpath dirs and lib/, it follows each bundled library's own $ORIGIN-relative runpath to discover further bundled directories (reusing the existing $ORIGIN resolution + safety filter).

Verification

Rebuilt webosbrew-ipk-verify against the real org.webosbrew.bridge-64to32 IPK — every row is now :ok: across all 13 firmwares, including the newly-discovered lib libpulsecommon-15.0.so, with zero remaining missing-library / undefined-symbol details:

Row Before #1 After #1 After this PR
libEGL.so.1
libpulse.so.0 / libpulse-simple.so.0
libpulsecommon-15.0.so (subdir) — (missing) — (missing) ✅ discovered

Tests: adds library::tests::test_parse_runpath (fixture-based DT_RUNPATH capture) and keeps the existing global-scope regression tests green.

Bumps bin-lib 0.1.1 → 0.1.2, ipk-lib 0.1.3 → 0.1.4, ipk-verify 0.1.5 → 0.1.6.

🤖 Generated with Claude Code


Generated by Claude Code

list_libs only scanned the executable's rpath dirs and the top-level
lib/ dir, and LibraryInfo::parse never read DT_RUNPATH/DT_RPATH. So a
dependency bundled in a subdirectory that a library locates through its
own $ORIGIN-relative runpath was reported as a missing library with all
its symbols undefined — even though the loader resolves it fine.

This is the libpulse case in apps-repo PR #190: libpulse.so.0 (in lib/)
has RUNPATH $ORIGIN/pulseaudio and its pa_* symbols are provided by the
bundled lib/pulseaudio/libpulsecommon-15.0.so, which the flat scan never
collected.

Capture DT_RUNPATH/DT_RPATH in LibraryInfo, and turn list_libs into a
breadth-first walk that follows each bundled library's own runpath
($ORIGIN-relative) to discover further bundled directories. Adds a
fixture-based parse test plus the regression coverage.

Bumps bin-lib 0.1.1 -> 0.1.2, ipk-lib 0.1.3 -> 0.1.4,
ipk-verify 0.1.5 -> 0.1.6.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011jY7WzoWeU9TWRBhWJ2Wbq
@mariotaku mariotaku merged commit fb32b1a into main Jun 26, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant