diff --git a/lld/COFF/Driver.cpp b/lld/COFF/Driver.cpp --- a/lld/COFF/Driver.cpp +++ b/lld/COFF/Driver.cpp @@ -279,6 +279,10 @@ } else if (magic == file_magic::bitcode) { obj = make(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; diff --git a/lld/test/COFF/Inputs/cl-gl.lib b/lld/test/COFF/Inputs/cl-gl.lib new file mode 100755 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 GIT binary patch literal 0 Hc$@& %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