As discussed in the LLVM Embedded Toolchains Working Group sync up, LLVM libc has limited testing with baremetal configurations.
Arm Toolchain fort Embedded (ATfE) enabled LLVM libc hermetic tests for baremetal Arm configurations using QEMU.
Reusing the experience and configuration/code from ATfE, here are some proof-of-concept patches to show what is required to be able to run the hermetic tests in the LLVM project itself:
- Additional runtime needed: PoC: Semihosting support for running hermetic tests on baremetal · voltur01/llvm-project@ec919ea · GitHub
- Builder options: PoC: How to run libc hermetic tests on Armv7-M baremetal · voltur01/llvm-zorg@92301b7 · GitHub
Request for Comments
- What is the best place for the linker script?
- Is it OK to add the semihosting bits required for testing into the start.cpp itself or is there a better structure/place? Note that this is not a full semihosting implementation, though it may be a starting point for a future general semihosting library.
- Running the tests requires a number of additional options, adding all of them to the bot name may not be the best option - how to best structure these?
- The list of extra CMake options is rather long (based on ATfE configuration - maybe some of them can be still avoided) - is it OK to keep in the same builder file or better to split out?
- The workers would need qemu-system installed.
@petrhosek @michaelrj-google @Prabhuk please share your thoughts, thank you!