[cfe-dev] clang - how to use alternate versions of gcc headers

Rafael EspĂ­ndola rafael.espindola at gmail.com
Mon Jul 30 15:05:43 PDT 2012


On 30 July 2012 16:39, Melanie B <mib.bugzilla at gmail.com> wrote:
> I'm using clang native on intel-64bit system, Linux host
> On this host there are different gcc installations e.g. gcc 4.5.0, gcc
> 4.6.2, gcc 4.7.0, as well as the system supplied default which is 4.4.6
> When I build clang with default path, the system header files come from the
> system supplied gcc, Makes sense.
> However, when I build clang in a shell where the path is gcc 4.7.0, I
> expected that the system headers would then come from the gcc 4.7 include
> directory,
> But that is not the case, those files are still coming from the system
> supplied gcc. I checked the configure.log and indeed it is finding gcc 4.7.0
> Any tips about how to point clang at different headers, either at compiler
> build time or (preferably) later? Or is this not possible? Thanks

I think there are two ways of doing it:

* Install clang on the same directory as gcc and it should work out of
the box (i have not tried it).
* Use the configure option --with-gcc-toolchain=path.

Cheers,
Rafael



More information about the cfe-dev mailing list