Building a Distribution of LLVM

Hello everyone,
I need help with building a distribution of LLVM 11 following the instruction

I have built clang; clang-tools-extra with make, ninja and everything works fine:
cmake -G "Unix Makefiles" ../llvm -DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra;compiler-rt"

But when I try to build:
cmake -G Ninja -C <path to clang>/cmake/caches/DistributionExample.cmake <path to LLVM source>
ninja stage2-distribution
It gives me error:
c++: error: unrecognized command line option '-Wthread-safety'

Maybe the instruction is not enough?

Please help me to solve the problem,
Thank you very much.

My environment:

  • Ubuntu 18.04
  • cmake version 3.20.0-rc1
  • gcc version 9.3.0