Scroll to navigation

crosstool-NG(1) User Commands crosstool-NG(1)


ct-ng, crosstool-NG - Build cross-toolchains


ct-ng ACTION


Building a cross-toolchain can be a real pain.

crosstool-NG makes it easy to build cross-toolchains, and allows you to take all the juice out of your target by configuring the different components of the toolchain according to the targeted processor.


Here are the most commonly used actions. For other actions, please see the documentation in /usr/share/doc/packages/crosstool-ng

Prints a little help text.
Configures crosstool-NG using a configurator menu very similar to that of the Linux kernel.
Apply options found in an existing .config file, and ask for newer options if there are any.
Save the current crosstool-NG configuration, and associated components' config files, into a sample. Samples are saved in their own sub-directory, named after the target's tuple, in the samples sub-directory of the current directory. Samples can be later recalled by calling ct-ng with the target tuple they represent.
Save the current configuration to a mini-defconfig file, that contains only the strictly required symbols to reproduce the configuration. defconfig files are much smaller than a complete .config, so it is easy to send by mail. As only non-default symbols are present in a defconfig, it easy to spot the meaningful values. Also, it is easy to use defconfig files with newer versions of crosstool-NG. By default the mini-defconfig is saved to a file named defconfig, unless the variable $DEFCONFIG is set, in which case the mini-defconfig will be saved to the file referenced by $DEFCONFIG.

Note: only the .config file for crosstool-NG is saved. Config files for the components are not saved. Use saveconfig for that

Configure crosstool-NG using a mini-defconfig file (previously saved with savedefconfig or manually edited). The default mini-defconfig is read from the file defconfig, unless the variable $DEFCONFIG is set, in which case the mini-defconfig will be read from the file referenced by $DEFCONFIG
Builds the configured toolchain.
Remove files generated by crosstool-NG for itself (these are mostly the configurators' binaries).
Same as clean , but also removes the toolchain build directory, the downloaded files and the .config configuration file. The generated toolchain is left untouched, as well as samples which are not removed.
Updates the config.guess and config.sub scripts. These scripts are used by crosstool-NG to canonicalise the machines' name (host, build and target machines).


Respectively stops and restarts the build just before this step. To restart a step, a previous build should have run at least to that step, or further.

The list of steps is viewable with the action list-steps.


The ct-ng frontend is in fact a make(1) script. See the man page for make(1) to have the meaning of the exit values.


Don't run as root! Great care has been taken to avoid mistakes, but bug-free programs don't exist. During normal operation, crosstool-NG removes entire directories. If you run as root, and there is a bug or you mis-configured crosstool-NG, entire important directories could be removed (eg. /usr), although crosstool-NG will refuse to install toolchains in some well known critical directories.


Yann E. MORIN and a lot of contributors.


You can find more in-depth documentation in /usr/share/doc/packages/crosstool-ng.

Please have a look at the

Wed Dec 7 21:42:28 2022 version 1.25.0