<div dir="ltr"><span style="font-size:12.8px">Not sure what the apple version does but I tried it on my cubox and this appears to work</span><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">clang -E -x assembler-with-cpp src/arm/am335x-boneblack.dts -Iinclude -Isrc<br></div><div style="font-size:12.8px"><p>Cubox has clang 3.6.2.</p><p>Beaglebone has 3.7 so would expect to work there as well.</p><p>Comparing with gcc 5.2 and the output is not the same but comparable with no invalid preprocessing directive errors.</p></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 25 September 2015 at 09:09, Rick Mann via cfe-dev <span dir="ltr"><<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">EDIT: I forgot to add: the same thing happens if I specify -o <outputfilename>.<br>
<span class=""><br>
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:<br>
<br>
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<br>
<br>
A simplified invocation is:<br>
<br>
cpp -x assembler-with-cpp -o FILE.temp.dts FILE.dts<br>
<br>
clang doesn't like this. It's okay with this:<br>
<br>
cpp FILE.dts<br>
<br>
</span>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 with either option above:<br>
<br>
cpp -x assembler-with-cpp FILE.dts<br>
cpp -o FILE.temp.dts FILE.dts<br>
<div class="HOEnZb"><div class="h5"><br>
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.<br>
<br>
The clang I'm trying this with is:<br>
<br>
$ clang --version<br>
Apple LLVM version 7.0.0 (clang-700.0.72)<br>
Target: x86_64-apple-darwin14.5.0<br>
Thread model: posix<br>
<br>
Is there any way to do what I want to do here?<br>
<br>
Thanks!<br>
<br>
<br>
--<br>
Rick Mann<br>
<a href="mailto:rmann@latencyzero.com">rmann@latencyzero.com</a><br>
<br>
<br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><a href="http://www.cryogenicgraphics.com" target="_blank">http://www.cryogenicgraphics.com</a><br><a href="http://www.flickr.com/photos/hdrflow" target="_blank">http://www.flickr.com/photos/hdrflow</a></div>
</div>