<div dir="ltr">I wonder if it'd useful for Clang to be able to process multiple sysroots, to handle this kind of situation where some stuff (libc++, llvm, maybe more) are installed to /some/prefix/, but the user still wants to search /usr/ for headers and libs. Today I believe we just require the user to pass lots of -isystem and -L args.<div>
<br></div><div>That sounds a lot like Apple's framework concept.</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jan 31, 2014 at 7:08 AM, Frank Rehwinkel <span dir="ltr"><<a href="mailto:frankrehwinkel@gmail.com" target="_blank">frankrehwinkel@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">
<p>Hi,</p><p><br></p><p>I would like to compile and install llvm/clang/libcxx into a local directory on Linux (Gentoo). I haven't found the right combination of cmake -D flags to make the -stdlib=c++ option work.</p>
<p>The first part seems straightforward enough:</p><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><p>cmake -G Ninja \</p><p> -DCMAKE_BUILD_TYPE=Release \</p><p> -DCMAKE_INSTALL_PREFIX=/local/llvm/3.4/usr \</p>
<p> -DFFI_INCLUDE_DIR=/usr/lib64/libffi-3.0.11/include \</p><p> -DFFI_LIBRARY_DIR=/usr/lib64 \</p><p> -DLLVM_BUILD_TESTS=ON \</p><p> -DLLVM_ENABLE_FFI=ON \</p><p>
-DLLVM_EXTERNAL_MSBUILD_BUILD=OFF \</p><p> -DLLVM_TARGETS_TO_BUILD=host \</p><p> -DPYTHON_EXECUTABLE=/usr/bin/python2 \</p></blockquote>
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><p> -DLIBCXX_CXX_ABI=libstdc++ \</p><p> -DLIBCXX_LIBSUPCXX_INCLUDE_PATHS="/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.3/include/g++-v4;/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.3/include/g++-v4/x86_64-pc-linux-gnu" \</p>
<p> -DLIBCXX_ENABLE_SHARED=YES \</p><p> ${SRC}</p><p><br></p></blockquote><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><p>But the system header search path used by clang++ when the libc++ stdlib is used then is completely wrong. Looking through the source code, I stumbled on the parameters DEFAULT_SYSROOT and gave that a try. </p>
</blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><p>-DDEFAULT_SYSROOT=/local/llvm/3.4</p></blockquote></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px">
and that made the system header search path look good as far as finding the libc++ headers, but now the plain old /usr/include directory is no longer in the search path so /usr/include/features.h is not found.<br><br>Is building clang and libcxx on Linux and installing to a local directory supported and if so, please, what did I overlook or not know?<br>
<br>(I built with gcc, version 4.7.3 as you may have surmised by the paths above.)<br><br>Thanks,<br>-Frank</blockquote>
<p>
</p></div>
<br>_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu">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/mailman/listinfo/cfe-dev</a><br>
<br></blockquote></div><br></div>