[llvm] r289859 - LibDriver: Allow resource files to be archive members.
Peter Collingbourne via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 15 11:37:47 PST 2016
Author: pcc
Date: Thu Dec 15 13:37:46 2016
New Revision: 289859
URL: http://llvm.org/viewvc/llvm-project?rev=289859&view=rev
Log:
LibDriver: Allow resource files to be archive members.
It seems pointless to add a resource to an archive because it won't have
any symbols to link against (and link.exe doesn't have an equivalent of
--whole-archive), but lib.exe allows it for some reason.
Added:
llvm/trunk/test/LibDriver/Inputs/resource.res (with props)
llvm/trunk/test/LibDriver/resource.test
Modified:
llvm/trunk/lib/LibDriver/LibDriver.cpp
llvm/trunk/test/LibDriver/invalid.test
Modified: llvm/trunk/lib/LibDriver/LibDriver.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/LibDriver/LibDriver.cpp?rev=289859&r1=289858&r2=289859&view=diff
==============================================================================
--- llvm/trunk/lib/LibDriver/LibDriver.cpp (original)
+++ llvm/trunk/lib/LibDriver/LibDriver.cpp Thu Dec 15 13:37:46 2016
@@ -146,8 +146,10 @@ int llvm::libDriverMain(llvm::ArrayRef<c
sys::fs::file_magic Magic =
sys::fs::identify_magic(MOrErr->Buf->getBuffer());
if (Magic != sys::fs::file_magic::coff_object &&
- Magic != sys::fs::file_magic::bitcode) {
- llvm::errs() << Arg->getValue() << ": not a COFF object or bitcode file\n";
+ Magic != sys::fs::file_magic::bitcode &&
+ Magic != sys::fs::file_magic::windows_resource) {
+ llvm::errs() << Arg->getValue()
+ << ": not a COFF object, bitcode or resource file\n";
return 1;
}
Members.emplace_back(std::move(*MOrErr));
Added: llvm/trunk/test/LibDriver/Inputs/resource.res
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/LibDriver/Inputs/resource.res?rev=289859&view=auto
==============================================================================
Binary file - no diff available.
Propchange: llvm/trunk/test/LibDriver/Inputs/resource.res
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Modified: llvm/trunk/test/LibDriver/invalid.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/LibDriver/invalid.test?rev=289859&r1=289858&r2=289859&view=diff
==============================================================================
--- llvm/trunk/test/LibDriver/invalid.test (original)
+++ llvm/trunk/test/LibDriver/invalid.test Thu Dec 15 13:37:46 2016
@@ -1,2 +1,2 @@
RUN: not llvm-lib %S/Inputs/cl-gl.obj 2>&1 | FileCheck %s
-CHECK: not a COFF object or bitcode file
+CHECK: not a COFF object, bitcode or resource file
Added: llvm/trunk/test/LibDriver/resource.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/LibDriver/resource.test?rev=289859&view=auto
==============================================================================
--- llvm/trunk/test/LibDriver/resource.test (added)
+++ llvm/trunk/test/LibDriver/resource.test Thu Dec 15 13:37:46 2016
@@ -0,0 +1,3 @@
+RUN: llvm-lib /out:%t %S/Inputs/resource.res
+RUN: llvm-ar t %t | FileCheck %s
+CHECK: resource.res
More information about the llvm-commits
mailing list