Custom Toolchain Registration
R2026bWhat Is a Custom Toolchain?
You can add support for software build tools to MATLAB® Coder™ software. For example, you can add support for a third-party compiler/linker/archiver (toolchain) to your MATLAB Coder software. This customization can be useful when the added toolchain has support and optimizations for a specific type of processor or hardware. These added toolchains are called custom toolchains.
What Is a Factory Toolchain?
MATLAB Coder software includes factory-default support for a set of toolchains. These toolchains are called factory toolchains to distinguish them from custom toolchains. If you install factory toolchains on your host computer, MATLAB Coder can automatically detect and use them. Support for factory toolchains depends on the host operating system. Toolchains are identified by the compiler in the toolchain. A complete list of supported toolchains (compilers) is available at https://www.mathworks.com/support/compilers/.
What Is a Toolchain Definition?

A toolchain definition provides MATLAB Coder software with information about the software build tools, such as the compiler, linker, archiver. MATLAB Coder software uses this information, along with a configuration object or project, to build the generated code. This approach can be used when generating static libraries, dynamic libraries, and executables. MEX file generation uses a different approach. To specify which compiler to use for MEX-function generation, see Change the Default Compiler.
MATLAB Coder software comes with a set of registered factory toolchain definitions. You can create and register custom toolchain definitions. You can customize and manage toolchain definitions. You can share custom toolchain definitions with others running MATLAB Coder software.
If you install toolchain software for one of the factory toolchains, MATLAB Coder can automatically detect and use the toolchain software. For more information about factory toolchains in MATLAB Coder software, see https://www.mathworks.com/support/compilers/.
Key Terms
It is helpful to understand the following concepts:
Toolchain — Software that can create a binary executable and libraries from source code. A toolchain can include:
Prebuild tools that preprocess build artifacts.
Build tools, such as an Assembler, C compiler, C++ Compiler, Linker, Archiver, that build a binary executable from source code
Postbuild tools that process binary files produced by build tools. For example, a tool that converts debug symbols to DWARF.
Custom toolchain — A toolchain that you define and register for use by MATLAB Coder software
Factory toolchains — Toolchains that are predefined and registered in MATLAB Coder software
Registered toolchains — The sum of custom and factory toolchain definitions registered in MATLAB Coder software
Typical Workflow
The typical workflow for creating and using a custom toolchain definition is:
Create a
target.Toolchainobject that specifies the compilers, linkers, and archivers in the toolchain.Use the
target.addfunction to add the toolchain and associated objects to the internal database.Use the custom toolchain.
Create a
coder.configobject configured to create an executable using the toolchain.Use the
codegenfunction to generate the code and makefile that uses the new toolchain.
For a tutorial example of this workflow, see Add Custom Toolchains to MATLAB® Coder™ Build Process.