Home · All Classes · Grouped Classes · Annotated · Functions

Qtopia Single Exec

Introduction

Qtopia can be compiled in a number of ways. The two most common ways are:

  1. standard compile - which is a fully dynamic build where each application is a separate binary run as a separate process
  2. single-exec compile - qpe and all the applications are linked together in a single large binary, however applications are run as separate processes.

Benefits

There are a number of benefits to single-exec as follows:

Explanation

The single-exec makes it possible to statically link all libraries to the programs without each application having a copy of all the libraries. Compiling all the applications into a single binary removes the problem of large individual application binaries and each application is run as a separate process to ensure that a single application fault does not bring down the whole system.

How it works

When an application is started in single-exec, the server process is forked and the same binary is executed again, with an argv list that informs the newly created process what application it should be. This model is very similar to that used by a UNIX tool called busybox which morphs into different programs based on argv[0].

The size benefit of single-exec is derived from static linking. When the linker combines the code, it performs various size optimizations such as:

Issues

One important thing to be aware of when building single-exec with additional 3rd-party components is that the symbols must not clash with those from other applications. The use of C++ namespaces would be a very good idea to avoid potential problems caused by this.

Building Single-exec

To build Qtopia as a single-exec binary:

The result is that no application binaries or plug-ins will be generated. Instead, the qpe binary will be larger but will contain all the code that would have been in the other binaries.


Copyright © 2007 Trolltech Trademarks
Qtopia 4.2.5