[PATCH] COFF: Implement /lib using LibDriver.
Peter Collingbourne
peter at pcc.me.uk
Tue Jun 9 14:57:01 PDT 2015
REPOSITORY
rL LLVM
http://reviews.llvm.org/D10347
Files:
lld/trunk/COFF/CMakeLists.txt
lld/trunk/COFF/Driver.cpp
Index: lld/trunk/COFF/Driver.cpp
===================================================================
--- lld/trunk/COFF/Driver.cpp
+++ lld/trunk/COFF/Driver.cpp
@@ -16,6 +16,7 @@
#include "llvm/ADT/Optional.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringSwitch.h"
+#include "llvm/LibDriver/LibDriver.h"
#include "llvm/Option/Arg.h"
#include "llvm/Option/ArgList.h"
#include "llvm/Option/Option.h"
@@ -185,6 +186,11 @@
llvm::InitializeAllAsmPrinters();
llvm::InitializeAllDisassemblers();
+ // If the first command line argument is "/lib", link.exe acts like lib.exe.
+ // We call our own implementation of lib.exe that understands bitcode files.
+ if (Argc > 1 && StringRef(Argv[1]).equals_lower("/lib"))
+ return llvm::libDriverMain(Argc - 1, Argv + 1) == 0;
+
// Parse command line options.
auto ArgsOrErr = Parser.parse(Argc, Argv);
if (auto EC = ArgsOrErr.getError()) {
Index: lld/trunk/COFF/CMakeLists.txt
===================================================================
--- lld/trunk/COFF/CMakeLists.txt
+++ lld/trunk/COFF/CMakeLists.txt
@@ -16,6 +16,7 @@
${LLVM_TARGETS_TO_BUILD}
Core
LTO
+ LibDriver
MC
MCDisassembler
Support
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D10347.27405.patch
Type: text/x-patch
Size: 1198 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150609/369316ef/attachment.bin>
More information about the llvm-commits
mailing list