[cfe-dev] Building clang from source and header/library search paths

Edward Diener eldlistmailingz at tropicsoft.com
Tue Dec 17 15:24:26 PST 2013

When clang is built on a Linux distro from the latest source as
described by http://clang.llvm.org/get_started.html how are the default
header and library search paths determined ?

On a particular Linux distro, using gcc 4.7.2, there is an older clang
distribution package installed ( 3.2 ) and it finds the header and
libraries in the gcc distribution without any problems. Yet if I build
the latest clang as described in the URL above successfully, that latest
version does not find the header and libraries in the gcc distribution
at all. So I am trying to understand why this is happening.

In the URL above I do see the explanation:

"If you intend to use Clang's C++ support, you may need to tell it how
to find your C++ standard library headers. In general, Clang will detect
the best version of libstdc++ headers available and use them - it will
look both for system installations of libstdc++ as well as installations
adjacent to Clang itself. If your configuration fits neither of these
scenarios, you can use the --with-gcc-toolchain configure option to tell
Clang where the gcc containing the desired libstdc++ is installed."

but I do not understand either how to determine what clang is detecting
or how to tell it to, via the "-with-gcc-toolchain" configuration
option, where to find the correct headers and libraries.

More information about the cfe-dev mailing list