Boost logo

Boost :

Subject: Re: [boost] clang-win, (Thin)LTO this time
From: degski (degski_at_[hidden])
Date: 2018-11-01 10:27:39


On Wed, 31 Oct 2018 at 16:32, Peter Dimov via Boost <boost_at_[hidden]>
wrote:

> using clang-win : : "C:\\Program Files\\LLVM\\bin\\clang-cl.exe"
> "-fuse-ld=lld" : ... ;
>

I have:

import option ;
using clang-win : : "C:\\Program Files\\LLVM\\bin\\clang-cl.exe"
"-fuse-ld=lld" : ... ;

output:

 C:/boost/tools/build/src/tools\clang-win.jam:74: in clang-win.init
*** argument error
* rule path.native ( path )
* called with: ( C:\Program Files\LLVM\bin\clang-cl.exe -fuse-ld=lld )
* extra argument -fuse-ld=lld

So, this syntax does not seem to be accepted by b2.

Or, you could set <archiver> manually:
>
> using clang-win : : : <archiver>"\"C:\\Program
> Files\\LLVM\\bin\\lld-link.exe\" /lib" ... ;
>

This works, up to a point, it does create the libs, but some of the feature
detection .exe's fail to compile:

clang-win.link
c:\boost-build\boost\bin.v2\standalone\ac\clng-win-8.0.0\dbg\adrs-mdl-64\instr-set-hswl\lnk-sttc\rntm-lnk-sttc\thrd-mlt\lzma.exe

         "C:\Program Files\LLVM\bin\clang-cl.exe" -m64 /link
/incremental:no /DEBUG /subsystem:console
/out:"c:\boost-build\boost\bin.v2\standalone\ac\clng-win-8.0.0\dbg\adrs-mdl-64\instr-set-hswl\lnk-sttc\rntm-lnk-sttc\thrd-mlt\lzma.exe"
-flto=thin
@"c:\boost-build\boost\bin.v2\standalone\ac\clng-win-8.0.0\dbg\adrs-mdl-64\instr-set-hswl\lnk-sttc\rntm-lnk-sttc\thrd-mlt\lzma.exe.rsp"
        if %ERRORLEVEL% NEQ 0 EXIT %ERRORLEVEL%

LINK : warning LNK4044: unrecognized option '/flto=thin'; ignored
c:\boost-build\boost\bin.v2\standalone\ac\clng-win-8.0.0\dbg\adrs-mdl-64\instr-set-hswl\lnk-sttc\rntm-lnk-sttc\thrd-mlt\main-lzma.obj
: fatal error LNK1107: invalid or corrupt file: cannot read at 0x9E4
clang-cl: error: linker command failed with exit code 1107 (use -v to see
invocation)

In view of the format of the linker warning, I must conclude that link.exe
is called. In my case, they would have failed anyway, but it's obviously
not correct.

What does work is:

"C:\Program Files\LLVM\bin\clang-cl.exe" -fuse-ld=lld -flto=thin -m64 /link
/incremental:no /DEBUG /subsystem:console
/out:"c:\boost-build\boost\bin.v2\standalone\ac\clng-win-8.0.0\dbg\adrs-mdl-64\instr-set-hswl\lnk-sttc\rntm-lnk-sttc\thrd-mlt\lzma.exe"
@"c:\boost-build\boost\bin.v2\standalone\ac\clng-win-8.0.0\dbg\adrs-mdl-64\instr-set-hswl\lnk-sttc\rntm-lnk-sttc\thrd-mlt\lzma.exe.rsp"

But that is obviously not how things are passed around. So it seems we do
need the first option [ using clang-win : : "C:\\Program
Files\\LLVM\\bin\\clang-cl.exe" "-fuse-ld=lld" : ... ; ] in order for all
things to work, unfortunately that is not (yet) accepted by b2.

We are getting there, but not fully, yet.

degski

-- 
*“If something cannot go on forever, it will stop" - Herbert Stein*

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk