Skip to content

Remove patchelf from stdenv #362353

Open
Open

Description

@Mic92

When I was on a retreat with Guix people, I learned they are actually not using patchelf in their standard builder, because their linker wrapper is smart enough to construct the rpath during linking correctly in the first place. We should do the same as it will greatly help with patchelf maintenance. Moving patchelf out of stdenv means, that regression testing will become a lot easier because of scope reduction.
We could also potentially rewrite patchelf in a memory-safe language that is easier to work with.
Currently patchelf does a lot of scary pointer arithmetic.

Activity

  1. added
    0.kind: bug
    on Dec 6, 2024
  2. Patryk27 commented on Dec 6, 2024

    @Patryk27
    Member

    We could also potentially rewrite patchelf in a memory-safe language that is easier to work with.

    There are also projects which implement logic similar to patchelf's, e.g. I know of https://github.com/lief-project/LIEF (it's able to do the section extension, reshuffling etc. things) - might be worth to try using them.

  3. added
    2.status: stale
    on Jul 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    0.kind: bug2.status: stale6.topic: stdenv

    Projects

    • Status
      No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions