https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67094
--- Comment #4 from Jeffrey Walton <noloader at gmail dot com> --- Andrew/Everyone(In reply to Andrew Pinski from comment #1) > -x c++ means the input is c++ source no matter what the extension. Sorry to revisit this... According to the GCC docs, GCC should not be changing the input file type of object files. See "-x language" topic at https://gcc.gnu.org/onlinedocs/gcc/Overall-Options.html#Overall-Options. If the document is accurate and I am parsing it correctly, then -x only applies to: c c-header cpp-output c++ c++-header c++-cpp-output objective-c objective-c-header objective-c-cpp-output objective-c++ objective-c++-header objective-c++-cpp-output assembler assembler-with-cpp ada f77 f77-cpp-input f95 f95-cpp-input go java In the end, I know you are right. So I guess that explains why I thought -x applied to source files, and not object files.