<div dir="ltr">On Wed, Sep 25, 2013 at 9:10 PM, Tim Northover-2 [via Clang Developers] <span dir="ltr"><<a href="mailto:ml-node+s42468n4034663h96@n3.nabble.com" target="_blank">ml-node+s42468n4034663h96@n3.nabble.com</a>></span> wrote:<br>


<div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div>

        Hi fil,
<br><br>Most of the activity here happens via the mailing lists rather than
<br>that "<a href="http://nabble.com" target="_blank">nabble.com</a>", and your error message in particular hasn't shown
<br>up here:
<br></div></blockquote><div><br></div><div>Apologies.. was just a handy way to do historical searches etc.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">


<div>/usr/local/Cellar/llvm33/3.3/lib/llvm-3.3/bin/../lib/clang/3.3/lib/darwin/libclang_rt.osx.a
<br>Stack dump:
<br>0. Running pass 'Function Pass Manager' on module 'ld-temp.o'.
<br>1. Running pass 'X86 AT&T-Style Assembly Printer' on function '@_GLOBAL__I_a'
<br>clang: error: unable to execute command: Segmentation fault: 11
<br>clang: error: linker command failed due to signal (use -v to see invocation)
<br><br></div><div>On 25 September 2013 01:14, fil <<a href="http://user/SendEmail.jtp?type=node&node=4034663&i=0" rel="nofollow" link="external" target="_blank">[hidden email]</a>> wrote:
<br>> One thing I just noticed: I was using -emit-llvm to compile the .cpp code,
<br>> removing that causes it to compile OK. However, compiling with -emit-llvm
<br>> under Apple LLVM 3.3 still works OK.
<br><br>The error comes from ld, and indicates that LTO is being tried. That
<br>fits with you passing -emit-llvm. It also means you're trying to do
<br>the actual compilation of some LLVM IR produced by Clang 3.4trunk
<br>using the backends and so on (libLTO.dylib) from Apple's Clang 3.3
<br>branch. That's not going to end well.
<br><br>One (unsupported, I believe) option is to point ld at a libLTO that
<br>was built alongside your clang by setting the environment variable
<br>DYLD_LIBRARY_PATH=/path/where/libLTO/lives.<br></div></blockquote><div><br></div><div>You were spot on.</div><div><br></div><div>For the reference of others, to fix this issue I copied /usr/bin/ld to /usr/local/bin/ld; I have a brew'd llvm which targets /usr/local. This works since the reference from ld to the dylib (using otool) was @executable_path/../lib/libLTO.dylib. I didn't want to mess with anything in /usr/lib.</div>

<div><br></div><div>Is there any down side in using LTO (ie. using -emit-llvm on compile)? I'm guessing not, but...</div><div><br></div><div>Now onto the next issue: profiling..</div><div><br></div><div>Regards, Fil.</div>

<div><br></div></div></div></div>