<div dir="ltr">Thanks for your response Shoaib. I've got it building now. It required modifying the LLVM cmake scripts to include the libraries. 3.7 is a hard requirement. Cache file, great. Thanks!</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Apr 11, 2019 at 2:09 PM Shoaib Meenai <<a href="mailto:smeenai@fb.com">smeenai@fb.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
<div lang="EN-US">
<div class="gmail-m_3586551799785749573WordSection1">
<p class="MsoNormal"><a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a> would also be a good place to ask questions about the LLVM build system :)<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<ol style="margin-top:0in" start="1" type="1">
<li class="gmail-m_3586551799785749573MsoListParagraph" style="margin-left:0in">I believe it’s just called the configure phase. (There’s also the generation phase, where CMake actually generates the build system.)<u></u><u></u></li><li class="gmail-m_3586551799785749573MsoListParagraph" style="margin-left:0in">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.<u></u><u></u></li><li class="gmail-m_3586551799785749573MsoListParagraph" style="margin-left:0in">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.<u></u><u></u></li><li class="gmail-m_3586551799785749573MsoListParagraph" style="margin-left:0in">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" target="_blank">https://cmake.org/cmake/help/latest/manual/cmake.1.html#options</a><u></u><u></u></li></ol>
<p class="MsoNormal"><u></u> <u></u></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).<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<div style="border-style:solid none none;border-top-width:1pt;border-top-color:rgb(181,196,223);padding:3pt 0in 0in">
<p class="MsoNormal"><b><span style="font-size:12pt;color:black">From: </span></b><span style="font-size:12pt;color:black">CMake <<a href="mailto:cmake-bounces@cmake.org" target="_blank">cmake-bounces@cmake.org</a>> on behalf of SC Warrior <<a href="mailto:bhhjkl@gmail.com" target="_blank">bhhjkl@gmail.com</a>><br>
<b>Date: </b>Wednesday, April 10, 2019 at 5:09 PM<br>
<b>To: </b>"<a href="mailto:cmake@cmake.org" target="_blank">cmake@cmake.org</a>" <<a href="mailto:cmake@cmake.org" target="_blank">cmake@cmake.org</a>><br>
<b>Subject: </b>[CMake] cmake build of LLVM: HAVE_CXX_ATOMICS_WITHOUT_LIB test failure<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">I watched <a href="https://www.youtube.com/watch?v=StF77Cx7pz8" target="_blank">
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. <u></u><u></u></p>
<div>
<p class="MsoNormal"><span style="font-size:11.5pt;color:rgb(36,39,41)"><br>
<br>
</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.5pt;color:rgb(36,39,41)">I'm getting this failure trying to cross compile LLVM v3.7 (linux x64 -> Aarch64) w/ cmake:</span>
<u></u><u></u></p>
<div>
<div>
<div style="margin-bottom:3.75pt;font-style:inherit;font-variant-ligatures:inherit;font-variant-caps:inherit;font-variant-numeric:inherit;font-variant-alternates:inherit;font-variant-east-asian:inherit;font-weight:inherit;font-stretch:inherit;box-sizing:inherit">
<pre style="background-color:rgb(239,240,241);vertical-align:baseline;background-position:initial initial;background-repeat:initial initial"><code><span style="font-family:Consolas;color:rgb(36,39,41);border:1pt none windowtext;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 && :<u></u><u></u></span></code></pre>
<pre style="background-color:rgb(239,240,241);vertical-align:baseline;background-position:initial initial;background-repeat:initial initial"><code><span style="font-family:Consolas;color:rgb(36,39,41);border:1pt none windowtext;padding:0in">ld.lld: error: undefined symbol: pthread_once<u></u><u></u></span></code></pre>
<pre style="background-color:rgb(239,240,241);vertical-align:baseline;background-position:initial initial;background-repeat:initial initial"><code><span style="font-family:Consolas;color:rgb(36,39,41);border:1pt none windowtext;padding:0in">referenced by cxa_exception_storage.cpp<u></u><u></u></span></code></pre>
<p style="margin-right:0in;margin-bottom:12pt;margin-left:0in;vertical-align:baseline;font-style:inherit;font-variant-ligatures:inherit;font-variant-caps:inherit;font-variant-numeric:inherit;font-variant-alternates:inherit;font-variant-east-asian:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;box-sizing:inherit">
<span style="font-size:11.5pt;color:rgb(36,39,41)">this is then followed by numerous other "undefined symbol: pthread_blah" errors in the CMakeError.log file.<u></u><u></u></span></p>
<p style="margin-right:0in;margin-bottom:12pt;margin-left:0in;vertical-align:baseline;font-style:inherit;font-variant-ligatures:inherit;font-variant-caps:inherit;font-variant-numeric:inherit;font-variant-alternates:inherit;font-variant-east-asian:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;box-sizing:inherit">
<span style="font-size:11.5pt;color:rgb(36,39,41)">I have four questions:<u></u><u></u></span></p>
<p style="margin-right:0in;margin-bottom:12pt;margin-left:0in;vertical-align:baseline;font-style:inherit;font-variant-ligatures:inherit;font-variant-caps:inherit;font-variant-numeric:inherit;font-variant-alternates:inherit;font-variant-east-asian:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;box-sizing:inherit">
<span style="font-size:11.5pt;color:rgb(36,39,41)">(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).<u></u><u></u></span></p>
<p style="margin-right:0in;margin-bottom:12pt;margin-left:0in;vertical-align:baseline;font-style:inherit;font-variant-ligatures:inherit;font-variant-caps:inherit;font-variant-numeric:inherit;font-variant-alternates:inherit;font-variant-east-asian:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;box-sizing:inherit">
<span style="font-size:11.5pt;color:rgb(36,39,41)">(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.<u></u><u></u></span></p>
<p style="margin:0in 0in 0.0001pt;vertical-align:baseline;font-style:inherit;font-variant-ligatures:inherit;font-variant-caps:inherit;font-variant-numeric:inherit;font-variant-alternates:inherit;font-variant-east-asian:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;box-sizing:inherit">
<span style="font-size:11.5pt;color:rgb(36,39,41)">(3) The cmake command <em><span style="border:1pt none windowtext;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!".<u></u><u></u></span></p>
<p style="margin-right:0in;margin-bottom:12pt;margin-left:0in;vertical-align:baseline;font-style:inherit;font-variant-ligatures:inherit;font-variant-caps:inherit;font-variant-numeric:inherit;font-variant-alternates:inherit;font-variant-east-asian:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;box-sizing:inherit">
<span style="font-size:11.5pt;color:rgb(36,39,41)">(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.<u></u><u></u></span></p>
<p style="margin-right:0in;margin-bottom:12pt;margin-left:0in;vertical-align:baseline;font-style:inherit;font-variant-ligatures:inherit;font-variant-caps:inherit;font-variant-numeric:inherit;font-variant-alternates:inherit;font-variant-east-asian:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;box-sizing:inherit">
<span style="font-size:11.5pt;color:rgb(36,39,41)">I gratefully thank you for your patience and time reading all of that ^^^.<u></u><u></u></span></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote></div>