LLVM linker not working?

  • ccmake 3.16.3
  • LLVM | CLANG | LLD 10
  • Ninja 1.10.0

My assumption is that http://lld.llvm.org would be the correct linker to be utilised with LLVM | CLANG and therefore tried

CMAKE_LINKER = /usr/bin/llvm-link-10
CMAKE_LINKER = /usr/bin/lld-10
CMAKE_LINKER = /usr/bin/ld.lld-10
CMAKE_LINKER = /usr/lib/llvm-10/bin/ld.lld

However, either seems being neglected and instead invoking /usr/bin/ld, producing:

CMake Error at /usr/share/cmake-3.16/Modules/CMakeTestCXXCompiler.cmake:53 (message):
   The C++ compiler


   is not able to compile a simple test program.

   It fails with the following output:

     Change Dir: /srv/build/amd64/CMakeFiles/CMakeTmp

     Run Build Command(s):/usr/bin/ninja cmTC_5baff && [1/2] Building CXX object CMakeFiles/cmTC_5baff.dir/testCXXCompiler.cxx.o
     [2/2] Linking CXX executable cmTC_5baff
     FAILED: cmTC_5baff
     : && /usr/bin/clang++-10     CMakeFiles/cmTC_5baff.dir/testCXXCompiler.cxx.o  -o cmTC_5baff   && :
     /usr/bin/ld: cannot find -lstdc++
     clang: error: linker command failed with exit code 1 (use -v to see invocation)
     ninja: build stopped: subcommand failed.

From the documentation I could not find a hint of what might be wrong (what I am missing) and thus would hope for assistance here, unless this a bug of sorts?

the linker is not invoked by the frontend (clang+±10 in this case) and cmakes’s CMAKE_LINKER does not fit into this context.