VOOZH about

URL: https://thenewstack.io/compiler-tools-for-embedded-linux-systems/

⇱ Compiler Tools for Embedded Linux Systems - The New Stack


TNS
SUBSCRIBE
Join our community of software engineering leaders and aspirational developers. Always stay in-the-know by getting the most important news and exclusive content delivered fresh to your inbox to learn more about at-scale software development.
REQUIRED
It seems that you've previously unsubscribed from our newsletter in the past. Click the button below to open the re-subscribe form in a new tab. When you're done, simply close that tab and continue with this form to complete your subscription.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.
Welcome and thank you for joining The New Stack community!
Please answer a few simple questions to help us deliver the news and resources you are interested in.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Great to meet you!
Tell us a bit about your job so we can cover the topics you find most relevant.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Welcome!

We’re so glad you’re here. You can expect all the best TNS content to arrive Monday through Friday to keep you on top of the news and at the top of your game.

What’s next?

Check your inbox for a confirmation email where you can adjust your preferences and even join additional groups.

Follow TNS on your favorite social media networks.

Become a TNS follower on LinkedIn.

Check out the latest featured and trending stories while you wait for your first TNS newsletter.

PREV
1 of 2
NEXT
VOXPOP
As a JavaScript developer, what non-React tools do you use most often?
Angular
0%
Astro
0%
Svelte
0%
Vue.js
0%
Other
0%
I only use React
0%
I don't use JavaScript
0%
Thanks for your opinion! Subscribe below to get the final results, published exclusively in our TNS Update newsletter:
NEW! Try Stackie AI
From clobbered drafts to real-time sync
Apr 14th 2026 10:00am, by David Moore
TypeScript 6.0 RC arrives as a bridge to a faster future
Mar 14th 2026 9:00am, by Darryl K. Taft
Mastra empowers web devs to build AI agents in TypeScript
Jan 28th 2026 11:00am, by Loraine Lawson
2020-08-10 13:45:17
Compiler Tools for Embedded Linux Systems
contributed,sponsor-linux-foundation-training,sponsored,sponsored-post-contributed,
Linux / Software Development

Compiler Tools for Embedded Linux Systems

When working with embedded Linux systems, one of the first things you need is a cross compiler toolchain.
Aug 10th, 2020 1:45pm by John Bonesio
👁 Featued image for: Compiler Tools for Embedded Linux Systems
Linux Foundation Training sponsored this post.
This is part of a series on using Linux for embedded systems. For a list of other articles in this series, check out the introductory post.

The Linux Foundation sponsored this post.

John Bonesio
John is a Linux Instructor at The Linux Foundation.

When working with embedded Linux systems, one of the first things you need is a cross compiler toolchain.

For the uninitiated, cross compiler tools are a set of tools (compiler, linker, assembler, etc.) that produce code in your compiled programs for a CPU instruction set different from your host machine’s CPU. For example, if you have a cross toolchain for ARM, you would compile your programs on your x86 laptop or desktop computer, and these programs would run on your embedded ARM system rather than on your laptop/desktop.

This article will refer to a lot of terms, such as kernels, bootloaders, root filesystems, and more. If these terms are unfamiliar to you, you can review previous articles in this series: Part 1, Part 2.

Using Existing Tools

There exist prebuilt cross embedded tools for ARM, PowerPC, MIPS, and more. If you are using a Debian based Linux distribution, such as Ubuntu, it’s likely you can just install them using Debian’s package system. For example:

sudo apt-get install gcc-arm-linux-gnueabi g++-arm-linux-gnueabi

Other Linux distributions may also provide prebuilt compiler tools. These prebuilt tools often support C, C++, Objective C, Fortran, and more. And there are tools that support various hardware features in your embedded platform, such as the floating-point unit.

Using these prebuilt tools is probably the easiest way to get started building various software components of your embedded Linux system.

Building Your Own Tools

If you need more control, such as optimizing for size or making use of even more control over your processor features, you can build the compiler toolchain yourself.

Building the cross-compiler toolchain is pretty tricky. To build it correctly, it needs to be built three times to bootstrap the whole process — building a simple compiler to build libraries, then rebuilding it to use the libraries, etc. Most people don’t build cross-compiler tools by hand; instead, they use other tools to build them. There are a few tools available to build your own cross-compiler toolchain. Here are just a few of the more commonly used ones.

Crosstool-NG

Crosstool-NG is a tool that builds cross toolchains. It will also build the standard libraries for your programs to link. You can find more information about crosstool-NG here.

Buildroot

Buildroot’s goal is to build an entire root filesystem — all the programs that go into /bin, /sbin, etc. As part of this process, Buildroot will also build the cross toolchain. Buildroot will build the cross toolchain, shared libraries and all the binary programs for the root filesystem, and will create a directory hierarchy of the root filesystem. Buildroot also optionally lets you build the kernel and the bootloader.

One advantage of Buildroot over crosstool-NG is that it will include all the shared libraries in the root filesystem — libraries that are needed if using dynamic linking. With crosstool-NG, these would need to be added to the root filesystem by some other process. You can find more information about Buildroot here.

Yocto

The Yocto Project makes use of a tool called bitbake. Bitbake is a tool designed for building packages for embedded systems. These packages can be RPM packages, Debian packages, ipkg packages, or others. In order to create these packages, the Yocto Project will build the cross toolchain, and build a set of packages and their dependencies.

Yocto will also create an entire root filesystem that you can use directly or use to debug how the packages get installed. So like Buildroot, the Yocto Project will build the cross toolchain, shared and static libraries, the root filesystem, the Linux kernel, and the bootloader. Yocto will also create packages that can be installed individually. You can find more information about the Yocto Project here.

Once you have your cross compiler toolchain installed, you are set to build the various components of your embedded Linux system.

Feature image via Pixabay.

At this time, The New Stack does not allow comments directly on this website. We invite all readers who wish to discuss a story to visit us on Twitter or Facebook. We also welcome your news tips and feedback via email: feedback@thenewstack.io.

The Linux Foundation is the world’s leading home for collaboration on open source software, hardware, standards, and data. Linux Foundation projects are critical to the world’s infrastructure including Linux, Kubernetes, Node.js, ONAP, Hyperledger Foundation, PyTorch, RISC-V, and more.
Learn More
The latest from Linux Foundation Training
TRENDING STORIES
John is a Linux Instructor at The Linux Foundation.
Read more from John Bonesio
Linux Foundation Training sponsored this post.
SHARE THIS STORY
TRENDING STORIES
SHARE THIS STORY
TRENDING STORIES
TNS DAILY NEWSLETTER Receive a free roundup of the most recent TNS articles in your inbox each day.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.