Skip to content

test(e2e): a link and a pack under a caller's XLINGS_SUBOS_LD_PATHS keep the run path mcpp derived - #1033

Open
speak-agent wants to merge 1 commit into
mainfrom
eco/c1-ld-wrapper
Open

speak-agent wants to merge 1 commit into
mainfrom
eco/c1-ld-wrapper

Conversation

@speak-agent

Copy link
Copy Markdown
Member

Task C1 of the xlings ecosystem plan (openxlings/xlings .agents/docs/2026-11-27-ecosystem-truthful-results-and-architecture-design.md §8.3). Paired with openxlings/xlings#742 and openxlings/xim-pkgindex#1477.

xlings' ld wrapper (binutils r1, xim-pkgindex P6) appends -rpath "$XLINGS_SUBOS_LIB" when it links against a loader other than the system one, unless XLINGS_SUBOS_LD_PATHS=0. mcpp already sets that 0 for everything it starts (src/cli.cppm). This PR adds the e2e cases that hold mcpp to it. A caller sets XLINGS_SUBOS_LD_PATHS=1 and a XLINGS_SUBOS_LIB of its own, and the cases check two things:

  • Link. The programs the link starts read XLINGS_SUBOS_LD_PATHS=0. These are collect2 (observed through gcc's -wrapper) and a build program. The artifact's run path equals the link line's -Wl,-rpath entries and does not include the caller's directory.
  • Pack. Every ELF object a pack bundles names only $ORIGIN directories.

No code changes: no spawn dropped the declaration. Without the declaration, the first case fails on both observations.

…eep the run path mcpp derived

xlings' ld wrapper appends -rpath "$XLINGS_SUBOS_LIB" to a link of a non-system
loader unless XLINGS_SUBOS_LD_PATHS=0, which mcpp declares for everything it
starts. Two cases state what that holds from mcpp's side, with the caller's
XLINGS_SUBOS_LD_PATHS=1 and a XLINGS_SUBOS_LIB of its own:

- the programs the link starts (observed through gcc's -wrapper, which sees
  collect2, the linker's parent) and a build program read
  XLINGS_SUBOS_LD_PATHS=0, and the artifact's run path equals the
  -Wl,-rpath entries of the link line, without the caller's directory;
- every ELF object a pack bundles names only $ORIGIN directories.

The declaration is the one cli.cppm makes for the invocation; no spawn
dropped it, so no code changes. Without the declaration the first case fails
on both observations.

Co-authored-by: speak-agent <248744407+speak-agent@users.noreply.github.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants