<div dir="ltr">Hi, and sorry for the delay.<div><br></div><div><span style="font-size:12.8px">> I've staged a new version that should fix this. Can you give it a try</span><br style="font-size:12.8px"><span style="font-size:12.8px">> and send the -V output?</span><br></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Ok. Updated build2, now I'm getting a lot of linker errors (see hello.log).</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">> If everything looks good then can you also try building a library,</span><br style="font-size:12.8px"><span style="font-size:12.8px">> something along these lines:</span><br style="font-size:12.8px"><br style="font-size:12.8px"><span style="font-size:12.8px">> exe{hello}: cxx{driver} lib{hello}</span><br style="font-size:12.8px"><span style="font-size:12.8px">> lib{hello}: cxx{hello}</span><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Well, I tried building a library anyways and get the linker errors too:</span></div><div><span style="font-size:12.8px"><br></span></div><div><div><span style="font-size:12.8px">C:\Tests\Build2\libhello\msvc-17>b</span></div><div><span style="font-size:12.8px">c++ ../hello/cxx{driver}</span></div><div><span style="font-size:12.8px">c++ ../hello/cxx{hello}</span></div><div><span style="font-size:12.8px">ld liba{hello}</span></div><div><span style="font-size:12.8px">ld exe{hello}</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">C:\Tests\Build2\libhello\msvc-17>cd ..\clang-6</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">C:\Tests\Build2\libhello\clang-6>b</span></div><div><span style="font-size:12.8px">c++ ../hello/cxx{driver}</span></div><div><span style="font-size:12.8px">c++ ../hello/cxx{hello}</span></div><div><span style="font-size:12.8px">ld liba{hello}</span></div><div><span style="font-size:12.8px">ld exe{hello}</span></div><div><span style="font-size:12.8px">LINK : error LNK2001: unresolved external symbol mainCRTStartup</span></div><div><span style="font-size:12.8px">hello.lib(hello.lib.obj) : error LNK2019: unresolved external symbol __acrt_iob_func referenced in function printf</span></div><div><span style="font-size:12.8px">hello.lib(hello.lib.obj) : error LNK2019: unresolved external symbol __stdio_common_vfprintf referenced in function _vfprintf_l</span></div><div><span style="font-size:12.8px">hello.exe : fatal error LNK1120: 3 unresolved externals</span></div><div><span style="font-size:12.8px">info: failed to update dir{.\}</span></div><div style="font-size:12.8px"><br></div></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">Now here there are less linker errors, but I think this is because in this project I'm using printf instead of std::cout to output the message. <span style="font-size:12.8px">The full log is in libhello.log. It was generated by the following commands:</span></div><div style="font-size:12.8px"><br></div><div><div><span style="font-size:12.8px">C:\Tests\Build2\libhello\clang-6>b -V 2> libhello.log</span></div><div><span style="font-size:12.8px">C:\Tests\Build2\libhello\clang-6>b config.bin.lib=static -V 2>> libhello.log</span><br></div><div><span style="font-size:12.8px">C:\Tests\Build2\libhello\clang-6>b config.bin.lib=shared -V 2>> libhello.log</span><br></div></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"><br></div><div><span style="font-size:12.8px">> </span><span style="font-size:12.8px">Do you know if the 5.0 release is usable/stable for this target?</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">I just tested the 5.0 release, and I get the same linker errors.</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">> </span><span style="font-size:12.8px">I've written to cfe-dev </span><span style="font-size:12.8px">to see if they will be willing to fix this:</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Ok.</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Regards,</span></div><div><span style="font-size:12.8px">Jack</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px"><br></span></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Dec 6, 2017 at 8:01 AM, Boris Kolpackov <span dir="ltr"><<a href="mailto:boris@codesynthesis.com" target="_blank">boris@codesynthesis.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Username I Wanted Was Already Taken <<a href="mailto:usernameiwantedwasalreadytaken@gmail.com">usernameiwantedwasalreadytake<wbr>n@gmail.com</a>> writes:<br>
<br>
> clang++ -o hello hello.exe.obj<br>
<br>
Ok, this isn't right. There should be the .exe extension and we should<br>
be using link.exe directly.<br>
<br>
I've staged a new version that should fix this. Can you give it a try<br>
and send the -V output?<br>
<br>
If everything looks good then can you also try building a library,<br>
something along these lines:<br>
<br>
exe{hello}: cxx{driver} lib{hello}<br>
lib{hello}: cxx{hello}<br>
<br>
And then try both static and shared:<br>
<br>
b config.bin.lib=static -V<br>
b config.bin.lib=shared -V<br>
<br>
<br>
> Those linker warnings are a Clang bug, I think. I've updated the LLVM trunk<br>
> and those warnings now appear even if I compile a simple hello world<br>
> directly with clang.<br>
<br>
Yes, and that's the reason I am reluctant to make a CI machine for this<br>
configuration -- half of the time I will be investigating Clang bugs.<br>
Do you know if the 5.0 release is usable/stable for this target?<br>
<br>
<br>
> clang++.exe -cc1 -triple x86_64-pc-windows-msvc19.11.<wbr>25547<br>
<br>
Interesting. So they do know the compiler version and internally<br>
even slap it onto the target triplet (which is the wrong thing to<br>
do IMO; it should be the runtime version). But for some reason<br>
they omit it from the -dumpmachine output. I've written to cfe-dev<br>
to see if they will be willing to fix this:<br>
<br>
<a href="http://lists.llvm.org/pipermail/cfe-dev/2017-December/056240.html" rel="noreferrer" target="_blank">http://lists.llvm.org/<wbr>pipermail/cfe-dev/2017-<wbr>December/056240.html</a><br>
<span class="HOEnZb"><font color="#888888"><br>
Boris<br>
</font></span></blockquote></div><br></div>