How to build a toolchain for arm cortex-m and cortex-r

From Gentoo Wiki
Jump to:navigation Jump to:search
This article has been flagged for not conforming to the wiki guidelines. Please help out, if possible. Articles needing formatting improvements.
This article is a stub. Please help out by expanding it - how to get started.

For up to date information on ARM toolchain building (also for Cortex-R and Cortex-M), please have a look at the ARM main article.

Toolchain Installation Steps

Crossdev can almost build a functioning toolchain for embedded arm development. The toolchain can be created with the following steps:

Step 1:

root #crossdev --lenv 'USE="nano -nls -threads -unicode"' -s3 -t arm-unknown-eabi

Step 2:

root #crossdev --lenv 'USE="nano -nls -threads -unicode"' --genv 'USE="cxx -nls -nptl -pch -pie -ssp" EXTRA_ECONF="--with-multilib-list=rmprofile --disable-decimal-float --disable-libffi --disable-libgomp --disable-libmudflap --disable-libquadmath --disable-shared --disable-threads --disable-tls"' -s4 -t arm-unknown-eabi

Step 3:

root #emerge --ask cross-arm-unknown-eabi/newlib

Step 4:

root #crossdev --lenv 'USE="nano -nls -threads -unicode"' --genv 'USE="cxx -nls -nptl -pch -pie -ssp" EXTRA_ECONF="--with-multilib-list=rmprofile --disable-decimal-float --disable-libffi --disable-libgomp --disable-libmudflap --disable-libquadmath --disable-shared --disable-threads --disable-tls"' -s4 --ex-gdb -t arm-unknown-eabi

Now you'll have a functioning multilib / multiarch for embedded arm development with small code output size.

Big thanks to our forum user rapsure who posted this instructions here.