1
1
pqc/test
Kris Kwiatkowski 77ca982b4c Redesign CMakeLists.txt for MemorySanitizer
The test programs use googletest and google-benchmark
libraries in order to ensure right level of optimizations
and proper unit testing.
Those two libraries are written in C++ and they
use C++ standard library.

If you want MemorySanitizer to work properly and not
produce any false positives, you must ensure that all
the code in your program and in libraries it uses is
instrumented. That includes C++ standard library.

(see here: https://github.com/google/sanitizers/wiki/MemorySanitizerLibcxxHowTo)

With this change, the Memory Sanitizer build (enabled
by -DMEMSAN=1) will also build MSan-instrumented libc++
from LLVM and will use it as a standard C++ library
when building unit tests and benchmarks.

In particular what I do is this:
1. Clone LLVM project and build libcxx and libcxxabi with
   MSan enabled
2. Build GTEST and GBENCH with -fsanitize=memory and -stdlib=libc++.
   Additionally link against -lc++abi
3. Then use this special version of libc++ and GTEST/GBENCH
   in order to build final binaries containing unit/benchmark tests

The actuall tests with memory sanitizer are disabled, as
I'm getting some errors which need to be investigated first.

Additionally I've splitted single build into multiple, for
release,debug,clang,gcc and AddressSanitizer.

On unrelated note, I've also added flags to ignore some errors
which I'm getting when using newer GCC (see GH#10 GH#11).
2021-06-20 21:34:58 +01:00
..
bench Redesign CMakeLists.txt for MemorySanitizer 2021-06-20 21:34:58 +01:00
katrunner fix bug in kyber 2021-05-27 10:16:04 +01:00
test_common Split aes*_keyexp up into ecb and ctr variants 2021-03-24 21:02:46 +00:00
ct.cpp Build libcxx and libcxxabi with Memory Sanitizer 2021-06-20 21:34:58 +01:00
ut.cpp prefix structs with pqc_ 2021-05-10 16:36:24 +01:00