Adding missing shared libraries automatically
You can use the mkifs autoso attribute to add to your IFS image any shared libraries that are required by binaries included in the image but that are missing from the buildfile.
In your buildfile, the autoso attribute causes mkifs to scan the specified ELF binaries recursively for shared libraries needed by these binaries. That is, it scans the binaries, then all shared libraries needed by them, all shared libraries needed by the previous ones, and so on. Any needed shared library not already in the image will be either listed or added to the image, according to the autoso option specified for the original binary.
Thus, you can use the autoso attribute to simply list all shared libraries that are needed by your build but not specified in the buildfile, so that you can then manually update your buildfile, or to have mkifs automatically include the needed but missing shared libraries.
You can specify global attributes at the end of your buildfile to have mkifs apply them to any shared libraries it automatically adds to the image. (An attribute placed on a line by itself modifies all subsequent files; for an explanation, see the mkifs entry in the Utilities Reference.)
If mkifs is running in verbose mode (i.e., the -v
option is specified), any library added automatically will be preceded by an
[A]
in the file list.
If two binaries in the buildfile need the same shared library but one binary uses the autoso attribute's l[ist] option while the other binary uses the a[dd] option, then the a[dd] option takes precedence. That is, mkifs will add the shared object file to the image, but not print it in the list of missing shared libraries.
[autoso=add]
foo
...
where foo
is an executable will result in files being added to
proc/boot as follows:
foo=C:/tmp/foo
[A] libaoi.so.1=C:/my_qnx_sdp/target/qnx/x86_64/usr/lib/libaoi.so.1
But
[autoso=add]
foo
[prefix=lib]
...
will result in automatically added files being added to lib/,
which mkifs will list as follows:
foo=C:/tmp/foo
[A] lib/libaoi.so.1=C:/my_qnx_sdp/target/qnx/x86_64/usr/lib/libaoi.so.1
When generating secondary IFSs, use only the l[ist] option, and add any required binaries manually by updating your buildfile. If you use the a[dd] option, libraries already present in the primary IFS might also get added to the secondary IFS.
The autoso attribute only looks for needed but missing shared libraries (usually, with a version number in their name). If you also need (unnumbered) symbolic links to the shared libraries, make sure that the [+autolink] attribute is set at the end of your buildfile.
The autoso attribute doesn't list which binaries need a missing library; it only lists or adds the missing library as required. If you need that other information, you must investigate for yourself.