Jump to ID:
QNX Operating System

Project Home

Documents

Discussions

Wiki

Project Info
wiki1183: UsingWhatYouBuilt

Using What You Built#

Where are the Binaries?#

Once you have pulled down the source and then built it you will have binaries in two different locations:

  1. At the leaf nodes of the source tree they were build from, in architecture specific variants
  2. In the stage directory in a path representing their target installation location

So if we use the process manager (procnto) for the x86 CPU architecture as an example, it will be located in both

  • .../trunk/services/system/proc/x86/o/procnto
  • .../stage/x86/procnto

Both of these binaries are identical and can be used in a system, the difference is that binaries are not moved from the source tree to the stage directory until a make install is performed.

The stage directories will also contain additional files for libraries that are symbolic links (or copies if running under Windows) of generic libraries to their versioned names (ie libc.so will link to libc.so.2).

Using the Binaries#

Depending on how your system is configured, you can make use of any of the built binaries in your system by:

  • Including them in your base image filesystem and rebuilding the image with mkifs. This is a requirement for changes made to procnto and strongly recommended if you are creating a custom libc
  • Network mounting the stage directory to be accessible to the target from the host system using NFS, CIFS
  • Copying the files to the target filesystem (potentially via network transfer)

By default the binaries produced by the build system are not stripped, this is a post-processing step performed by the QNX distribution. In order to reduce the binary size, you can use the nto<ARCH>-strip command on the binaries.

C:\thomasf\stage\x86\bin>ls -ld %QNX_TARGET%/x86/bin/pidin
-rwx------   1 ThomasF  mkpasswd    45100 May  5  2004 C:/QNX630/target/qnx6/x86/bin/pidin

C:\thomasf\stage\x86\bin>ls -ld pidin 
-rwxrwxrwx   1 ThomasF  mkpasswd    67533 Jul 16 20:58 pidin

C:\thomasf\stage\x86\bin>ntox86-strip ./pidin

C:\thomasf\spartan\td-scripts\trunk-stage\x86\bin>ls -ld pidin
-rwxrwxrwx   1 ThomasF  mkpasswd    52128 Aug 26 15:06 pidin

Identifying Custom Built Binaries from QNX Built Binaries#

During the build process, binaries are stamped with basic information regarding the environment in which they were built. This information can be displayed by the use command:

 
% use -i $QNX_TARGET/x86/bin/pidin
NAME=pidin
DESCRIPTION=Display system statistics
DATE=2004/04/29-21:46:13-UTC
STATE=Stable
HOST=osbld
USER=osbuild
VERSION=6.3.0
TAGID=193 
% use -i $BUILD_ROOT/stage/x86/bin/pidin
C:\thomasf\spartan\td-scripts\trunk-stage\x86\bin>use -i ./pidin
NAME=pidin
DESCRIPTION=Display system statistics
DATE=2007/07/16-20:58:06-EDT
STATE=Experimental
HOST=thomasf-laptop
USER=ThomasF
VERSION=5