This is a version of libc-test
meant to test the musl C library
which has been converted to Checked C.
The sources here have been mirrored from
this repo. This version of libc-test
is
meant to compile with the
checkedc-clang compiler. It is
also meant to link against a pre-built
compiler-rt downloaded from
llvm.org.
Before building checkedc-libc-test
make sure you have built
checkedc-musl. Also make sure
that you have set the MUSL_PATH
environment variable as documented
here.
libc-test
needs compiler-rt
for the runtime libraries. We download the 10.0
version of the pre-built compiler-rt
for Ubuntu from llvm.org.
export RT_PATH=</some/dir>
wget https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.0/clang+llvm-10.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz
tar -xvf clang+llvm-10.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz -C $RT_PATH --strip 1
Note: Make sure the environment variables MUSL_PATH
and RT_PATH
are set.
export PATH=</path/to/checkedc-clang/bin>
git clone https://github.com/microsoft/checkedc-libc-test.git
cd checkedc-libc-test
make clean && make -j32 2>&1 | tee log
After building and running libc-test
check if any errors have occurred. There
should be 0 errors found in the log file.
grep error: log | wc -l
Next, check what tests have failed, if any.
grep ^FAIL log | wc -l
Note: At the time of writing this README, there were 62 known failures in libc-test
.
To check if an error in your musl
would produce errors in libc-test
, you
can do the following:
- Add an error to your
musl
sources (like insrc/string/strchr.c
) - Rebuild
musl
- Rebuild
libc-test
grep ^FAIL log | wc -l