[cfe-dev] Getting clang header search path

Edward Diener eldlistmailingz at tropicsoft.com
Fri Aug 15 18:12:01 PDT 2014


On 8/15/2014 10:23 AM, Craig Tenenbaum wrote:
> On Fri, Aug 15, 2014 at 9:28 AM, Edward Diener
> <eldlistmailingz at tropicsoft.com
> <mailto:eldlistmailingz at tropicsoft.com>> wrote:
>
>     Here is my output:
>
>         C:\Programming\VersionControl\__bninja_installed_clang\bin>__clang++
>         -E -v -### -x c
>         ++ NUL
>
>         clang version 3.6.0 (215674)
>         Target: i686-pc-windows-gnu
>         Thread model: posix
>           "C:\\Programming\\__VersionControl\\bninja___installed_clang\\bin\\clang++.__exe" "-c
>         c1" "-triple" "i686-pc-windows-gnu" "-E" "-disable-free"
>         "-disable-llvm-verifier
>         " "-main-file-name" "NUL" "-mrelocation-model" "static"
>         "-mdisable-fp-elim" "-fm
>         ath-errno" "-masm-verbose" "-mconstructor-aliases" "-target-cpu"
>         "pentium4" "-v"
>           "-dwarf-column-info" "-resource-dir"
>         "C:\\Programming\\__VersionControl\\bninja_i
>         nstalled_clang\\bin\\..\\lib\\__clang\\3.6.0"
>         "-fdeprecated-macro" "-fdebug-compil
>         ation-dir"
>         "C:\\Programming\\__VersionControl\\bninja___installed_clang\\bin"
>         "-ferr
>         or-limit" "19" "-fmessage-length" "80" "-mstackrealign"
>         "-fno-use-cxa-atexit" "-
>         fobjc-runtime=gcc" "-fcxx-exceptions" "-fexceptions"
>         "-fdiagnostics-show-option"
>           "-fcolor-diagnostics" "-o" "-" "-x" "c++" "NUL"
>
>
>     I do not see header path information anywhere.
>
> Sorry, my bad, try: clang++ -E -v -x c++ NUL

Bingo ! That gives me the output I expected.

But it is looking in all sorts of non-existent directories related to 
gcc versions 4.7.0 through 4.8.2, which of course don't exist since I 
used mingw64 gcc-4.9.1 32-bit to build clang. And therefore it does not 
find the C++ standard libraries of gcc-4.9.1.

I can switch to mingw gcc-4.8.1 and hopefully that will work after I 
rebuild the latest clang.

The moral of the story is that building clang from source on Windows 
targeting gcc will not work with gcc outside the 4.7.0 to 4.8.2 range. I 
wish such simple things were documented somewhere in clang documentation.

Did I miss it ? Is there any clang table which specifies which clang 
versions depend on which gcc version ranges ?




More information about the cfe-dev mailing list