News for hackers. Stuff that matters.
Re:Self-contained Linux applications with lone Lisp by electroly on Tuesday January 23, 2024 @02:58AM (#39100678)
It's a possibility. It's not unreasonable for me to ship builds of objcopy and lld that I can run at embed time. An immediate difficulty is that I support Windows and macOS, so I need a solution for PE and Mach-O executables too. I think a solution probably exists but I may need a separate solution for each platform. Embedding resources into binaries is pretty easy, it's just a matter of how to do it without shipping an entire C toolchain to users of my language.
Re:Self-contained Linux applications with lone Lisp by regularfry on Tuesday January 23, 2024 @05:38AM (#39101708)
I suspect the easier thing to do today is actually just embed tcc, and use its linker. Generating a C source file that embeds whatever binary you want in a string literal is straightforward templating. I couldn't really do that at the time.
Re:Self-contained Linux applications with lone Lisp by electroly on Tuesday January 23, 2024 @10:23AM (#39104576)
That's a great idea. I'll have to check and see if some fork of tcc today supports all my target platforms, but I bet it does.
Re:Self-contained Linux applications with lone Lisp by zokier on Tuesday January 23, 2024 @09:48AM (#39104002)
would using libbfd or llvms objcopy library be of use here? https://llvm.org/doxygen/namespacellvm_1_1objcopy.html
Re:Self-contained Linux applications with lone Lisp by saagarjha on Friday January 26, 2024 @03:33AM (#39140148)
The linker that ships on macOS supports embedding data from a file with -sectcreate.