5 ms·
I would be surprised if there was not a way to take a dynamic executable, "add in" all the required libraries, and return a fat static executable
by 1996 6y ago
I would be surprised if there was not a way to take a dynamic executable, "add in" all the required libraries, and return a fat static executable
- AnIdiotOnTheNet 6y agoIf you know of such a utility I'd like to see it, because I've looked and never found it. The closest I've seen are things like AppImage.
- 1996 6y agoShell scripting and ld tools should allow you to make that yourself. EDIT: people are apparently entitled to solutions for their problems... > Care to elaborate? > Show us a script then! Your internet fame awaits. I'm not interested in fame, or in reinventing the wheel. Apparently, you are unfamiliar with this process, so TLDR: there are basically 2 approaches, in order of complexity: 1. working with ldtools or 2. running the executable to find the various parts then dumping a binary, (3 if you consider putting the libraries in a directory then run with LD_LIBRARY_PATH=/thisdir myexecutable) Let me google some existing tools for you: https://github.com/systems-nuts/dynamic_to_static https://github.com/systems-nuts/dynamic_to_static http://bitwagon.com/jumpstart/jumpstart.html http://bitwagon.com/jumpstart/jumpstart.html http://statifier.sourceforge.net/ http://statifier.sourceforge.net/ https://www.ucc.asn.au/~dagobah/things/make-static.html https://www.ucc.asn.au/~dagobah/things/make-static.html https://web.archive.org/web/20130114222319if_/http://dagobah.ucc.asn.au/wacky/cryopid-0.5.9.1-x86_64.tar.gz https://web.archive.org/web/20130114222319if_/http://dagobah... with patch and explanation on https://stackoverflow.com/questions/17390722/how-can-i-convert-dynamically-linked-application-to-statically-one https://stackoverflow.com/questions/17390722/how-can-i-conve... A better approach from 15 years ago is slinky, so that you can "update" the libraries if needed: https://www.usenix.org/legacy/publications/library/proceedings/usenix05/tech/general/full_papers/collberg/collberg_html/main.html https://www.usenix.org/legacy/publications/library/proceedin... There's nothing fancy in there. It just requires some effort.
- AnIdiotOnTheNet 6y agoCare to elaborate? Because I'm not aware of any tool that could be used to combine a binary and all its .so dependencies (and all of theirs recursively) into a single statically-linked binary.
- dTal 6y agoShow us a script then! Your internet fame awaits.
- throwaway894345 6y agoIt exists. I came across at least one such project last year, but I don't recall the name. :(
- efrecon 6y agoI have used exodus to do this in the past. https://github.com/intoli/exodus https://github.com/intoli/exodus
- AnIdiotOnTheNet 6y ago> Exodus handles bundling all of the binary's dependencies, compiling a statically linked wrapper for the executable that invokes the relocated linker directly, and installing the bundle in ~/.exodus/ on the remote machine. You can see it in action here. That isn't really what is being described, or at least not what I'm referring to. It's more like a self-extractor.
- efrecon 6y agoYou are right. My mistake. I remembered it wrong.
- girvo 6y agoMy admittedly poor understand of macOS application bundles, is that is basically how they work (modulo certain Frameworks in Library folders)