[cfe-dev] "no input files" error when specifying language?
Rick Mann via cfe-dev
cfe-dev at lists.llvm.org
Fri Sep 25 00:24:47 PDT 2015
In the ARM Linux development world, it's common to use gcc to pre-process "Device Tree" files to take advantage of #include and #define directives. Unfortunately, the DT syntax also includes the use of the '#', so they specify -x assembler-with-cpp, and it processes nicely. The typical invocation (with gcc) looks like this:
cpp -Wp,-MD,src/arm/.am335x-arduino-tre.dtb.d.pre.tmp -nostdinc -Iinclude -Isrc/arm -Itestcase-data -undef -D__DTS__ -x assembler-with-cpp -o src/arm/.am335x-arduino-tre.dtb.dts.tmp src/arm/am335x-arduino-tre.dts
A simplified invocation is:
cpp -x assembler-with-cpp -o FILE.temp.dts FILE.dts
clang doesn't like this. It's okay with this:
But of course it complains about the invalid preprocessing directive it finds (e.g. "#address-cells = <1>;"). The cure for this is "-x assembler-with-cpp", but if I invoke it like this:
cpp -x assembler-with-cpp FILE.dts
It says "clang: error: no input files". If I place the filename FILE.dts before any of the options, they don't get applied to that file.
The clang I'm trying this with is:
$ clang --version
Apple LLVM version 7.0.0 (clang-700.0.72)
Thread model: posix
Is there any way to do what I want to do here?
rmann at latencyzero.com
More information about the cfe-dev