I shot my myself in the foot by adding --version to try to record the linker version (useful when you are trying to confirm that all the available linkers (clang++, clang-cl, ld, lld and gold all work as expected)
I forgot, if I ever knew, that the undocumented side effect of adding --version is to ignore all other commands!
So I am pleased to confirm that Clang version 8.1.0 and 9.0.0 works nicely for the latest draft C++ standard, building a sample of Boost.Math and Boost.Multiprecision.
using the default clang++.exe dynamic linker uses the MSVC linker., but i have also used the new LLD linker.
I have the compiler unzipped to Compiler executable directory : C:\LLVM\clang-900\LLVM
and copied an existing antique Clang version renaming it to clang900 with these new executables:
C compiler clang.exe
C++ compiler clang++.exe
Linker for dynamic links clang++.exe
Linker for static libs : lld-link.exe
Compiler options- "std=c++2a" for latest C++ standard
-------------- Build: Debug_clang900 in numeric_limits_snips (compiler: LLVM Clang 900 Compiler)---------------
clang++.exe -Wall -fexceptions -g -std=c++2a --verbose -I..\..\..\boost -c I:\boost\libs\multiprecision\example\numeric_limits_snips.cpp -o obj\Debug\boost\libs\multiprecision\example\numeric_limits_snips.o
clang++.exe -o bin\Debug\numeric_limits_snips.exe obj\Debug\boost\libs\multiprecision\example\numeric_limits_snips.o -v
clang version 9.0.0 (tags/RELEASE_900/final)
Target: x86_64-pc-windows-msvc
Thread model: posix
InstalledDir: C:\LLVM\clang-900\LLVM\bin
"C:\\LLVM\\clang-900\\LLVM\\bin\\clang++.exe" -cc1 -triple x86_64-pc-windows-msvc19.24.28207 -emit-obj -mrelax-all -mincremental-linker-compatible -disable-free -disable-llvm-verifier -discard-value-names -main-file-name numeric_limits_snips.cpp -mrelocation-model pic -pic-level 2 -mthread-model posix -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -target-cpu x86-64 -gcodeview -debug-info-kind=limited -momit-leaf-frame-pointer -v -coverage-notes-file "I:\\Cpp\\hello_boost\\numeric_limits_snips\\obj\\Debug\\boost\\libs\\multiprecision\\example\\numeric_limits_snips.gcno" -resource-dir "C:\\LLVM\\clang-900\\LLVM\\lib\\clang\\9.0.0" -I "..\\..\\..\\boost" -internal-isystem "C:\\LLVM\\clang-900\\LLVM\\lib\\clang\\9.0.0\\include" -internal-isystem "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Preview\\VC\\Tools\\MSVC\\14.24.28207\\include" -internal-isystem "C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.18362.0\\ucrt" -internal-isystem "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.18362.0\\shared" -internal-isystem "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.18362.0\\um" -internal-isystem "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.18362.0\\winrt" -Wall -std=c++2a -fdeprecated-macro -fdebug-compilation-dir "I:\\Cpp\\hello_boost\\numeric_limits_snips" -ferror-limit 19 -fmessage-length 0 -fno-use-cxa-atexit -fms-extensions -fms-compatibility -fms-compatibility-version=19.24.28207 -fdelayed-template-parsing -fno-implicit-modules -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -faddrsig -o "obj\\Debug\\boost\\libs\\multiprecision\\example\\numeric_limits_snips.o" -x c++ "I:\\boost\\libs\\multiprecision\\example\\numeric_limits_snips.cpp"
clang -cc1 version 9.0.0 based upon LLVM 9.0.0 default target x86_64-pc-windows-msvc
#include "..." search starts here:
#include <...> search starts here:
..\..\..\boost
C:\LLVM\clang-900\LLVM\lib\clang\9.0.0\include
C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28207\include
C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt
C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared
C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um
C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt
End of search list.
clang version 9.0.0 (tags/RELEASE_900/final)
Target: x86_64-pc-windows-msvc
Thread model: posix
InstalledDir: C:\LLVM\clang-900\LLVM\bin
"C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Preview\\VC\\Tools\\MSVC\\14.24.28207\\bin\\Hostx64\\x64\\link.exe" "-out:bin\\Debug\\numeric_limits_snips.exe" -defaultlib:libcmt "-libpath:C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Preview\\VC\\Tools\\MSVC\\14.24.28207\\lib\\x64" "-libpath:C:\\Program Files (x86)\\Windows Kits\\10\\Lib\\10.0.18362.0\\ucrt\\x64" "-libpath:C:\\Program Files (x86)\\Windows Kits\\10\\Lib\\10.0.18362.0\\um\\x64" -nologo "obj\\Debug\\boost\\libs\\multiprecision\\example\\numeric_limits_snips.o"
(optionally to use the new lld linker, one can use the lld.linker by adding linker option
Other linker options "-fuse-ld=lld"
and the compiler option -flto=thin to ensure the .o file is of the right type.
(but NOT if using default MS linker or get fatal error LNK1136: invalid or corrupt file)
)
-------------- Build: Debug_clang900 in numeric_limits_snips (compiler: LLVM Clang 900 Compiler)---------------
clang++.exe -Wall -fexceptions -g -std=c++2a --verbose -flto=thin -I..\..\..\boost -c I:\boost\libs\multiprecision\example\numeric_limits_snips.cpp -o obj\Debug\boost\libs\multiprecision\example\numeric_limits_snips.o
clang++.exe -o bin\Debug\numeric_limits_snips.exe obj\Debug\boost\libs\multiprecision\example\numeric_limits_snips.o -v -fuse-ld=lld
clang version 9.0.0 (tags/RELEASE_900/final)
Target: x86_64-pc-windows-msvc
Thread model: posix
InstalledDir: C:\LLVM\clang-900\LLVM\bin
"C:\\LLVM\\clang-900\\LLVM\\bin\\clang++.exe" -cc1 -triple x86_64-pc-windows-msvc19.24.28207 -emit-llvm-bc -flto=thin -flto-unit -disable-free -disable-llvm-verifier -discard-value-names -main-file-name numeric_limits_snips.cpp -mrelocation-model pic -pic-level 2 -mthread-model posix -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -target-cpu x86-64 -gcodeview -debug-info-kind=limited -momit-leaf-frame-pointer -v -coverage-notes-file "I:\\Cpp\\hello_boost\\numeric_limits_snips\\obj\\Debug\\boost\\libs\\multiprecision\\example\\numeric_limits_snips.gcno" -resource-dir "C:\\LLVM\\clang-900\\LLVM\\lib\\clang\\9.0.0" -I "..\\..\\..\\boost" -internal-isystem "C:\\LLVM\\clang-900\\LLVM\\lib\\clang\\9.0.0\\include" -internal-isystem "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Preview\\VC\\Tools\\MSVC\\14.24.28207\\include" -internal-isystem "C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.18362.0\\ucrt" -internal-isystem "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.18362.0\\shared" -internal-isystem "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.18362.0\\um" -internal-isystem "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.18362.0\\winrt" -Wall -std=c++2a -fdeprecated-macro -fdebug-compilation-dir "I:\\Cpp\\hello_boost\\numeric_limits_snips" -ferror-limit 19 -fmessage-length 0 -fno-use-cxa-atexit -fms-extensions -fms-compatibility -fms-compatibility-version=19.24.28207 -fdelayed-template-parsing -fno-implicit-modules -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -faddrsig -o "obj\\Debug\\boost\\libs\\multiprecision\\example\\numeric_limits_snips.o" -x c++ "I:\\boost\\libs\\multiprecision\\example\\numeric_limits_snips.cpp"
clang -cc1 version 9.0.0 based upon LLVM 9.0.0 default target x86_64-pc-windows-msvc
#include "..." search starts here:
#include <...> search starts here:
..\..\..\boost
C:\LLVM\clang-900\LLVM\lib\clang\9.0.0\include
C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28207\include
C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt
C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared
C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um
C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt
End of search list.
lang version 9.0.0 (tags/RELEASE_900/final)
Target: x86_64-pc-windows-msvc
Thread model: posix
InstalledDir: C:\LLVM\clang-900\LLVM\bin
"C:\\LLVM\\clang-900\\LLVM\\bin\\lld-link" "-out:bin\\Debug\\numeric_limits_snips.exe" -defaultlib:libcmt "-libpath:C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Preview\\VC\\Tools\\MSVC\\14.24.28207\\lib\\x64" "-libpath:C:\\Program Files (x86)\\Windows Kits\\10\\Lib\\10.0.18362.0\\ucrt\\x64" "-libpath:C:\\Program Files (x86)\\Windows Kits\\10\\Lib\\10.0.18362.0\\um\\x64" -nologo "obj\\Debug\\boost\\libs\\multiprecision\\example\\numeric_limits_snips.o"
in case these are helpful to others.
This latest version, with many bug fixes, and many new features available, including exciting constexpr compile-time computations, will be be over interest to many users and I'd like to see it in the next release.
(The only feature Clang lacks is the 128-bit floating-point option available as quadmath assembler-coded with gcc. This permits much faster 128-bit FP computation compared to the Boost.Multiprecision C++ software implementation. You can still get the same ~36 decimal digit precision
)
Thanks for your helpful suggestions. Paul