161.9. gcc-arm-none-eabi-16.2.0
The bare-metal Cortex-M and Cortex-R compiler
16.2.0-1 · GPL-3.0-or-later AND GPL-3.0-or-later WITH GCC-exception-3.1 · 36.7 SBU · 455.3 MiB, 969 files · 41_system, 467 of 1047 · ports/core/embedded/gcc-arm-none-eabi
Homepage: https://gcc.gnu.org/
Why it is in KDOS. The comment above the 4 ports from binutils-arm-none-eabi to libstdcxx-arm-none-eabi in script/phases/41_system/packages.d/embedded.txt:
THE ORDER IS THE DEPENDENCY. binutils first, then a gcc built --without-headers so libgcc can exist before a libc does, then the libc built WITH that gcc. One recipe cannot do the last two: the compiler has to be installed before the library it compiles can configure against it.
Cortex-M and Cortex-R. --with-multilib-list=rmprofile is what keeps this to the profiles a microcontroller actually is, rather than every ARM variant since 1985.
Depends on: binutils-arm-none-eabi, gmp, mpfr, mpc, zlib, zstd, texinfo.
Required by (3): libstdcxx-arm-none-eabi, picolibc-arm-none-eabi, picotool.
Sources: gcc-arm-none-eabi-16.2.0.tar.xz (102.2 MiB). Every step kpkg takes applies to this port.
Install: script/chroot/exec.sh bash -c 'source script/phases/41_system/phase.env && kpkg install gcc-arm-none-eabi'
build.sh:
mkdir -p build && cd build
../configure \
--target=arm-none-eabi \
--prefix=/usr \
--libexecdir=/usr/lib \
--with-sysroot=/usr/arm-none-eabi \
--enable-languages=c,c++ \
--without-headers \
--with-newlib \
--disable-nls \
--disable-shared \
--disable-threads \
--disable-libssp \
--disable-libgomp \
--disable-libquadmath \
--disable-libatomic \
--disable-libstdcxx-pch \
--disable-decimal-float \
--with-gnu-as --with-gnu-ld \
--with-zstd=/usr \
--without-isl \
--with-multilib-list=rmprofile \
--enable-host-pie \
--enable-host-bind-now \
--with-pkgversion="KDOS" \
CFLAGS_FOR_TARGET="-Os -pipe -ffunction-sections -fdata-sections"
make all-gcc all-target-libgcc LIBGCC2_DEBUG_CFLAGS=-g0
make DESTDIR=$PKG install-gcc install-target-libgcc LIBGCC2_DEBUG_CFLAGS=-g0
rm -rf "$PKG/usr/share/info" "$PKG/usr/share/man/man7"
Programs: arm-none-eabi-c++, arm-none-eabi-cpp, arm-none-eabi-g++, arm-none-eabi-gcc, arm-none-eabi-gcc-16.2.0, arm-none-eabi-gcc-ar, arm-none-eabi-gcc-nm, arm-none-eabi-gcc-ranlib, arm-none-eabi-gcov, arm-none-eabi-gcov-dump, arm-none-eabi-gcov-tool, arm-none-eabi-lto-dump.
Directories: /usr/lib/gcc/arm-none-eabi/16.2.0/arm, /usr/lib/gcc/arm-none-eabi/16.2.0/include, /usr/lib/gcc/arm-none-eabi/16.2.0/include-fixed, /usr/lib/gcc/arm-none-eabi/16.2.0/install-tools, /usr/lib/gcc/arm-none-eabi/16.2.0/plugin, /usr/lib/gcc/arm-none-eabi/16.2.0/thumb, /usr/share/licenses/gcc-arm-none-eabi.