When I try `b2 toolset=clang-win` on Appveyor, I get `clang-linux-win` instead, that is, `-win` is interpreted as version for some reason, not as platform: https://ci.appveyor.com/project/pdimov/system/build/job/sjpdq5yrir2ewuhh Is this normal, or is it a bug in the clang toolset? Is there a magic command line incantation that would let me select clang-win?
On 9 July 2018 at 13:42, Peter Dimov via Boost
Is there a magic command line incantation that would let me select clang-win?
LOL, yes, it would be kewl if somebody knows (and let the secret out) what the magic words are (or at least, what they are supposed to be). degski -- *"If something cannot go on forever, it will stop" - Herbert Stein*
-----Original Message----- From: Boost [mailto:boost-bounces@lists.boost.org] On Behalf Of Peter Dimov via Boost Sent: 09 July 2018 11:42 To: boost-devel Cc: Peter Dimov Subject: [boost] toolset=clang-win uses clang-linux-win?
When I try `b2 toolset=clang-win` on Appveyor, I get `clang-linux-win` instead, that is, `-win` is interpreted as version for some reason, not as platform:
https://ci.appveyor.com/project/pdimov/system/build/job/sjpdq5yrir2ewuhh
Is this normal, or is it a bug in the clang toolset? Is there a magic command line incantation that would let me select clang-win?
FWIW, my failed attempts to use b2 to generate Boost libraries, in the 'standard' way, announce: clang-linux.compile.c++.without-pth bin.v2\libs\chrono\build\clang-linux-6.0.0\release\threading-multi\chrono.obj clang version 6.0.0 (tags/RELEASE_600/final) Is the "clang-linux" significant? Paul PS user-config.jam is using clang : # Version. 6.0.0 : # Location of Clang compiler .exe file(s). "C:/LLVM/clang-600/LLVM/bin/clang++.exe" : # Options. <compileflags>-v <compileflags>-m64 <compileflags>-fmsc-version=1900 <compileflags>--target=i686-pc-windows-msvc <define>_CRT_SECURE_NO_DEPRECATE <define>_CRT_SECURE_NO_WARNINGS <define>BOOST_CONFIG_SUPPRESS_OUTDATED_MESSAGE <cxxflags>-std=c++17 #https://clang.llvm.org/docs/CommandGuide/clang.html#cmdoption-s # 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. <cxxflags>-flto=full <cxxflags>-Wno-deprecated <cxxflags>-Wno-deprecated-declarations # <cxxflags>-fmacro-backtrace-limit=0 # <cxxflags>-Wno-invalid-token-paste <cxxflags>-Wno-language-extension-token <cxxflags>-Wno-microsoft-enum-value <cxxflags>-Wno-literal-range <cxxflags>-Wno-unknown-pragmas <cxxflags>-Wno-unused-variable <cxxflags>-Wno-microsoft-enum-value <cxxflags>-Wno-invalid-constexpr # Need to stop reporting an error in Boost.System (needs fixing). <linkflags>--verbose <linkflags>-fuse-ld=lld # Essential to use lld. <linkflags>-flto=full # -flto=thin fails using Codeblocks "error: Expected a single module" But not later???? <linkflags>-m64 <linkflags>--target=i686-pc-windows-msvc <linkflags>-lmsvcrt # -lmsvcrt Needed to avoid unresolved external symbol __imp____RTDynamicCast # but also then need <toolset>clang:<define>NODEFAULTLIB=libcmt.lib # Avoid warning. ; --- Paul A. Bristow Prizet Farmhouse Kendal UK LA8 8AB +44 (0) 1539 561830
On 9 July 2018 at 15:01, Paul A. Bristow via Boost
PS user-config.jam is
Thanks for posting that, I hope we can get to establish one that does the job, please post iff you (with PD) manage to get the magic spells correct. Have a nice day, degski PS: I've found that -flto=full tends to slow things down, thin-lto, makes in some cases a remarkable difference, though. -- *"If something cannot go on forever, it will stop" - Herbert Stein*
Paul A. Bristow wrote:
FWIW, my failed attempts to use b2 to generate Boost libraries, in the 'standard' way, announce:
clang-linux.compile.c++.without-pth bin.v2\libs\chrono\build\clang-linux-6.0.0\release\threading-multi\chrono.obj clang version 6.0.0 (tags/RELEASE_600/final)
Is the "clang-linux" significant?
It is. The compiler itself will work, but attempts to build a library, either static or shared, fail, as in https://ci.appveyor.com/project/pdimov/system/build/1.0.117-feature/clang-ap... because the clang-linux toolset tries to use `ar` and `ranlib` for static libraries, and passes ld-style options to link.exe for DLLs. One has to use the clang-win toolset, but it doesn't seem to be getting much attention.
On 9 July 2018 at 15:35, Peter Dimov via Boost
because the clang-linux toolset tries to use `ar` and `ranlib` for static libraries, and passes ld-style options to link.exe for DLLs.
That's no problem, you have to pass "clang-cl -fuse-ld=lld -flto=thin <rest of options>", this way it will use lld and all the rest [this does not work in the VS IDE, though]. degski -- *"If something cannot go on forever, it will stop" - Herbert Stein*
degski wrote:
On 9 July 2018 at 15:35, Peter Dimov via Boost
wrote: because the clang-linux toolset tries to use `ar` and `ranlib` for static libraries, and passes ld-style options to link.exe for DLLs.
That's no problem, you have to pass "clang-cl -fuse-ld=lld -flto=thin <rest of options>", ...
Using lld will work for shared but static libraries will still fail.
On 9 July 2018 at 15:51, Peter Dimov via Boost
Using lld will work for shared but static libraries will still fail.
When I still had it working, it built statics (I only build statics), but the whole lot will have to be compiled the same way, with " -fuse-ld=lld -flto=thin". This is the reason I am pursuing this [building Boost with Clang], since vcpkg has reduced the whole exercise of building Boost (static/dynamic) on windows/vs to drinking lots of coffee, after passing ".\vcpkg install boost". degski -- *"If something cannot go on forever, it will stop" - Herbert Stein*
participants (3)
-
degski
-
Paul A. Bristow
-
Peter Dimov