[PATCH] D37761: [LLD] [MinGW] Support creating DLLs with a def file

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 13 00:29:54 PDT 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL313125: [MinGW] Support creating DLLs with a def file (authored by mstorsjo).

Changed prior to commit:
  https://reviews.llvm.org/D37761?vs=114891&id=114986#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D37761

Files:
  lld/trunk/MinGW/Driver.cpp
  lld/trunk/test/MinGW/driver.test


Index: lld/trunk/MinGW/Driver.cpp
===================================================================
--- lld/trunk/MinGW/Driver.cpp
+++ lld/trunk/MinGW/Driver.cpp
@@ -177,7 +177,10 @@
                                OPT_no_whole_archive)) {
     switch (A->getOption().getID()) {
     case OPT_INPUT:
-      Add(Prefix + StringRef(A->getValue()));
+      if (StringRef(A->getValue()).endswith(".def"))
+        Add("-def:" + StringRef(A->getValue()));
+      else
+        Add(Prefix + StringRef(A->getValue()));
       break;
     case OPT_l:
       Add(Prefix +
Index: lld/trunk/test/MinGW/driver.test
===================================================================
--- lld/trunk/test/MinGW/driver.test
+++ lld/trunk/test/MinGW/driver.test
@@ -26,6 +26,9 @@
 SHARED:      -out:a.dll
 SHARED-SAME: -dll
 
+RUN: ld.lld -### foo.o -m i386pep -shared foo.def | FileCheck -check-prefix=DEF %s
+DEF: -def:foo.def
+
 RUN: ld.lld -### foo.o -m i386pep -o bar.exe | FileCheck -check-prefix=OUT %s
 OUT: -out:bar.exe
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D37761.114986.patch
Type: text/x-patch
Size: 1016 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170913/d2c945d3/attachment.bin>


More information about the llvm-commits mailing list