Striping executable, seems unsuported. #298
|
Hello, I built mahogany as a package for my distro and I did stripping by default. The stripped executable seems unusable than the unstripped. Is it common for lisp-based executable to behave like that ? Thanks. |
Replies: 1 comment
|
Hi! I'm not surprised, especially if you used SBCL to compile it. Most Common Lisp compilers act more like a programming environment than traditional compilers whose sole task is to use text files to produce a binary executable. In CL, there exists the concept of the environment, which is the state of the compiler at any given time. To make a CL application, you essentially modify and augment that environment until it contains all of the functionality that you need. Executables produced by CL implementations contain the information needed to replicate that environment plus which function defined in that environment needs to be executed on startup. Most CL implementations accomplish this by being image based. There are some really good explanations for how that works in that link, but it usually means an executable is just a dump of the compiler's RAM plus some machine code to load it and handle events from the OS. Stripping symbols from the executable file probably removes vital information that allows the compiler's state to be re-initialized. This isn't to say that all CL implementations need to work this way. Embeddable Common Lisp (ECL) transpiles CL code to C to produce a more traditional executable. There are also ways to reduce the size of executables by stripping unneeded compiler information, but that can't be done using external programs. IHMO, this image-based execution is probably one of the reasons why CL never really caught on. There's actually no standardized way of producing an executable file from common lisp code, as the language is designed with the assumption that users will be interacting with a text based REPL using a lisp machine, where the Common Lisp environment is the primary environment available to the user. |
Hi! I'm not surprised, especially if you used SBCL to compile it. Most Common Lisp compilers act more like a programming environment than traditional compilers whose sole task is to use text files to produce a binary executable. In CL, there exists the concept of the environment, which is the state of the compiler at any given time. To make a CL application, you essentially modify and augment that environment until it contains all of the functionality that you need. Executables produced by CL implementations contain the information needed to replicate that environment plus which function defined in that environment needs to be executed on startup.
Most CL implementations accomplish this b…