Boost logo

Boost-Build :

From: Edward Diener (eldiener_at_[hidden])
Date: 2019-10-12 04:27:07


On 10/10/2019 10:30 AM, Paul A Bristow via Boost-build wrote:
> Clang on Windows
>
> I have used both b2 bjamtoolset=clangand toolset=clang-winbut found some
> subtle configuration issues.
>
> So I tried toolset=clang(which reports a clang-linux) and have now got
> Boost.Multiprecision to pass tests and examples😊
>
> This is really useful to allowb2toolset=msvc,gcc,clang cxxstd=2a …
>
> ButI note thatclang-win and clang-linux both try to use GCC‘s
>
> --start-group and --end-group
>
>  and produce spurious warningslike this
>
> clang-linux.link
> ..\..\..\bin.v2\libs\multiprecision\example\numeric_limits_snips.test\clng-lnx-9.0.0\rls\cxstd-2a-iso\lnk-sttc\thrd-mlt\vsblt-hdn\numeric_limits_snips.exe
>
> lld-link: warning: ignoring unknown argument '--start-group'
>
> lld-link: warning: ignoring unknown argument '-Bstatic'
>
> lld-link: warning: ignoring unknown argument '-Bdynamic'
>
> lld-link: warning: ignoring unknown argument '--end-group'
>
> if using the lld linker
>
> and similarly using theclang++ (is this really the MSVC linker? Its
> messages look familiar! And the warning number is appropriate…)
>
> LINK : warning LNK4044: unrecognized option '/soname'; ignored
>
> LINK : warning LNK4044: unrecognized option '/-start-group'; ignored
>
> LINK : warning LNK4044: unrecognized option '/Bstatic'; ignored
>
> LINK : warning LNK4044: unrecognized option '/Bdynamic'; ignored
>
> LINK : warning LNK4044: unrecognized option '/-end-group'; ignored
>
> (and alsoclang++: warning: argument unused during compilation:
> '-pthread' [-Wunused-command-line-argument]  (can be suppressed)
>
> This suggests that both .jam files are not quite right (and that this
> may cause other problems).
>
> Any suggestions on avoiding these warnings (rather than muffling them)?
>
> I am not expert enough to tackle, let alone cure – is there anyone
> willing to assist?

Would you please show the toolset definitions for clang and clang-win,
which are causing the LINK warnings which you are seeing ?

Also if you can specify a Boost library for which you are running tests
when you see the output above it would be helpful.

I am not getting the warnings you are seeing when I test a Boost library
with either clang or clang-win but I strongly suspect this is because I
am not specifying any linker to be used and therefore by default using
the linker for gcc and msvc respectively, while you may be specifying
the clang linker. My guess is that the clang-linux and clang-win jam
files are not dealing with the clang linker correctly, whereas they work
fine with the default gcc and msvc linkers.

As a side note I find out that in Windows if you have toolsets for
clang-win and clang in that order and you specify 'b2 toolset=clang
etc.' the Build system will choose the clang-win toolset. The workaround
for this situation is either that you put the toolset definition of the
clang toolset before the clang-win toolset or that you rename the clang
toolset to clang-linux and then invoke which one you want to use as
either 'b2 toolset=clang-linux etc.' or 'b2 toolset-clang-win etc.'. I
thought I would just mention this in case that is causing confusion for you.


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk