(original) (raw)
If you want to bootstrap clang and lld using itself, then you should pass -DCMAKE\_C\_COMPILER=path/to/clang-cl.exe -DCMAKE\_CXX\_COMPILER=path/to/clang-cl.exe -DCMAKE\_LINKER=path/to/lld-link.exe.
Note the clang-cl.exe. \*\*\*Not\*\*\* clang.exe or clang++.exe.
On Wed, Dec 12, 2018 at 7:37 AM Zachary Turner <zturner@google.com> wrote:
You shouldn't need zlib to build. I think we discussed in a previous thread that the only components you should need to complete a build are Microsoft Visual Studio, git, and CMake.On Wed, Dec 12, 2018 at 7:14 AM Osman Zakir via llvm-dev <llvm-dev@lists.llvm.org> wrote:How can I tell CMake during the configuration step where to find my zlib installation?
From: blubee blubeeme <gurenchan@gmail.com>
Sent: Wednesday, December 12, 2018 7:31 PM
To: Osman Zakir
Cc: llvm-dev
Subject: Re: \[llvm-dev\] Using LLD to link against third-party libraries? How?I would agree with the next email fromBrian Cain
If you do not have specific reason to want to use llvm lld try to use your system provided c++ linker.
Bootstrapping the llvm c++ c++abi can be troublesome on Unix like platforms and I have no experience doing anything like that on windows.
If you already have a c++ toochain and still want to attempt this then you'll need to svn checkout or git clone a version of the llvm toolchain and build it with your native toolchain then switch to using clang and lld.
if you do not have a native c++ toolchain; let's cross that bridge only if you need to.
A complete LLVM toolchain includesllvmclangclang-extra-toolslldlldbpollycompiler-rtopenmplibcxxlibcxx-abitestsuiteThere's "Getting Started Quickly (A Summary" : https://llvm.org/docs/GettingStarted.html
With steps to build a complete toolchain. Compilation could take a long time.
It would be simpler to use your native c++ and linker unless they do not provide c++17 in which case the above link can get you started.
Best
On Wed, Dec 12, 2018 at 8:57 PM Osman Zakir <osmanzakir90@hotmail.com> wrote:
So how do I get it to build libcxx and libcxxabi? I got it from the mono repo and enabled lld, clang, libcxx and libcxxabi. But I built the two main CMake targets only--all\_build and install. What else do I have to do? Please let me know.
From: Zachary Turner <zturner@google.com>
Sent: Wednesday, December 12, 2018 11:10 AM
To: blubee blubeeme
Cc: Osman Zakir; David Greene; llvm-dev@lists.llvm.org
Subject: Re: \[llvm-dev\] Using LLD to link against third-party libraries? How?I see you’re using lld-link, so we’re talking about Windows here.
Have you gotten it working with the Microsoft linker? Because if so, just replace link.exe with lld-link.exe and it will work.
Btw, it’s a bit odd to use clang++ on Windows. The recommended workflow is to use clang-cl. It’s possible to use clang++, but you’re just setting yourself up for more difficulty
On Tue, Dec 11, 2018 at 7:23 PM blubee blubeeme via llvm-dev <llvm-dev@lists.llvm.org> wrote:
I couldn't get it to build libcxx...You need c++ and c++abi to compile c++ code.\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
On Wed, Dec 12, 2018, 07:01 Osman Zakir via llvm-dev <llvm-dev@lists.llvm.org> wrote:
LLVM on a Developer Command Prompt. The ones I want to fix first are the ones from Boost and Jinja2Cpp. I saw some from those as well.
If there any standard library ones missing, could it be because I couldn't get it to build libcxx? I did try to include that, but it seems to be missing. What should I do?
From: David Greene <dag@cray.com>
Sent: Wednesday, December 12, 2018 3:30 AM
To: Osman Zakir
Cc: blubee blubeeme; llvm-dev@lists.llvm.org\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
Subject: Re: \[llvm-dev\] Using LLD to link against third-party libraries? How?Are you linking with a C++ compiler? A lot of those missing symbols
look like they come from the C++ standard library.
\-David
Osman Zakir via llvm-dev <llvm-dev@lists.llvm.org> writes:
\> @blubee blubeeme So what do you think? Got any ideas?
\> ----------------------------------------------------------------------
\> From: Osman Zakir <osmanzakir90@hotmail.com>
\> Sent: Wednesday, December 12, 2018 1:43 AM
\> To: llvm-dev@lists.llvm.org
\> Subject: Re: \[llvm-dev\] Using LLD to link against third-party
\> libraries? How?
\> In my code here https://github.com/DragonOsman/currency\_converter , I
\> used C++17 and managed to get it to work (though I'm only using
\> std::map::insert\_or\_assign() from C++17). And I'm using Windows, so I
\> shouldn't use LDFLAGS or CXXFLAGS as environment variables. I'll use
\> them directly on the compiler command line instead. The libraries I
\> need to link against are
\> C:/boost\_1\_68\_0/stage/lib/libboost\_system-vc141-mt-x64-1\_68.lib and
\> C:/Jinja2Cpp/install\_x64/lib/static/jinja2cpp.lib.
\>
\> I tried to build it with this flag:
\> "
\> clang++ -std=c++17 -Wall -pedantic -
\> D\_SILENCE\_CXX17\_ADAPTOR\_TYPEDEFS\_DEPRECATION\_WARNING -
\> Dvariant\_CONFIG\_SELECT\_VARIANT=variant\_VARIANT\_NONSTD -
\> D\_SILENCE\_CXX17\_ALLOCATOR\_VOID\_DEPRECATION\_WARNING -
\> D\_CRT\_SECURE\_NO\_WARNINGS -D\_WINSOCK\_DEPRECATED\_NO\_WARNINGS -D\_WIN32 -
\> D\_WIN32\_WINDOWS -D\_NDEBUG -fexceptions -
\> IC:/Jinja2Cpp/install\_x64/include -IC:/json/single\_include -
\> IC:/boost\_1\_68\_0 -
\> LC:/boost\_1\_68\_0/stage/lib/libboost\_system-vc141-mt-x64-1\_68.lib -
\> LC:/Jinja2Cpp/install\_x64/lib/static/jinja2cpp.lib
\> currency\_converter.cpp -o currency\_converter.exe
\> "
\> And I got these warnings and errors from LLD:
\>
\> "
\> lld-link: warning:
\> C:\\Users\\Osman\\AppData\\Local\\Temp\\currency\_converter-264ae1.o: locally
\> defined symbol imported: \_\_std\_terminate (defined in libvcruntime.lib
\> (ehhelpers.obj)) \[LNK4217\]
\> lld-link: error: undefined symbol: "public: \_\_cdecl
\> jinja2::Template::Template(class jinja2::TemplateEnv \*)"
\> (??0Template@jinja2@@QEAA@PEAVTemplateEnv@1@@Z)
\>>>> referenced by
\> C:\\Users\\Osman\\AppData\\Local\\Temp\\currency\_converter-264ae1.o:("void \_
\> \_cdecl handle\_request \> boost::beast::http::basic\_string\_body \> std::char\_traits, class std::allocator>, class
\> std::allocator, struct server\_session::send\_lambda &>(class
\> boost::basic\_string\_view>, struct
\> boost::beast::http::message<1, struct
\> boost::beast::http::basic\_string\_body \> std::char\_traits, class std::allocator>, class
\> boost::beast::http::basic\_fields>> &&,
\> struct server\_session::send\_lambda &, char const \*, char const \*)"
\> (??$handle\_request@U?$basic\_string\_body@DU?$char\_traits@D@std@@V?$allocator@D@2@@http@beast@boost@@V?
\> allocator@D@std@@AEAUsend_lambda@server_session@@@@YAXV?allocator@D@std@@AEAUsend\_lambda@server\_session@@@@YAXV?allocator@D@std@@AEAUsend_lambda@server_session@@@@YAXV?basic\_string\_
\> view@DU?$char\_traits@D@std@@@boost@@$$QEAU?$message@$00U?$basic\_string\_
\> body@DU?$char\_traits@D@std@@V?$allocator@D@2@@http@beast@boost@@V?$basic\_
\> fields@V?$allocator@D@std@@@234@@http@beast@1@AEAUsend\_lambda@server\_session@@PEBD3@Z)
\> )
\>
\> lld-link: error: undefined symbol: "public: class
\> nonstd::expected\_lite::expected \> jinja2::ErrorInfoTpl> \_\_cdecl jinja2::Template::LoadFromFile
\> (class std::basic\_string, class
\> std::allocator> const &)"
\> (?LoadFromFile@Template@jinja2@@QEAA?AV?$expected@XV?$ErrorInfoTpl@D@jinja2@@@expected\_
\> lite@nonstd@@AEBV?$basic\_string@DU?$char\_traits@D@std@@V?$allocator@D@2@@std@@@Z)
\>
\>>>> referenced by
\> C:\\Users\\Osman\\AppData\\Local\\Temp\\currency\_converter-264ae1.o:("void \_
\> \_cdecl handle\_request \> boost::beast::http::basic\_string\_body \> std::char\_traits, class std::allocator>, class
\> std::allocator, struct server\_session::send\_lambda &>(class
\> boost::basic\_string\_view>, struct
\> boost::beast::http::message<1, struct
\> boost::beast::http::basic\_string\_body \> std::char\_traits, class std::allocator>, class
\> boost::beast::http::basic\_fields>> &&,
\> struct server\_session::send\_lambda &, char const \*, char const \*)"
\> (??$handle\_request@U?$basic\_string\_body@DU?$char\_traits@D@std@@V?$allocator@D@2@@http@beast@boost@@V?
\> allocator@D@std@@AEAUsend_lambda@server_session@@@@YAXV?allocator@D@std@@AEAUsend\_lambda@server\_session@@@@YAXV?allocator@D@std@@AEAUsend_lambda@server_session@@@@YAXV?basic\_string\_
\> view@DU?$char\_traits@D@std@@@boost@@$$QEAU?$message@$00U?$basic\_string\_
\> body@DU?$char\_traits@D@std@@V?$allocator@D@2@@http@beast@boost@@V?$basic\_
\> fields@V?$allocator@D@std@@@234@@http@beast@1@AEAUsend\_lambda@server\_session@@PEBD3@Z)
\> )
\>
\> lld-link: error: undefined symbol: "public: class
\> std::basic\_string, class
\> std::allocator> \_\_cdecl jinja2::Template::RenderAsString(class
\> std::unordered\_map \> std::char\_traits, class std::allocator>, class
\> jinja2::Value, struct std::hash \> std::char\_traits, class std::allocator>>, struct
\> std::equal\_to \> std::char\_traits, class std::allocator>>, class
\> std::allocator \> std::char\_traits, class std::allocator> const, class
\> jinja2::Value>>> const &)"
\> (?RenderAsString@Template@jinja2@@QEAA?AV?$basic\_string@DU?$char\_traits@D@std@@V?
\> allocator@D@2@@std@@AEBV?allocator@D@2@@std@@AEBV?allocator@D@2@@std@@AEBV?unordered\_map@V?$basic\_string@DU?$char\_traits@D@std@@V?
\> allocator@D@2@@std@@VValue@jinja2@@U?allocator@D@2@@std@@VValue@jinja2@@U?allocator@D@2@@std@@VValue@jinja2@@U?hash@V?$basic\_string@DU?$char\_traits@D@std@@V?
\> allocator@D@2@@std@@@2@U?allocator@D@2@@std@@@2@U?allocator@D@2@@std@@@2@U?equal\_to@V?$basic\_string@DU?$char\_traits@D@std@@V?
\> allocator@D@2@@std@@@2@V?allocator@D@2@@std@@@2@V?allocator@D@2@@std@@@2@V?allocator@U?$pair@$$CBV?$basic\_string@DU?$char\_
\> traits@D@std@@V?$allocator@D@2@@std@@VValue@jinja2@@@std@@@2@@4@@Z)
\>>>> referenced by
\> C:\\Users\\Osman\\AppData\\Local\\Temp\\currency\_converter-264ae1.o:("void \_
\> \_cdecl handle\_request \> boost::beast::http::basic\_string\_body \> std::char\_traits, class std::allocator>, class
\> std::allocator, struct server\_session::send\_lambda &>(class
\> boost::basic\_string\_view>, struct
\> boost::beast::http::message<1, struct
\> boost::beast::http::basic\_string\_body \> std::char\_traits, class std::allocator>, class
\> boost::beast::http::basic\_fields>> &&,
\> struct server\_session::send\_lambda &, char const \*, char const \*)"
\> (??$handle\_request@U?$basic\_string\_body@DU?$char\_traits@D@std@@V?$allocator@D@2@@http@beast@boost@@V?
\> allocator@D@std@@AEAUsend_lambda@server_session@@@@YAXV?allocator@D@std@@AEAUsend\_lambda@server\_session@@@@YAXV?allocator@D@std@@AEAUsend_lambda@server_session@@@@YAXV?basic\_string\_
\> view@DU?$char\_traits@D@std@@@boost@@$$QEAU?$message@$00U?$basic\_string\_
\> body@DU?$char\_traits@D@std@@V?$allocator@D@2@@http@beast@boost@@V?$basic\_
\> fields@V?$allocator@D@std@@@234@@http@beast@1@AEAUsend\_lambda@server\_session@@PEBD3@Z)
\> )
\>>>> referenced by
\> C:\\Users\\Osman\\AppData\\Local\\Temp\\currency\_converter-264ae1.o:("void \_
\> \_cdecl handle\_request \> boost::beast::http::basic\_string\_body \> std::char\_traits, class std::allocator>, class
\> std::allocator, struct server\_session::send\_lambda &>(class
\> boost::basic\_string\_view>, struct
\> boost::beast::http::message<1, struct
\> boost::beast::http::basic\_string\_body \> std::char\_traits, class std::allocator>, class
\> boost::beast::http::basic\_fields>> &&,
\> struct server\_session::send\_lambda &, char const \*, char const \*)"
\> (??$handle\_request@U?$basic\_string\_body@DU?$char\_traits@D@std@@V?$allocator@D@2@@http@beast@boost@@V?
\> allocator@D@std@@AEAUsend_lambda@server_session@@@@YAXV?allocator@D@std@@AEAUsend\_lambda@server\_session@@@@YAXV?allocator@D@std@@AEAUsend_lambda@server_session@@@@YAXV?basic\_string\_
\> view@DU?$char\_traits@D@std@@@boost@@$$QEAU?$message@$00U?$basic\_string\_
\> body@DU?$char\_traits@D@std@@V?$allocator@D@2@@http@beast@boost@@V?$basic\_
\> fields@V?$allocator@D@std@@@234@@http@beast@1@AEAUsend\_lambda@server\_session@@PEBD3@Z)
\> )
\>
\> lld-link: error: undefined symbol: "public: \_\_cdecl
\> jinja2::Template::\~Template(void)" (??1Template@jinja2@@QEAA@XZ)
\>>>> referenced by
\> C:\\Users\\Osman\\AppData\\Local\\Temp\\currency\_converter-264ae1.o:("void \_
\> \_cdecl handle\_request \> boost::beast::http::basic\_string\_body \> std::char\_traits, class std::allocator>, class
\> std::allocator, struct server\_session::send\_lambda &>(class
\> boost::basic\_string\_view>, struct
\> boost::beast::http::message<1, struct
\> boost::beast::http::basic\_string\_body \> std::char\_traits, class std::allocator>, class
\> boost::beast::http::basic\_fields>> &&,
\> struct server\_session::send\_lambda &, char const \*, char const \*)"
\> (??$handle\_request@U?$basic\_string\_body@DU?$char\_traits@D@std@@V?$allocator@D@2@@http@beast@boost@@V?
\> allocator@D@std@@AEAUsend_lambda@server_session@@@@YAXV?allocator@D@std@@AEAUsend\_lambda@server\_session@@@@YAXV?allocator@D@std@@AEAUsend_lambda@server_session@@@@YAXV?basic\_string\_
\> view@DU?$char\_traits@D@std@@@boost@@$$QEAU?$message@$00U?$basic\_string\_
\> body@DU?$char\_traits@D@std@@V?$allocator@D@2@@http@beast@boost@@V?$basic\_
\> fields@V?$allocator@D@std@@@234@@http@beast@1@AEAUsend\_lambda@server\_session@@PEBD3@Z)
\> )
\>>>> referenced by
\> C:\\Users\\Osman\\AppData\\Local\\Temp\\currency\_converter-264ae1.o:("int
\> \`void \_\_cdecl handle\_request \> boost::beast::http::basic\_string\_body \> std::char\_traits, class std::allocator>, class
\> std::allocator, struct server\_session::send\_lambda &>(class
\> boost::basic\_string\_view>, struct
\> basic\_string\_view \> std::char\_traits>::beast::http::message<1, struct
\> boost::beast::http::basic\_string\_body \> std::char\_traits, class std::allocator>, class
\> boost::beast::http::basic\_fields>> &&,
\> struct server\_session::send\_lambda &, char const \*, char const \*)'::
\> \`1'::dtor$114"
\> (?dtor$114@?0???$handle\_request@U?$basic\_string\_body@DU?$char\_traits@D@std@@V?
\> allocator@D@2@@http@beast@boost@@V?allocator@D@2@@http@beast@boost@@V?allocator@D@2@@http@beast@boost@@V?allocator@D@std@@AEAUsend\_lambda@server\_
\> session@@@@YAXV?$basic\_string\_view@DU?$char\_traits@D@std@@@boost@@$$QEAU?
\> message@message@message@00U?$basic\_string\_body@DU?$char\_traits@D@std@@V?$allocator@D@2@@http@beast@boost@@V?
\> basic_fields@V?basic\_fields@V?basic_fields@V?allocator@D@std@@@234@@http@beast@1@AEAUsend\_lambda@server\_
\> session@@PEBD3@Z@4HA))
\>
\> lld-link: warning:
\> C:\\Users\\Osman\\AppData\\Local\\Temp\\currency\_converter-264ae1.o: locally
\> defined symbol imported: \_CxxThrowException (defined in
\> libvcruntime.lib(throw.obj)) \[LNK4217\]
\> lld-link: error: undefined symbol: "class
\> boost::system::error\_category const & \_\_cdecl
\> boost::system::detail::system\_category\_ncx(void)"
\> (?system\_category\_ncx@detail@system@boost@@YAAEBVerror\_category@23@XZ)
\>>>> referenced by
\> C:\\Users\\Osman\\AppData\\Local\\Temp\\currency\_converter-264ae1.o:("class
\> boost::system::error\_category const & \_\_cdecl
\> boost::system::system\_category(void)"
\> (?system\_category@system@boost@@YAAEBVerror\_category@12@XZ))
\>
\> lld-link: warning:
\> C:\\Users\\Osman\\AppData\\Local\\Temp\\currency\_converter-264ae1.o: locally
\> defined symbol imported: \_\_RTDynamicCast (defined in libvcruntime.lib
\> (rtti.obj)) \[LNK4217\]
\> lld-link: error: undefined symbol: "class
\> boost::system::error\_category const & \_\_cdecl
\> boost::system::detail::generic\_category\_ncx(void)"
\> (?generic\_category\_ncx@detail@system@boost@@YAAEBVerror\_category@23@XZ)
\>
\>>>> referenced by
\> C:\\Users\\Osman\\AppData\\Local\\Temp\\currency\_converter-264ae1.o:("class
\> boost::system::error\_category const & \_\_cdecl
\> boost::system::generic\_category(void)"
\> (?generic\_category@system@boost@@YAAEBVerror\_category@12@XZ))
\> clang++: error: linker command failed with exit code 1 (use -v to see
\> invocation)
\> "
\>
\>
\> \* GitHub - DragonOsman/currency\_converter: Application for Computer
\> Science course
\> Google Maps + Currency Converter Web Application. Application for
\> Computer Science course. This is a currency converter web
\> application with the frontend and a backend.
\> github.com
\>
\> \*
\>
\>
\> \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
\> LLVM Developers mailing list
\> llvm-dev@lists.llvm.org
\> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
LLVM Developers mailing list
llvm-dev@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
LLVM Developers mailing list
llvm-dev@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
_______________________________________________
LLVM Developers mailing list
llvm-dev@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev