[PATCH] D131458: [LLD][COFF] Identify /GL object files which are inside libraries

Pengxuan Zheng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 9 12:32:54 PDT 2022


This revision was automatically updated to reflect the committed changes.
Closed by commit rGc951edb7b22e: [LLD][COFF] Identify /GL object files which are inside libraries (authored by pzheng).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D131458/new/

https://reviews.llvm.org/D131458

Files:
  lld/COFF/Driver.cpp
  lld/test/COFF/Inputs/cl-gl.lib
  lld/test/COFF/cl-gl.test


Index: lld/test/COFF/cl-gl.test
===================================================================
--- lld/test/COFF/cl-gl.test
+++ lld/test/COFF/cl-gl.test
@@ -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
Index: lld/COFF/Driver.cpp
===================================================================
--- lld/COFF/Driver.cpp
+++ lld/COFF/Driver.cpp
@@ -279,6 +279,10 @@
   } 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;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D131458.451239.patch
Type: text/x-patch
Size: 1011 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220809/8d4239f9/attachment.bin>


More information about the llvm-commits mailing list