[LLD][COFF] Identify /GL object files which are inside libraries
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
This commit is contained in:
parent
9893b26dfa
commit
c951edb7b2
|
|
@ -279,6 +279,10 @@ void LinkerDriver::addArchiveBuffer(MemoryBufferRef mb, StringRef symName,
|
|||
} 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;
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -1,4 +1,6 @@
|
|||
# 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
|
||||
|
|
|
|||
Loading…
Reference in New Issue