<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"MS Mincho";
        panose-1:2 2 6 9 4 2 5 8 3 4;}
@font-face
        {font-family:"MS Mincho";
        panose-1:2 2 6 9 4 2 5 8 3 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"\@MS Mincho";
        panose-1:2 2 6 9 4 2 5 8 3 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-GB link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='color:#1F497D'>Hi,<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>I need to build a shared version of LLVM on Windows, Linux (both x86 and x64) and Mac OS X. So far, I have been able to build LLVM on Linux and Mac OS X, and it’s all working fine as confirmed by a small LLVM test code that I wrote.<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>However, on Windows, even though I get a DLL, that DLL doesn’t contain any (exported) functions (according to DLL Export Viewer; see <a href="http://www.nirsoft.net/utils/dll_export_viewer.html">http://www.nirsoft.net/utils/dll_export_viewer.html</a>).<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Now, I know that shared libraries are not supported on Windows using CMake (according to <a href="http://www.llvm.org/docs/CMake.html">http://www.llvm.org/docs/CMake.html</a>) which would have been my preferred building choice, but I didn’t see anything against them not being supported using Autotools, so I thought I would try it that way (as I successively did on Linux and Mac OS X). So, based on the documentation at <a href="http://www.llvm.org/docs/GettingStarted.html">http://www.llvm.org/docs/GettingStarted.html</a>, I installed MinGW/MSYS (<a href="http://sourceforge.net/projects/mingw/">http://sourceforge.net/projects/mingw/</a>), selecting C++ Compiler, MSYS Basic System and MinGW Developer ToolKit from the list of components to install. Then, I installed Python (<a href="http://www.python.org/download/">http://www.python.org/download/</a>; version 2.7.2 not 3.x) even though it’s not listed as a pre-requirement, but without it, it doesn’t work, so… Note that version 3.x of Python didn’t work for me, I had to use version 2.7.2. Otherwise, I obviously had to do something like export PATH=/c/Python27:$PATH to make it accessible from a shell prompt. Otherwise, I haven’t installed binutils since I don’t seem to need it…?<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Anyway, from there, I got LLVM's source code (see <a href="http://www.llvm.org/releases/">http://www.llvm.org/releases/</a>), unpacked it and:<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>    cd <LLVM-ROOT><o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>    mkdir ../LLVM-build<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>    cd ../LLVM-build<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>    ../<LLVM-ROOT>/configure --disable-docs --enable-shared --enable-targets=host<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>    make<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>As you can tell, I am not using gmake (I don’t have it, but maybe it comes with binutils?), but make. I imagine it shouldn’t make any difference…? Whatever the case, and as mentioned earlier, even though I do get a (~15MB big) DLL, it doesn’t contain any (exported) functions.<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Otherwise, I tried the above building process with the trunk version of LLVM, but to no avail. Maybe this will be possible with the forthcoming LLVM 3.0…? Anyway, any help on the above would be much appreciated…<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Cheers, Alan.<o:p></o:p></span></p></div></body></html>