I recently modified my compiler's build files to use clang if it detects its available, however I'm running into a number of problems with this. I'm having one set of problems on OS X, and a different set of problems under Ubuntu.<div>

<br></div><div>In both cases I'm attempting to link my frontend - compiled with clang - against the LLVM libraries - compiled with gcc. (I thought about compiling LLVM with clang, but then I'd have to compile it twice to bootstrap.)</div>

<div><br></div><div>Under OS X, I get the following error when I try to link:</div><div><br></div><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><div><p class="p1">Undefined symbols:</p>

</div><div><p class="p1">  "___eprintf", referenced from:</p></div><div><p class="p1">      ___eprintf$non_lazy_ptr in libLLVMSupport.a(SearchForAddressOfSpecialSymbol.cpp.o)</p></div><div><p class="p1">ld: symbol(s) not found</p>

</div><div><p class="p1">clang-3: error: linker command failed with exit code 1 (use -v to see invocation)</p></div></blockquote><div><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<title></title>
<meta name="Generator" content="Cocoa HTML Writer">
<meta name="CocoaVersion" content="949.54">
<style type="text/css">
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco}
</style>






<p class="p1"><br></p>As you can see the reference is coming from the LLVM libs.</div><div><br></div><div>Under Ubuntu, the problem I get is a crash when calling a method in DIBuilder. The problem appears to be in the StringRef param, which looks like it's full of junk when I examine it in the debugger, even though my code is just passing in the default value for the parameter, which is an empty StringRef(). I'm guessing there is some incompatibility in the calling conventions, but I'm passing virtually the same command-line arguments to clang as I would normally pass to gcc. (With some minor differences having to do with warning suppression).</div>

<div><br><div><div><div><div><div><div><div><div>-- <br>-- Talin<br>
</div></div></div></div></div></div></div></div></div>