forked from vnmakarov/mir
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for "soft link interface", useful for binfmt_misc
In order to be able to execute `.bmir` files directly from the command line, a "soft link interface" was added (similar to busybox), where the links `c2m-ei`, `c2m-eg` and `c2m-el` are created, pointing to `c2m`. These links, to correspond with the binfmt nomenclature, are referred as `interpreters` The c2mir driver source was adapted to check if the argv[0] is any of those links. Invoking `c2m` through those links is similar to invoking using ``` $ c2m /path/to/binary {-ei | -eg | -el} <args>... ``` To use with `binfmt_misc`, the driver expects the `P` flag on the binfmt format, that is, the first argument should be the full path to the executable binary. ``` ./a.bmir <args>... c2m-ei /path/to/a.mir ./a.mir <args...> ``` or if the binary is in PATH ``` a.bmir c2m-ei /usr/local/bin/a.mir a.mir ``` The binfmt line is ``` :mir:M::MIR:/usr/local/bin/c2m-el:P ``` Do adapt the path where the `c2m-*` are and possibly change `-el` to your favorite interface (interpeted, generated or lazy)
- Loading branch information
Showing
2 changed files
with
44 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters