RSS: Blog | Wiki | Forum

Remarks on compilation

From Easyneufenglish

Jump to: navigation, search

Contents

[edit] Remarks on compilation

[edit] Buildroot

The system used to create the operating system is based on buildroot. It has the advantage of being designed for embedded systems requiring few ressources, and it supports multiple architectures.

It uses a toolchain for cross-compilation. That is to say a set of tools that lets you build an architecture (eg: x86) to another (eg: powerpc).

Thus, it was possible to generate the easygate system on a powerpc.

[edit] Compilation steps

The compilation of the whole EasyOS is divided in two parts

  • crosstool compilation

This step generate the toolchain, which is based on crosstool scripts. This toolchain is build on glibc. It has been choose because of the bad thread and C++ support of uclibc. It would be interesting to get back on uclibc to gain space. Originally, toolchain compilation with uclibc is a part of buildroot.

  • buildroot compilation

Once crosstool generated (and archived to avoid to recompile it for a future image reconstruction), we start compiling buildroot itself. This is a set of makefile which will finally generate a file system.
The system configuration is based on kconfig.

[edit] Tree

Buildroot does not contain the toolchain used for easygate. This one is called crosstool and can be found in an apart mercurial repository.

Here is the content of buildroot:

From buildroot :

  • crosstool

Makefiles necessary to build the toolchain based on uclibc. Some minor changes have been added to support glibc.

  • Docs

Buildroot documentation, not affected, not updated.

  • Package

Contains makefile applications to be installed on the system. Widely modified compared to the upstream of buildroot.

  • Target

Makefile about generating images for targets.

  • Toolchain

Makefile generating executable tools on the compiling machine, needed to compile the entire project.

Easygate compilation issue :

  • toolchain_build_i686

Toolchain directory result

  • build_i686-unknown-linux-gnu

Result of the compilation of each application + a root directory which represent the generated operating system file system.

Added by Easyneuf team :

  • Check

Some scripts to make use checks on the whole image

  • Build

Script to simplify the generation of the operating system

[edit] Performance

Toolchain generation is a very long process. It takes compile binutils for the target architecture, the compiler, and finally glibc.
To avoid repeating these steps each time, we store the crosstool in crosstool.tar.bz.

The buildroot is also very long to do since it requires to compile all the packages to make a clean image. Of course, it is possible to rebuild the packages individually and launch the target which created the image.

Make can run several processes at the same time, which is a serious advantage on multi-processors machines. This option -j can be found in the Build options section under the title Number of jobs to run simultaneously.