@john is correct . For posterity, the relevant parts of the FAQ (with the names configured to answer the question):
clang -cc1 is an interface, clang is a driver. The driver invokes an interface with parameters suitable for your system. To view these options, run:
$ clang++ -
Some clang command-line options are driver-only options, some of them are interface-only options. Frontend-only options are for use by clang developers only. Users should not run clang -cc1 directly because the -cc1 options -cc1 not guaranteed.
If you want to use the option only for the interface ("a -cc1 option"), for example -ast-dump , you need to take the clang -cc1 line generated by the driver and add the required parameter. Alternatively, you can run clang -Xclang <option> ... to force the driver [switch] <option> to clang -cc1 .
I did the last ( -Xclang ) to emit precompiled headers:
/usr/bin/clang++ -x c++-header foo.hpp -Xclang -emit-pch -o foo.hpp.pch <other options> ^^^^^^^
Without -Xclang , clang++ ignores -emit-pch . When I tried -cc1 , I had the same problem as the OP - clang++ accepted -emit-pch , but does not have other parameters that the driver usually provides.
source share