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 as dirty for not conforming to the wiki guidelines. It is now grouped in the list of articles that need formatting improvements.
This article is a stub. You can help by expanding it.

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.