[cfe-dev] clang Unexpected output

Bruce Hoult via cfe-dev cfe-dev at lists.llvm.org
Sun May 27 03:38:46 PDT 2018


Ahh .. if you do that with either gcc or clang without the "-o s.o" then
you'll get a file called stdio.h.gch. WIth gcc "file stdio.h.gch" will tell
you...

stdio.h.gch: GCC precompiled header (version 014) for C

I guess clang also made some kind of precompiled header format, but "file"
doesn't know about it.

I couldn't find something to read them .. except clang itself. Make "clang
-ast-print" or something like that is useful?

On Sun, May 27, 2018 at 10:24 PM, Bruce Hoult <brucehoult at sifive.com> wrote:

> stdio.h should be a pure header file with no functions defined in it at
> all (they'll be in some stdio.c somewhere else), and therefore no code
> generated.
>
>
> On Sun, May 27, 2018 at 10:05 PM, James Courtier-Dutton via cfe-dev <
> cfe-dev at lists.llvm.org> wrote:
>
>> Hi,
>>
>> When I type the command:
>> clang-5.0 -c -o s.o stdio.h     (note: stdio.h taken from
>> /usr/include/... )
>>
>> This creates some output in s.o
>> The problem is that I don't know what format it is.
>> objdump cannot read it.
>>
>> Please can someone tell me what format that file is, and which
>> clang/llvm tool can be made to read it?
>>
>> Kind Regards
>>
>> James
>> _______________________________________________
>> cfe-dev mailing list
>> cfe-dev at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20180527/b49daeb8/attachment.html>


More information about the cfe-dev mailing list