Chapter 2. Options in depth

While some options, like --output, --keep-working-directory or --help are obvious and self-explanatory there are others options that may be less obvious. Let's take a closer look at these options.

Multiple input executables [ErminePro]

Some programs do all the work by themselves - such as dd, ls, rm and many others. But more complicated programs often invoke helper programs; for example, gcc uses:

cc1

preprocessor + compiler

as

assembler

collect2

linker

ld

real linker, invoked by collect2

So as an example let's pack gcc in a simple way:

$ ErminePro /usr/bin/gcc --output=gcc.ermine

gcc.ermine will be packed successfully and will run on the system where it was packed. But when we're going to move it to the other machine we will encounter a problem: gcc.ermine will be able to run and to parse passed options, but it will fail to run its helper programs -- at best. At worst it will run the ones it finds on the host box, and in all probability the outcome will likely be different from what is desired.

The "simple" way, while having the obvious advantage of being simple, often does not produce the results we are looking for -- thus we have to resort to using multiple input executables.

$ ErminePro /usr/bin/gcc /usr/libexec/gcc/i386-redhat-linux/3.4.2/cc1 /usr/bin/as /usr/libexec/gcc/i386-redhat-linux/3.4.2/collect2 /usr/bin/ld --output=gcc.ermine

When invoked this way, Ermine will pack all listed executables and all shared libraries needed by each one of the executables.

Note

When packing multiple executables with Ermine it's important to specify the "main" executable first. All other executables may be listed in any order.