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

Username I Wanted Was Already Taken usernameiwantedwasalreadytaken at gmail.com
Thu Dec 7 15:36:38 UTC 2017


> clang++.exe -v -o hello.exe hello.cxx

Ok. Running with clang 6 (trunk):

C:\Tests\Build2\hello\hello>clang++.exe -v -o hello.exe hello.cxx
clang version 6.0.0 (https://llvm.org/git/clang.git
9dec99fdb04cb694bdaa3ee12e0796bdb7f2a781) (https://llvm.org/git/llvm.git
30bcf2f789213e1c6dfc18bd5b3af90630e94eca)
Target: x86_64-pc-windows-msvc
Thread model: posix
InstalledDir: C:\LLVM\build\bin
 "C:\\LLVM\\build\\bin\\clang++.exe" -cc1 -triple
x86_64-pc-windows-msvc19.11.25547 -emit-obj -mrelax-all
-mincremental-linker-compatible -disable-free -disable-llvm-verifier
-discard-value-names -main-file-name hello.cxx -mrelocation-model pic
-pic-level 2 -mthread-model posix -fmath-errno -masm-verbose
-mconstructor-aliases -munwind-tables -target-cpu x86-64 -dwarf-column-info
-debugger-tuning=gdb -momit-leaf-frame-pointer -v -resource-dir
"C:\\LLVM\\build\\lib\\clang\\6.0.0" -internal-isystem
"C:\\LLVM\\build\\lib\\clang\\6.0.0\\include" -internal-isystem
"C:\\Program Files (x86)\\Microsoft Visual
Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.11.25503\\ATLMFC\\include"
-internal-isystem "C:\\Program Files (x86)\\Microsoft Visual
Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.11.25503\\include"
-internal-isystem "C:\\Program Files (x86)\\Windows
Kits\\NETFXSDK\\4.6.1\\include\\um" -internal-isystem "C:\\Program Files
(x86)\\Windows Kits\\10\\include\\10.0.16299.0\\ucrt" -internal-isystem
"C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.16299.0\\shared"
-internal-isystem "C:\\Program Files (x86)\\Windows
Kits\\10\\include\\10.0.16299.0\\um" -internal-isystem "C:\\Program Files
(x86)\\Windows Kits\\10\\include\\10.0.16299.0\\winrt" -fdeprecated-macro
-fdebug-compilation-dir "C:\\Tests\\Build2\\hello\\hello" -ferror-limit 19
-fmessage-length 81 -fno-use-cxa-atexit -fms-extensions -fms-compatibility
-fms-compatibility-version=19.11.25547 -std=c++14
-fdelayed-template-parsing -fobjc-runtime=gcc -fcxx-exceptions -fexceptions
-fseh-exceptions -fdiagnostics-show-option -fcolor-diagnostics -o
"C:\\Users\\username\\AppData\\Local\\Temp\\hello-174fb1.o" -x c++ hello.cxx
clang -cc1 version 6.0.0 based upon LLVM 6.0.0svn default target
x86_64-pc-windows-msvc
#include "..." search starts here:
#include <...> search starts here:
 C:\LLVM\build\lib\clang\6.0.0\include
 C:\Program Files (x86)\Microsoft Visual
Studio\2017\Community\VC\Tools\MSVC\14.11.25503\ATLMFC\include
 C:\Program Files (x86)\Microsoft Visual
Studio\2017\Community\VC\Tools\MSVC\14.11.25503\include
 C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um
 C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\ucrt
 C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\shared
 C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\um
 C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\winrt
End of search list.
 "C:\\Program Files (x86)\\Microsoft Visual
Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.11.25503\\bin\\HostX64\\x64\\link.exe"
-out:hello.exe -defaultlib:libcmt -nologo
"C:\\Users\\username\\AppData\\Local\\Temp\\hello-174fb1.o"
hello-174fb1.o : 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-174fb1.o : 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)



Running with clang 5:

C:\Tests\Build2\hello\hello>clang++.exe -v -o hello.exe hello.cxx
clang version 5.0.0 (tags/RELEASE_500/final)
Target: x86_64-pc-windows-msvc
Thread model: posix
InstalledDir: C:\LLVM5\bin
 "C:\\LLVM5\\bin\\clang++.exe" -cc1 -triple
x86_64-pc-windows-msvc19.11.25547 -emit-obj -mrelax-all
-mincremental-linker-compatible -disable-free -disable-llvm-verifier
-discard-value-names -main-file-name hello.cxx -mrelocation-model pic
-pic-level 2 -mthread-model posix -fmath-errno -masm-verbose
-mconstructor-aliases -munwind-tables -target-cpu x86-64
-momit-leaf-frame-pointer -v -dwarf-column-info -debugger-tuning=gdb
-resource-dir "C:\\LLVM5\\lib\\clang\\5.0.0" -internal-isystem
"C:\\LLVM5\\lib\\clang\\5.0.0\\include" -internal-isystem "C:\\Program
Files (x86)\\Microsoft Visual
Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.11.25503\\ATLMFC\\include"
-internal-isystem "C:\\Program Files (x86)\\Microsoft Visual
Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.11.25503\\include"
-internal-isystem "C:\\Program Files (x86)\\Windows
Kits\\NETFXSDK\\4.6.1\\include\\um" -internal-isystem "C:\\Program Files
(x86)\\Windows Kits\\10\\include\\10.0.16299.0\\ucrt" -internal-isystem
"C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.16299.0\\shared"
-internal-isystem "C:\\Program Files (x86)\\Windows
Kits\\10\\include\\10.0.16299.0\\um" -internal-isystem "C:\\Program Files
(x86)\\Windows Kits\\10\\include\\10.0.16299.0\\winrt" -fdeprecated-macro
-fdebug-compilation-dir "C:\\Tests\\Build2\\hello\\hello" -ferror-limit 19
-fmessage-length 81 -fms-extensions -fms-compatibility
-fms-compatibility-version=19.11.25547 -std=c++14
-fdelayed-template-parsing -fobjc-runtime=gcc -fcxx-exceptions -fexceptions
-fdiagnostics-show-option -fcolor-diagnostics -o
"C:\\Users\\username\\AppData\\Local\\Temp\\hello-e0a0f7.o" -x c++ hello.cxx
clang -cc1 version 5.0.0 based upon LLVM 5.0.0 default target
x86_64-pc-windows-msvc
#include "..." search starts here:
#include <...> search starts here:
 C:\LLVM5\lib\clang\5.0.0\include
 C:\Program Files (x86)\Microsoft Visual
Studio\2017\Community\VC\Tools\MSVC\14.11.25503\ATLMFC\include
 C:\Program Files (x86)\Microsoft Visual
Studio\2017\Community\VC\Tools\MSVC\14.11.25503\include
 C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um
 C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\ucrt
 C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\shared
 C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\um
 C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\winrt
End of search list.
 "C:\\Program Files (x86)\\Microsoft Visual
Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.11.25503\\bin\\HostX64\\x64\\link.exe"
-out:hello.exe -defaultlib:libcmt -nologo
"C:\\Users\\username\\AppData\\Local\\Temp\\hello-e0a0f7.o"
hello-e0a0f7.o : 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-e0a0f7.o : 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)


By the way, those "locally defined symbol" warnings are referenced here:
https://stackoverflow.com/questions/42545078/clang-version-5-and-lnk4217-warning


Regards,
Jack


On Thu, Dec 7, 2017 at 10:41 AM, Boris Kolpackov <boris at codesynthesis.com>
wrote:

> Username I Wanted Was Already Taken <usernameiwantedwasalreadytake
> n at gmail.com> writes:
>
> > ld exe{hello}
> > LINK : error LNK2001: unresolved external symbol mainCRTStartup
> > hello.lib(hello.lib.obj) : error LNK2019: unresolved external symbol
> > __acrt_iob_func referenced in function printf
> > hello.lib(hello.lib.obj) : error LNK2019: unresolved external symbol
> > __stdio_common_vfprintf referenced in function _vfprintf_l
>
> Thanks for the logs. Looks like we are almost there. It seems Clang
> is linking in something extra (compared to VC). Could you run this
> and send the output:
>
> clang++.exe -v -o hello.exe hello.cxx
>
> Thanks,
> Boris
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.build2.org/archives/users/attachments/20171207/4b1557e1/attachment-0001.html>


More information about the users mailing list