With D26647, we can already identify input object files compiled by cl.exe with
/GL. It seems to be helpful to do the same and print an error message for those
object files compiled with /GL but are inside libraries/archives too.
Reviewed By: rnk, thieta
Differential Revision: https://reviews.llvm.org/D131458
} else if (magic == file_magic::bitcode) {
obj =
make<BitcodeFile>(ctx, mb, parentName, offsetInArchive, /*lazy=*/false);
+ } else if (magic == file_magic::coff_cl_gl_object) {
+ error(mb.getBufferIdentifier() +
+ ": is not a native COFF file. Recompile without /GL?");
+ return;
} else {
error("unknown file type: " + mb.getBufferIdentifier());
return;
# RUN: not lld-link /out:%t.exe /entry:main %S/Inputs/cl-gl.obj >& %t.log
# RUN: FileCheck %s < %t.log
+# RUN: not lld-link /out:%t.exe /entry:main %S/Inputs/cl-gl.lib >& %t1.log
+# RUN: FileCheck %s < %t1.log
# CHECK: is not a native COFF file. Recompile without /GL