<div dir="ltr">Both MSVC and mingw should support static linking. Hans's release script uses the /MT compiler flag to do it for MSVC. For mingw, you need to pass a flag like -static, -static-libstdc++, or -static-libgcc. I don't use mingw so I couldn't say which actually does the job.</div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Sep 7, 2015 at 8:12 PM, Edward Diener via cfe-dev <span dir="ltr"><<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 9/7/2015 10:21 PM, Nikola Smiljanic via cfe-dev wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Yes, you can use ninja with VC++, it just replaces MSBuild.<br>
</blockquote>
<br></span>
Thanks ! Never realized that.<br>
<br>
1) Building clang with VC++11 ( VS2012 ) has no dependencies on any compiler DLLs.<br>
2) Building clang with mingw-64/gcc has dependencies on the libstdc++ DLL and whatever DLL represents the mingw-64/gcc exception model.<br>
<br>
Why is this ?<br>
<br>
I see these LLVM variablles in the build script:<br>
<br>
LLVM_ENABLE_ASSERTIONS<br>
LLVM_INSTALL_TOOLCHAIN_ONLY<br>
LLVM_USE_CRT_RELEASE<br>
LLVM_DEFAULT_TARGET_TRIPLE<br>
<br>
There is no documentation on the 'Building LLVM with CMake' page ( <a href="http://llvm.org/docs/CMake.html" rel="noreferrer" target="_blank">http://llvm.org/docs/CMake.html</a> page ) for the last three. Do any of these remove compiler DLL dependencies ? Seems doubtful.<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
<br>
On Tue, Sep 8, 2015 at 9:28 AM, Edward Diener via cfe-dev<br>
<<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br></span><span class="">
<mailto:<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>>> wrote:<br>
<br>
On 9/6/2015 9:46 PM, Nikola Smiljanic via cfe-dev wrote:<br>
<br>
Here's the script +Hans uses to build so you can compare.<br>
<br>
<br>
This script suggests that it is building clang using Visual Studio<br>
2012. But it is using Ninja as the CMake generator so I am confused<br>
by what is happening here. Can anybody clarify what is being used to<br>
build clang in the script being presented to me ?<br>
<br>
<br>
On Mon, Sep 7, 2015 at 11:33 AM, Edward Diener via cfe-dev<br>
<<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
<mailto:<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>><br></span>
<mailto:<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><div><div class="h5"><br>
<mailto:<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>>>> wrote:<br>
<br>
If I look at pre-built version of clang for Windows I<br>
notice that<br>
there are no dependencies on any C++ implementation DLLs<br>
but only on<br>
the common lower level Windows DLLs kernel32.dll,<br>
shell32.dll, and<br>
advapi32.dll, which are all in the windows/system32<br>
directory. This<br>
appears pretty nice.<br>
<br>
If I build clang from source using some version of<br>
mingw-64/gcc as<br>
the compiler and CMake/Ninja as the build system I end up<br>
with a<br>
clang which has dependencies on the above mentioned lower level<br>
Windows DLLs and msvcrt.dll in the windows/system32<br>
directory, as<br>
well as libstdc++6.dll and on whatever other DLL represents the<br>
exceptional model for that version of mingw-64/gcc in a<br>
mingw-64/gcc<br>
bin directory. If I build a 32-bit version of clang with<br>
mingw-64/gcc 32-bit supporting the dwarf exception model<br>
clang has a<br>
dependency on LIBGCC_S_DW2-1.DLL. If I build a 64-bit<br>
version of<br>
clang with mingw-64/gcc 64-bit supporting the seh exception<br>
model<br>
clang has a dependency on LIBGCC_S_SEH-1.DLL.<br>
<br>
Why is there this discrepancy between the pre-built<br>
versions and the<br>
32-bit and 64-bit versions of clang which I build ?<br>
<br>
Or better yet, with what is the clang pre-built versions<br>
being built<br>
so that it has no dependencies on any compiler<br>
implementation DLL ?<br>
<br>
<br>
<br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br></div></div>
<mailto:<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><span class=""><br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
<br>
</span></blockquote><div class="HOEnZb"><div class="h5">
<br>
<br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
</div></div></blockquote></div><br></div>