<div dir="ltr">On Sun, Jan 6, 2013 at 1:36 PM, Óscar Fuentes <span dir="ltr"><<a href="mailto:ofv@wanadoo.es" target="_blank">ofv@wanadoo.es</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">Edward Diener <<a href="mailto:eldlistmailingz@tropicsoft.com">eldlistmailingz@tropicsoft.com</a>> writes:<br>
<br>
>> Clang will attempt to use your installed system libraries, usually<br>
>> libstdc++ and glibc on a Linux distribution. We could probably maintain<br>
>> a libstdc++ compatibility table that says clang x.y is compatible with<br>
>> libstdc++ up to z.w. In the vast majority of cases, this just works if<br>
>> you install a somewhat-newer version of clang. The problems arise when<br>
>> you use an older clang with a newer libstdc++ (e.g. newer gcc and/or<br>
>> linux distribution).<br>
><br>
> This is what evidently happens. A clang binary distribution gets<br>
> created for a particular Linux distro but there is no compatibility in<br>
> the package which states that it only works with some version of<br>
> libstdc++ or glibc or earlier. Then a later version of gcc gets<br>
> installed and with it a later version of libstdc++ and glibc as a<br>
> dependency. Now the binary version of clang no longer works on that<br>
> system because of the updates to the C/C++ standard library.<br>
<br>
</div>Then, the package system of your Linux distribution is broken. Or the<br>
package containing the Clang binaries does not correctly state its<br>
dependencies.<br></blockquote><div><br></div><div style>This should only really be a problem for rolling-release distributions like Arch. For others, even if gcc is updated, the system libstdc++ probably won't be for compatibility reasons.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
[snip]<br>
<div class="im"><br>
>> Generally, it is recommended to bootstrap clang:<br>
>><br>
>> 1. Build llvm/clang with system gcc<br>
>> 2. Build llvm/clang with new clang<br>
>> 3. Install new clang somewhere (which will automatically use system<br>
>> libstdc++/glibc).<br>
>><br>
>> This should solve your problem.<br>
<br>
</div>[I think Justin's recipe is overkill, but whatever]<br></blockquote><div><br></div><div style>Sure, you can just build with system gcc and be done with it. Though being a C++ program itself, building clang successful should give you some reassurance that it will work for other C++ programs.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im"><br>
> OK, this sounds good. Can this process not be explained on the clang<br>
> Getting Started page for those who are building clang from source. I<br>
> am not sure how step 3) is supposed to go. Do I just copy the built<br>
> bin directory somewhere else and then put it first in my PATH, before<br>
> running llvm/configure ?<br>
<br>
</div>You can install on a temporary directory or directly use the newly<br>
created clang binaries, setting the environment variables CC and CXX<br>
with full paths like this:<br>
<br>
CC=/path/to/clang CXX=/path/to/clang++ configure [configure options] && make<br>
<br>
Changing the PATH should work, but remeber to undo the change<br>
afterwards.<br>
<div class="im"><br>
> Or is "Install new clang" more complicated than that ?<br>
<br>
</div>It is simply `sudo make install' (which installs on system-level default<br>
directories.) You can also install on a custom directory, using the<br>
parameter `--prefix=' in the `configure' invocation.<br>
<div class="im"><br>
> Originally I thought I could have both an earlier binary version of<br>
> clang as well as the latest built version of clang in a Linux distro<br>
> so that I could test code on both for compatibility of my library for<br>
> end-users. But with the fairly common breakage of the binary version<br>
> package of clang when libstdc++/glibc gets updated, this has become<br>
> much less of a reality.<br>
<br>
</div>See above. You can have as much Clang versions as you please. Just be<br>
sure to not uninstall the required gcc version for each Clang version.<br></blockquote><div><br></div><div style>Does clang still maintain a hard-coded list of search-paths for GCC versions?</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5"><br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a> <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><br><div>Thanks,</div><div><br></div><div>Justin Holewinski</div>
</div></div>