probonopd / go-appimage

Go implementation of AppImage tools
MIT License
818 stars 71 forks source link

Consider using sharun or userland-execve #312

Open probonopd opened 1 week ago

probonopd commented 1 week ago

Thanks @Samueru-sama for finding this.

sharun is just a binary that you symlink to inside the AppDir and based on the name of the symlink it will find the ld-*.so and call the binary in ./shared/bin while passing every single directory that contains libraries to --library-path when calling the ld-*.so. This means that when *hardlinks get used /proc/self/exe is the name of the binary instead of `ld-.so**, and since every single directory with libraries gets passed down with the--library-path` flag there is no need to use patchelf to set rpaths.

Similar:

Example AppImages:

https://github.com/AppImage/AppImageSpec/issues/36#issuecomment-2479951756

probonopd commented 1 week ago

Next step: See whether we can use it in https://github.com/probonopd/alpine2appimage

probonopd commented 3 days ago

https://zapps.app/technology/ "jumploader" seems to be doing a similar thing.

https://github.com/janispeyer/tinyshim is an implementation in assembly.