[cfe-dev] system search path for option -stdlib=libc++

Frank Rehwinkel frankrehwinkel at gmail.com
Fri Jan 31 07:08:17 PST 2014


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.

The first part seems straightforward enough:

cmake -G Ninja \

    -DCMAKE_BUILD_TYPE=Release \

    -DCMAKE_INSTALL_PREFIX=/local/llvm/3.4/usr \

    -DFFI_INCLUDE_DIR=/usr/lib64/libffi-3.0.11/include \

    -DFFI_LIBRARY_DIR=/usr/lib64 \





    -DPYTHON_EXECUTABLE=/usr/bin/python2    \

    -DLIBCXX_CXX_ABI=libstdc++ \




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.


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.

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?

(I built with gcc, version 4.7.3 as you may have surmised by the paths

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20140131/b80312ba/attachment.html>

More information about the cfe-dev mailing list