33.7. Baremetal host packaged toolchain
For arm
, some baremetal examples compile fine with:
sudo apt-get install gcc-arm-none-eabi qemu-system-arm ./build-baremetal --arch arm --gcc-which host-baremetal ./run --arch arm --baremetal userland/c/hello.c --qemu-which host
However, there are as usual limitations to using prebuilts:
-
certain examples fail to build with the Ubuntu packaged toolchain. E.g.: userland/c/exit0.c fails with:
/usr/lib/gcc/arm-none-eabi/6.3.1/../../../arm-none-eabi/lib/libg.a(lib_a-fini.o): In function `__libc_fini_array': /build/newlib-8gJlYR/newlib-2.4.0.20160527/build/arm-none-eabi/newlib/libc/misc/../../../../../newlib/libc/misc/fini.c:33: undefined reference to `_fini' collect2: error: ld returned 1 exit status
with the prebuilt toolchain, and I’m lazy to debug.
-
there seems to to be no analogous
aarch64
Ubuntu package togcc-arm-none-eabi
: https://askubuntu.com/questions/1049249/is-there-a-package-with-the-aarch64-version-of-gcc-arm-none-eabi-for-bare-metal