← Back to issue list

elf: patch elf files for classic mode

View original Github issue

Metadata

Project
snapcraft
Number
#3985
Type
pull request
State
merged
Author
cmatsuoka
Labels
—
Created
Updated
Closed

Current evaluation

Merged PR #3985 as commit a723254b9, adding classic-mode ELF patching so enable-patchelf parts use base-snap libraries or staged libc components.

Resolution: closed resolved

Reason: The pull request was merged into main as commit a723254b9. The change patches ELF interpreters and library paths for enable-patchelf parts in classic mode.

Evaluated by: mr-cal-bot

No scores available.

Issue body

If `enable-patchelf` is listed in the part's build attributes, patch the part's ELF binaries to use the interpreter and libraries from the base snap (or use bundled components if libc is staged). Signed-off-by: Claudio Matsuoka <claudio.matsuoka@canonical.com> - [x] Have you followed the [guidelines for contributing](https://github.com/snapcore/snapcraft/blob/master/CONTRIBUTING.md)? - [x] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)? - [x] Have you successfully run `make lint`? - [ ] Have you successfully run `pytest tests/unit`? ----- CRAFT-1460

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Merged PR #3985 as commit a723254b9, adding classic-mode ELF patching so enable-patchelf parts use base-snap libraries or staged libc components.
stealth/space-bunny-alpha — closed resolved Merged #3985 as a723254b9, adding classic-mode ELF patching so enable-patchelf parts use the base snap interpreter/libraries or bundled components when libc is staged.
qwen/qwen3.6-35b-a3b — — Merged into main. Patches ELF binaries for classic mode to use the base snap interpreter and libraries, or bundled components if libc is staged, when enable-patchelf is enabled. Approved, passed CI, and merged.
qwen3.6-35b-a3b-mtp-q6 — — Merged into main. Patches ELF binaries to use the base snap interpreter and libraries when enable-patchelf is enabled in build attributes, enabling classic mode support.

Update history

No update history recorded yet.

Related work

  • Related To: snapcraft#3841 (confidence 90%)

    Earlier ELF patcher work supplied the implementation extended by #3985.

Related issues

Issue Project State Summary Similarity
#1935 elf: contemplate more patching scenarios snapcraft merged Merged PR #1935 as 048adc4a3, adding ELF patching for classic snaps built on bionic targeting core16 and for hooks built with Snapcraft.
80%
#3841 elf: add elf file patcher snapcraft merged Merged PR #3841 in commit e03a971b3, adding a patchelf-based ELF file patcher ported from Snapcraft 6.x for CRAFT-1191.
80%
#2081 elf: patch everything instead of a subset of elf files snapcraft merged Merged PR #2081 restored Snapcraft 2.39 behavior by patching every ELF file; commit 77770452b partially reverted 64f78f762a05.
78%
#1666 Refactor to support elf patching snapcraft closed ELF patching support was refactored by merged PR #1744 in commit ec7ba948a, converting the ELF implementation into reusable libraries.
77%
#1781 many: set rpath for elf files for classic snapcraft merged Merged as commit 3eafb9dd6, adding patchelf-based $ORIGIN-relative rpaths for ELF files in classic snaps and avoiding LD_LIBRARY_PATH side effects.
74%
#1747097 patch fewer elf files snapcraft (launchpad) open Classic ELF patching still iterates every discovered file; DT_NEEDED/DT_SONAME filtering from PR #1959 was merged and then reverted, leaving the optimization open pending safer dlopen handling.
74%
#3589 snap: correct patch apply for patchelf snapcraft merged Merged PR #3589 fixed PatchELF patch application in the snap build via commit d9484faf9 (merge a636d26b5).
74%
#1888 elf: make patchelf a dependency snapcraft merged Merged PR #1888 via commit 7c947f5ec, moving Patchelf out of project_loader build tools and into the deb and snap delivery mechanisms.
74%
#1794 Apply patchelf work to non classic snapcraft closed Patchelf support was extended from classic confinement to strict snaps by merged PR #3277 (commit fd8e95c3d), resolving #1794.
74%
#1669 patchelf with ld-linux from the future snapcraft closed Resolved by commit bdaf0b7f1, which added Snapcraft handling for PatchELF and ELF files when the built glibc/linker does not match the base.
73%