<html 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=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:inherit;
        panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        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;}
code
        {mso-style-priority:99;
        font-family:"Courier New";}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0in;
        margin-right:0in;
        margin-bottom:0in;
        margin-left:.5in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;}
span.EmailStyle23
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:1287469695;
        mso-list-type:hybrid;
        mso-list-template-ids:1694428886 67698703 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l0:level1
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level2
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level3
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l0:level4
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level5
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level6
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l0:level7
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level8
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level9
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
ol
        {margin-bottom:0in;}
ul
        {margin-bottom:0in;}
--></style>
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a> would also be a good place to ask questions about the LLVM build system :)<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<ol style="margin-top:0in" start="1" type="1">
<li class="MsoListParagraph" style="margin-left:0in;mso-list:l0 level1 lfo1">I believe it’s just called the configure phase. (There’s also the generation phase, where CMake actually generates the build system.)<o:p></o:p></li><li class="MsoListParagraph" style="margin-left:0in;mso-list:l0 level1 lfo1">How have you set up your cross-compilation? LLVM’s build system has logic to link pthread if needed, so I’m wondering why that’s failing.<o:p></o:p></li><li class="MsoListParagraph" style="margin-left:0in;mso-list:l0 level1 lfo1">LLVM’s cross-compilation runs a sub-configure for some native build components (e.g. TableGen) – perhaps one of those sub-configures is succeeding but the main configure is failing?
 I’ve never seen the “Build files have been written to” and “Configuring incomplete, errors occurred” messages from the same configure.<o:p></o:p></li><li class="MsoListParagraph" style="margin-left:0in;mso-list:l0 level1 lfo1">You can use a CMake cache file – see “-C <initial-cache>” in
<a href="https://cmake.org/cmake/help/latest/manual/cmake.1.html#options">https://cmake.org/cmake/help/latest/manual/cmake.1.html#options</a><o:p></o:p></li></ol>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">How come you’re working with LLVM 3.7, btw? That’s pretty old at this point, and newer versions will have improved the build system (and it’s also a lot easier to provide assistance for them).<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:12.0pt;color:black">From: </span></b><span style="font-size:12.0pt;color:black">CMake <cmake-bounces@cmake.org> on behalf of SC Warrior <bhhjkl@gmail.com><br>
<b>Date: </b>Wednesday, April 10, 2019 at 5:09 PM<br>
<b>To: </b>"cmake@cmake.org" <cmake@cmake.org><br>
<b>Subject: </b>[CMake] cmake build of LLVM: HAVE_CXX_ATOMICS_WITHOUT_LIB test failure<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">I watched <a href="https://www.youtube.com/watch?v=StF77Cx7pz8">
Chris Bieneman's talk</a> about the transition of LLVM from autoconf to cmake and he raved about how friendly / vibrant the cmake community is so I thought I'd ask this here.  I posted it to stack overflow but it's fairly involved so I hope it's cool that I
 post (my first) in this forum. <o:p></o:p></p>
<div>
<p class="MsoNormal"><span style="font-size:11.5pt;font-family:"inherit",serif;color:#242729"><br>
<br>
</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.5pt;font-family:"inherit",serif;color:#242729">I'm getting this failure trying to cross compile LLVM v3.7 (linux x64 -> Aarch64) w/ cmake:</span>
<o:p></o:p></p>
<div>
<div>
<div style="margin-bottom:3.75pt;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;box-sizing:inherit">
<pre style="background:#EFF0F1;vertical-align:baseline"><code><span style="font-family:Consolas;color:#242729;border:none windowtext 1.0pt;padding:0in"><path to clang>/clang++  -DHAVE_CXX_ATOMICS_WITHOUT_LIB -std=c++11  -rdynamic CMakeFiles/cmTC_82a21.dir/src.cxx.o  -o cmTC_82a21  -lm -ldl && :<o:p></o:p></span></code></pre>
<pre style="background:#EFF0F1;vertical-align:baseline"><code><span style="font-family:Consolas;color:#242729;border:none windowtext 1.0pt;padding:0in">ld.lld: error: undefined symbol: pthread_once<o:p></o:p></span></code></pre>
<pre style="background:#EFF0F1;vertical-align:baseline"><code><span style="font-family:Consolas;color:#242729;border:none windowtext 1.0pt;padding:0in">referenced by cxa_exception_storage.cpp<o:p></o:p></span></code></pre>
<p style="mso-margin-top-alt:0in;margin-right:0in;margin-bottom:12.0pt;margin-left:0in;vertical-align:baseline;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;box-sizing:inherit">
<span style="font-size:11.5pt;font-family:"inherit",serif;color:#242729">this is then followed by numerous other "undefined symbol: pthread_blah" errors in the CMakeError.log file.<o:p></o:p></span></p>
<p style="mso-margin-top-alt:0in;margin-right:0in;margin-bottom:12.0pt;margin-left:0in;vertical-align:baseline;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;box-sizing:inherit">
<span style="font-size:11.5pt;font-family:"inherit",serif;color:#242729">I have four questions:<o:p></o:p></span></p>
<p style="mso-margin-top-alt:0in;margin-right:0in;margin-bottom:12.0pt;margin-left:0in;vertical-align:baseline;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;box-sizing:inherit">
<span style="font-size:11.5pt;font-family:"inherit",serif;color:#242729">(1) What is this phase of operation that cmake is performing to determine the capabilities of the build environment / platform called ? (i.e. the configure-like phase that performs numerous
 small compilation tests to see if they succeed, looks to see if it can find header files in expected paths, etc).<o:p></o:p></span></p>
<p style="mso-margin-top-alt:0in;margin-right:0in;margin-bottom:12.0pt;margin-left:0in;vertical-align:baseline;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;box-sizing:inherit">
<span style="font-size:11.5pt;font-family:"inherit",serif;color:#242729">(2) It looks to me that including -lpthread as part of the test compilation line would fix this problem. (a) Is there a way to tell cmake to do that and (b) is that a smart approach to
 solving this problem ? Seems like if I could tell cmake to do this it would pass these tests.<o:p></o:p></span></p>
<p style="margin:0in;margin-bottom:.0001pt;vertical-align:baseline;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;box-sizing:inherit">
<span style="font-size:11.5pt;font-family:"inherit",serif;color:#242729">(3) The cmake command <em><span style="font-family:"inherit",serif;border:none windowtext 1.0pt;padding:0in">seems</span></em> to succeed as it finishes with "Build files have been written
 to ...". What should I make of that when one of these pre-tests has a failure condition as cited above and reports "Configuring incomplete, errors occurred!".<o:p></o:p></span></p>
<p style="mso-margin-top-alt:0in;margin-right:0in;margin-bottom:12.0pt;margin-left:0in;vertical-align:baseline;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;box-sizing:inherit">
<span style="font-size:11.5pt;font-family:"inherit",serif;color:#242729">(4) I'm trying to get this cmake cross compile build to work with the stock LLVM v3.7 cmake files so I'm trying to control cmake using command line options only. This gets a little ugly
 and I'm wondering if there's a simple way to put all of these settings in a cmake file instead. One problem with that approach is that I'm not familiar with all of the targets in LLVM so if I were, to say, attempt to add libraries to targets to fix a linking
 problem, I wouldn't know offhand what targets to add them to. I'm hoping that in this case I can hit it with a bigger hammer and have them added everywhere with hopes of them being ignored if not used.<o:p></o:p></span></p>
<p style="mso-margin-top-alt:0in;margin-right:0in;margin-bottom:12.0pt;margin-left:0in;vertical-align:baseline;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;box-sizing:inherit">
<span style="font-size:11.5pt;font-family:"inherit",serif;color:#242729">I gratefully thank you for your patience and time reading all of that ^^^.<o:p></o:p></span></p>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>