This toolchain comes with a companion platform, so the easiest way to use it is as follows:
[env]
platform = https://github.com/modern-avr/platform.git
board = ...
That's it!
Aside from providing a newer compiler, it makes a few changes to the build flags:
- Replaces
-std=c++11
with-std=gnu++26
. - Removes
-fpermissible
to encourage better coding practices. - Adds
-Wno-volatile
because Arduino framework usesvolatile
in a now deprecated way.
- Replaces
-std=c11
with-std=gnu23
.
You can re-enable or disable any flags using build_flags
and build_unflags
, as usual.
Currently, the toolchain has been built for:
linux_x86_64
windows_amd64
Pull requests for additional platforms are welcome.
- Docker
- GNU Make
- Bash
Toolchain | Space | Time |
---|---|---|
windows_amd64 |
72 GiB | 125 min |
linux_x86_64 |
52 GiB | 82 min |
The build times were measured on an AMD Ryzen 9 7845HX 18-core VM with 32 GB RAM. If you build both toolchains, you'll save around 2.5 GiB due to base image overlap.
Space usage is approximate, as accurate measurement is difficult due to cleanups. Having 100 GiB of free space should suffice.
Currently, only building on Linux is supported. If you can make this run on Windows or macOS, please submit a pull request.
Run:
make menuconfig
Note: Building Bison and Mold is broken on Windows, so they are disabled. Building DTC for Windows requires patches (included).
Please do not change anything related to paths or filenames, as the packaging scripts will not recognize new values.
To build the linux_x86_64
toolchain:
make linux_x86_64
To build the windows_amd64
toolchain:
make windows_amd64
To build all toolchains (e.g., both):
make all
To remove just-built toolchains:
make clean
To also remove the build cache:
make distclean
Simply run the build command again.
The most common reasons for failure are:
- Insufficient disk space.
- Insufficient RAM.
To mitigate this, run:
make menuconfig
and reduce the number of concurrent jobs.
When a build fails, build.log
(if available) is automatically copied to the repository root, overwriting any previous version.
To resume building, rerun the build command. It will pick up from the last successful step automatically.
To resume building from a specific step, run:
make linux_x86_64 RESUME=linker
Replace the target OS and build step accordingly.
Copyright © 2024 toriningen toriningen.me@gmail.com
This work is free. You can redistribute it and/or modify it under the terms of the Do What The Fuck You Want To Public License, Version 2, as published by Sam Hocevar. See the COPYING file for more details.