-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Open
Labels
Description
Downstream (https://github.com/arm/arm-toolchain/), I have managed to hack together running hermetic testing of unit tests by LLVM.
❯ qemu-system-arm -M mps2-an500 -semihosting -nographic -device loader,file=libc/test/src/stdio/libc.test.src.stdio.printf_test.__hermetic__.__build__ -s -S
[==========] Running 1 test from 1 test suite.
[ RUN ] LlvmLibcPrintfTest.PrintOut
A simple string with no conversions.
1234567890
1234 and more
[ OK ] LlvmLibcPrintfTest.PrintOut
Ran 1 tests. PASS: 1 FAIL: 0
In an ideal world, I would like to contribute this upstream, where the embedded build is ran in the post-commit, which in-turn can be used to catch any errors relating to baremetal implementations. In order to do this, I will have to do the following.
However, after a few discussions, it was suggested that that is better done first downstream, with the option to integrate this upstream if it adds enough value.
- Start the mutex implementation ([libc] Mutex implementation for single-threaded baremetal #145358)
-
atexit()
currently disabled for baremetal targets ([libc] Add atexit to baremetal entrypoints #147290) - Disable
thread_local
when single-threaded mode is selected ([libc] Change LIBC_THREAD_LOCAL to be dependent on LIBC_THREAD_MODE #151527)
-
- Add startup code ([libc] Basic implementation of crt0 #146863)
- Cleanup code ([libc] Cleanup startup/baremetal/arm/start.cpp #151532)
- Add v7-A and v7-R ([libc] Add startup code for ARM v7-A, ARM v7-R variants #153576)
- Fix a few bugs with the testing on LLVM-libc
- Add the
-nolibc
flag to the baremetal Clang driver ([clang] Add option for -nolibc in Driver/ToolChains/Baremetal.cpp #145700) -
clock()
unimplemented, and thereforeLibcTest.cpp
doesn't compile ([libc] Fix issue with using clock() in hermetic testing #146069 or [libc] Baremetal version of clock #146417) - Some bugs found when testing ([libc] Fix WEOF and fix 1'000'000 error messages on test failure #147928)
- Add the
- Add extra CMake options ([libc] Add hooks for extra options in running hermetic tests #147931)
Downstream patch: arm/arm-toolchain#420