Skip to content

Investigate rtldi and PatchELF for AppImages that bundle "everything" #84

Open

Description

@probonopd

Although not generally recommended, there might be some edge cases in which it might be desirable to bundle all dependencies, not just the ones that cannot be expected to be part of the base system(s).

For these cases, we should investigate to use
http://bitwagon.com/rtldi/rtldi.html
although it can be done in some cases without it, too.

Also see
http://joeyh.name/blog/entry/completely_linux_distribution-independent_packaging/
for an example.

Activity

  1. probonopd commented on Sep 4, 2016

    @probonopd
    MemberAuthor
  2. changed the title [-]Investigate rtldi for AppImages that bundle "everything"[/-] [+]Investigate rtldi and PatchELF for AppImages that bundle "everything"[/+] on Sep 4, 2016
  3. probonopd commented on Oct 30, 2016

    @probonopd
    MemberAuthor

    We need to prevent the loader from loading stuff outside of the bundle.

    The loader has hardcoded instructions to load libraries from /lib!

    when I patch /lib to ./li, then

    Inconsistency detected by ld.so: dl-load.c: 719: _dl_init_paths: Assertion `pelem->dirname[0] == '/'' failed!

    Hence we patch these paths to other (empty) absolute paths

    sed -i -e 's|/lib|/xib|g' lib/x86_64-linux-gnu/ld-linux-x86-64.so.2
    sed -i -e 's|/etc|/xtc|g' lib/x86_64-linux-gnu/ld-linux-x86-64.so.2
    

    Now it no longer loads something from somewhere. I can now actually run a bleeding-edge VLC on a much older base system like this:

    QT_PLUGIN_PATH=./lib/x86_64-linux-gnu/qt5/plugins/ ../lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 --library-path '../lib/x86_64-linux-gnu/:./lib/x86_64-linux-gnu/:./lib/'  ./bin/vlc
    
  4. probonopd commented on Dec 1, 2016

    @probonopd
    MemberAuthor

    Some experimentation in this regard, using the glibc deb package from, e.g., debian sid:

    # This does not work
    [me@host ~]$  LD_LIBRARY_PATH=/mnt/usr/lib64/ /mnt/usr/bin/gnome-font-viewer /mnt/usr/bin/gnome-font-viewer: relocation error: /mnt/usr/lib64/libc.so.6: symbol _dl_find_dso_for_object, version GLIBC_PRIVATE not defined in file ld-linux-x86-64.so.2 with link time reference
    
    # This doesn't cut it
    [me@host ~]$ LD_LIBRARY_PATH=/mnt/usr/lib64/ '/home/me/Downloads/libc6_2.21-3_amd64/lib/x86_64-linux-gnu/ld-2.21.so' /mnt/usr/bin/gnome-font-viewer /mnt/usr/bin/gnome-font-viewer: relocation error: /mnt/usr/lib64/libc.so.6: symbol _dl_starting_up, version GLIBC_PRIVATE not defined in file ld-linux-x86-64.so.2 with link time reference
    
    # This doesn't cut it either
    [me@host ~]$ LD_LIBRARY_PATH='/home/me/Downloads/libc6_2.21-3_amd64/lib/x86_64-linux-gnu':/mnt/usr/lib64/  /mnt/usr/bin/gnome-font-viewer 
    /mnt/usr/bin/gnome-font-viewer: relocation error: /home/me/Downloads/libc6_2.21-3_amd64/lib/x86_64-linux-gnu/libc.so.6: symbol _dl_find_dso_for_object, version GLIBC_PRIVATE not defined in file ld-linux-x86-64.so.2 with link time reference
    
    # This works!!! 
    # On CentOS 7 I can run gnome-font-viewer from Fedora 23
    [me@host ~]$ LD_LIBRARY_PATH='/home/me/Downloads/libc6_2.21-3_amd64/lib/x86_64-linux-gnu':/mnt/usr/lib64/ '/home/me/Downloads/libc6_2.21-3_amd64/lib/x86_64-linux-gnu/ld-2.21.so' /mnt/usr/bin/gnome-font-viewer 
    
  5. probonopd commented on Feb 7, 2017

    @probonopd
    MemberAuthor

    https://github.com/matthewbauer/nix-bundle/ creates AppImages that bundle everything, down to ld-linux.so - but are broken in other ways nix-community/nix-bundle#8

  6. probonopd commented on Jul 23, 2017

    @probonopd
    MemberAuthor
  7. probonopd commented on Feb 2, 2018

    @probonopd
    MemberAuthor
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions