This is an old revision of the document!
External Toolchain
Use OpenWrt as External Toolchain
Using an external toolchain reduce build time when starting with a cleaned-up source tree. Useful when using an automated build system like Hudson/Tinderbox.
Step 1: Build Toolchain
Just do the same as everytime you (re)compile OpenWrt. Checkout openwrt repo, set your options in .config and build the whole thing. Only difference you have to select Package the OpenWrt-based Toolchain in the main view of make menuconfig
Alternatively you can download precompiled toolchain from openwrt download page by searching for the correct toolchain for your target. For example if you need precompiled toolchain for openwrt 22.03.0 for target ipq806x/generic this is the link to use.
Step 2: Build Firmware
We start at the same point as the toolchain. Checkout OpenWrt into directory openwrt (or anything else than toolchain). Now we need some patching, because at the moment (rev 27109) it is not possible to use OpenWrt for both.
Apply these patches in the order listet here:
- 2. Ticket #8786 - Zlib 1.2.5 compilation is failing (Direct-Download from mcbachmann.de) (Patch maybe not compatible with non-OpenWrt-Toolchains as xMff pointed out in IRC)
After this, copy the .config-file from the toolchain directory into this build directory and do a make menuconfig.
- [*] Advanced configuration options (for developers)
- [*] Use external toolchain
- Target name: arm-openwrt-linux-uclibcgnueabi (in my case, yours may vary)
- Toolchain prefix: arm-openwrt-linux-uclibcgnueabi- (mind the dash at the end)
- Toolchain root: /path/to/toolchain/staging_dir/toolchain-arm_v5te_gcc-linaro_uClibc-0.9.32_eabi
Save and compile. For my case, the full toolchain build now needs about 1 1/2 hour and the normal firmware takes only 1 hour.