[cfe-dev] Pointing clang to a C++ library

Friedman, Eli via cfe-dev cfe-dev at lists.llvm.org
Tue Sep 25 13:47:37 PDT 2018


On 9/25/2018 1:10 PM, David Greene via cfe-dev wrote:
> I've got clang built to a point where it can find the gcc toolchain it
> was built with and use that gcc toolchain's C++ library.
>
> But I want it to point to a different C++ library.  That library will be
> installed relative to where clang will be installed.  Pointing clang to
> an absolute path isn't going to work because the package may be
> installed in lots of different places.
>
> What's the best way to do this?

clang will automatically find libc++ installed relative to itself 
($INSTALL_PREFIX/include/c++/v1).  So if the user specifies 
-stdlib=libc++, or CLANG_DEFAULT_CXX_STDLIB is configured appropriately, 
you shouldn't need to do anything else.

If you're not using libc++, you might need to modify the way clang 
computes the header search paths.

-Eli

-- 
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project




More information about the cfe-dev mailing list