<div dir="ltr">Thanks Jon, this is starting to make more sense now. This must mean that on Darwin, a -lc++ is just automatically added to the args for all compilations! This naturally grabs /usr/lib/libc++.dylib. <div><br></div><div>The digging I did that resulted in otool -L showing a dependency on libc++.dylib must then in fact be due to simply using Apple's clang 5.1 (based on 3.4-svn) to build the clang (3.6.0-svn) that I am testing. This is just a case of clang itself needing to use the C standard library, as it should in this situation.<br><div><br></div><div>So to achieve my goals it would appear that I need to do two things:</div><div><br></div><div>1. Install freshly built libcxx to e.g. /opt/foo</div><div>2. Somehow coerce clang to look somewhere inside /opt/foo to grab both its libc++ headers and libc++.dylib</div></div><div><br></div><div>I would hope that configuring a clang build for /opt/foo as sysroot will do exactly this (where I can conveniently remember that all i need to access my new clang is to use the one that resides in /opt/foo/bin).</div><div><br></div><div>Then I don't even have to patch any code or anything!</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Sep 18, 2014 at 7:07 PM, Jonathan Roelofs <span dir="ltr"><<a href="mailto:jonathan@codesourcery.com" target="_blank">jonathan@codesourcery.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
On 9/18/14 4:13 PM, Steven Lu wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi all,<span class=""><br>
<br>
<br>
My follow-up question to this is: Can you show me where it is hardcoded?<br>
</span></blockquote>
See clang/lib/Driver/ToolChains.<u></u>cpp. A specific example is around line 600 in `void DarwinClang::<u></u>AddCXXStdlibLibArgs()`<br>
<br>
If you want to install your own, the best bet is to make a separate sysroot (in, say, /opt/foo), and install it there. Installing in the root directory, as you say, is pretty dangerous on OSX.<br>
<br>
<br>
Cheers,<br>
<br>
Jon<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Thanks<br>
Steven<br>
<br>
<br>
______________________________<u></u>_________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu" target="_blank">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/<u></u>mailman/listinfo/cfe-dev</a><br>
<br><span class="HOEnZb"><font color="#888888">
</font></span></blockquote><span class="HOEnZb"><font color="#888888">
<br>
-- <br>
Jon Roelofs<br>
<a href="mailto:jonathan@codesourcery.com" target="_blank">jonathan@codesourcery.com</a><br>
CodeSourcery / Mentor Embedded<br>
</font></span></blockquote></div><br></div>