Boost logo

Boost :

Subject: [boost] clang-win clang-cl.exe on Windows 10 - is it time to add clang-win to the Boost test matrix?
From: Paul A. Bristow (pbristow_at_[hidden])
Date: 2019-02-27 16:55:22

Confirming the work of others (pdimov and degski et al), I am now getting good results using clang-win (Clang 8.0.0 rc using GCC
provided by Mingw64) on Windows 10. (Clang 8.0.0 should be finally released very soon now).

Working the develop branch (fully up-to-date), I can run the Boost.Math examples and tests, and build the a set of most libraries

(4 versions of most, for example)
27-Feb-19 14:32 15,872 boost_atomic-clangw8-mt-d-x64-1_70.dll
27-Feb-19 14:32 2,442 boost_atomic-clangw8-mt-d-x64-1_70.lib
27-Feb-19 14:32 9,728 boost_atomic-clangw8-mt-x64-1_70.dll
27-Feb-19 14:32 2,420 boost_atomic-clangw8-mt-x64-1_70.lib

 (but there are some failures to compile or to link).

Examples in Addendum below:

My user-config.jam contains

  using clang-win
     : # Clang Version.
     : # Location of Clang compiler .exe file(s). Must use clang-cl driver, not clang++.exe
       # Copied path is "C:\LLVM\clang-700\LLVM\bin\clang-cl.exe"
       -fuse-ld=lld # Use lld linker, not clang++.

     : # Options.
       <cxxflags>-v # Verbose output for testing only. ? --verbose does not work for clang?
      # <compileflags>-m64 Use address-model=64 on command line.
       <compatibility>vc14 # MS version compatibility.
       # options are -flto, -flto=full, -flto=thin, -emit-llvm
       # Generate output files in LLVM formats, suitable for link time optimization.
       # The default for -flto is "full", in which the LLVM bitcode is suitable for monolithic Link Time Optimization (LTO),
       # where the linker merges all such modules into a single combined module for optimization.
      # With "thin", ThinLTO compilation is invoked instead.
       # MS clang-cl compatibility settings:
       <cxxflags>"/std:c++17" # Must be c++17, not earlier.
       <cxxflags>"/EHsc" # exception handling
       # (/EHsc), catches C++ exceptions only and tells the compiler to assume that
       # functions declared as extern "C" never throw a C++ exception.

       # Clang flags:
       # <cxxflags>-std=c++17 - already declared as a MS option.
       # <cxxflags>-fmacro-backtrace-limit=0
       # <cxxflags>-Wno-invalid-token-paste
       # <cxxflags>-Wno-invalid-constexpr # Need to stop reporting an error in Boost.System?


# Not all these may be needed to get a mostly warning-free build.

My build command is

\modular-boost>b2 -j4 toolset=clang-win-8.0.0 address-model=64 architecture=x86 --libdir=I:/modular-boost/lib --build-type=complete
--without=mpi --without=python install 1>../boost_clang-win-8.0.0_64_config_27-Feb-19_1507.log

I wonder if this means that it is time to add clang-win-8 configuration to the Boost Test summary at



PS What I have failed to get working is __float128 which works using GCC, but even after a patch enabling Clang in multiprecision's
config and ensuring that quadmath.h is visible to the Clang compiler. It reports "not supported" :-(

I have enquired if any progress can be made on making this work.

Addendum - problem examples:

LLVM ERROR: Associative COMDAT symbol '??_7codecvt_error_cat@?A0x15DB13AB@@6B@' does not exist.

lld-link: error: undefined symbol: __imp_CryptGenRandom
>>> referenced by I:\modular-boost\libs\random\src\random_device.cpp:121
>>> lto.tmp:("public: unsigned int __cdecl boost::random::random_device::impl::next(void)"
clang-cl: error: linker command failed with exit code 1 (use -v to see invocation)

         "C:/LLVM/clang-800/LLVM/bin/clang-cl.exe" "-fuse-ld=lld" -m64 /link /incremental:no /DLL /DEBUG /subsystem:console

and most annoyingly, since Boost.Test is a key library,


but no release variants :-(
LLVM ERROR: Associative COMDAT symbol '??_7results_reporter_impl@?A0x22C2280D_at_results_reporter_at_unit_test_at_boost@@6B@' does not exist.
clang-cl: error: linker command failed with exit code 1 (use -v to see invocation)

         "C:/LLVM/clang-800/LLVM/bin/clang-cl.exe" "-fuse-ld=lld" -m64 /link /incremental:no /DLL /subsystem:console

Paul A. Bristow
Prizet Farmhouse
Kendal UK LA8 8AB
+44 (0) 1539 561830

Boost list run by bdawes at, gregod at, cpdaniel at, john at