Skip to content

sharun as the dynamic linker #104

@Samueru-sama

Description

@Samueru-sama

sometimes apps break becasue they read themselves, like examples:

Would be great if we had the option to set sharun as the dynamic linker, the logic would be like this:

  • lib4bin would run patchelf --set-interpreter /tmp/.sharun instead of making hardlinks.

  • The binary would be copied to ${SHARUN_DIR}/bin instead of ${SHARUN-DIR}/shared/bin

  • When sharun is the AppRun it would copy itself to /tmp/.sharun before jumping to exec the binaries.

  • Then when /tmp/.sharun is executed by the kernel, it would figure out where the dynamic linker is by checking SHARUN_DIR and do the rest of stuff it already does.


I don't think we need to make this random, since sharun already is a static binary we can pick a fixed name, then sharun would be responsible for just make sure that /tmp/.sharun is present.

It may also be possible to glue sharun into the binary itself, polyfill glibc does this already, but it is likely this will break some binaries though.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions