mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-22 18:54:02 +01:00
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. llvm-svn: 289859
This commit is contained in:
parent
c43cf7c253
commit
9cde5c0204
@ -146,8 +146,10 @@ int llvm::libDriverMain(llvm::ArrayRef<const char*> ArgsArr) {
|
||||
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));
|
||||
|
BIN
test/LibDriver/Inputs/resource.res
Normal file
BIN
test/LibDriver/Inputs/resource.res
Normal file
Binary file not shown.
@ -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
|
||||
|
3
test/LibDriver/resource.test
Normal file
3
test/LibDriver/resource.test
Normal file
@ -0,0 +1,3 @@
|
||||
RUN: llvm-lib /out:%t %S/Inputs/resource.res
|
||||
RUN: llvm-ar t %t | FileCheck %s
|
||||
CHECK: resource.res
|
Loading…
Reference in New Issue
Block a user