pkg2appimage
pkg2appimage copied to clipboard
Investigate rtldi and PatchELF for AppImages that bundle "everything"
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.
Also, check patchelf --set-interpreter
. http://nixos.org/patchelf.html
May be even more elegant.
http://www.trigger.im/fix-spotify-incompatible-libc-after-update-on-debian-gnulinux/
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
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
https://github.com/matthewbauer/nix-bundle/ creates AppImages that bundle everything, down to ld-linux.so
- but are broken in other ways https://github.com/matthewbauer/nix-bundle/issues/8
Also check https://github.com/lvml/makeaoi, a tool that bundles "everything"
Another option that automates this:
https://github.com/Intoli/exodus#how-it-works
Hi, Please see my comment at:
https://github.com/probonopd/go-appimage/issues/49