[build2] Using build2 with clang 6 (trunk) on windows

Username I Wanted Was Already Taken usernameiwantedwasalreadytaken at gmail.com
Mon Dec 11 11:17:46 UTC 2017


Everything worked. Thanks.

And here are the tests:

C:\Tests\Build2\hello\clang-6>b
c++ ../hello/cxx{hello}
ld exe{hello}
hello.exe.obj : warning LNK4217: locally defined symbol __std_terminate
imported in function "int `public: static unsigned __int64 __cdecl
std::char_traits<char>::length(char const * const)'::`1'::dtor$2" (?dtor$2@
?0??length@?$char_traits at D@std@@SA_KQEBD at Z@4HA)
hello.exe.obj : warning LNK4217: locally defined symbol _CxxThrowException
imported in function "public: void __cdecl std::ios_base::clear(int,bool)"
(?clear at ios_base@std@@QEAAXH_N at Z)

C:\Tests\Build2\hello\clang-6>hello
Hello

C:\Tests\Build2\hello\clang-6>b clean
rm exe{hello}
rm obje{hello}

C:\Tests\Build2\hello\clang-6>b config.cc.poptions=-D_DLL ^
Mais? config.cc.coptions=-nostdlib ^
Mais? config.cc.loptions=/DEFAULTLIB:msvcrt.lib
c++ ../hello/cxx{hello}
ld exe{hello}
LINK : warning LNK4098: defaultlib 'libcmt.lib' conflicts with use of other
libs; use /NODEFAULTLIB:library

C:\Tests\Build2\hello\clang-6>hello
Hello

On Fri, Dec 8, 2017 at 3:18 PM, Boris Kolpackov <boris at codesynthesis.com>
wrote:

> Username I Wanted Was Already Taken <usernameiwantedwasalreadytake
> n at gmail.com> writes:
>
> > [...] -defaultlib:libcmt
>
> Ok, that's the missing piece. I've fixed and staged the new version,
> can you give it a try?
>
> If it works, just for interest's sake can you try the shared runtime
> build:
>
> b config.cc.poptions=-D_DLL    ^
>   config.cc.coptions=-nostdlib ^
>   config.cc.loptions=/DEFAULTLIB:msvcrt.lib
>
> The idea taken from here:
>
> https://stackoverflow.com/questions/41850296/link-
> dynamic-c-runtime-with-clang-windows
>
>
> > By the way, those "locally defined symbol" warnings are referenced here:
> > https://stackoverflow.com/questions/42545078/clang-
> version-5-and-lnk4217-warning
>
> That looks like Clang's issue (if that option is the correct fix then
> Clang should be adding it by default). You may want to submit a bug
> report at bugs.llvm.org.
>
> Thanks,
> Boris
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.build2.org/archives/users/attachments/20171211/0005a2ec/attachment.html>


More information about the users mailing list