[llvm-branch-commits] [lld] r368134 - Merging r367837:

Hans Wennborg via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Aug 7 01:34:28 PDT 2019


Author: hans
Date: Wed Aug  7 01:34:28 2019
New Revision: 368134

URL: http://llvm.org/viewvc/llvm-project?rev=368134&view=rev
Log:
Merging r367837:
------------------------------------------------------------------------
r367837 | mstorsjo | 2019-08-05 13:57:06 +0200 (Mon, 05 Aug 2019) | 10 lines

[MinGW] Add an lld specific option for requesting to delay load libraries

With GNU tools, delayload is handled completely differently. (One
creates a specific delayload import library using dlltool and then
links against it instead of the normal import library.)

Instead of requiring using -Xlink=-delayload:lib.dll, we can provide
an lld specific option for this.

Differential Revision: https://reviews.llvm.org/D65728
------------------------------------------------------------------------

Modified:
    lld/branches/release_90/   (props changed)
    lld/branches/release_90/MinGW/Driver.cpp
    lld/branches/release_90/MinGW/Options.td
    lld/branches/release_90/test/MinGW/driver.test

Propchange: lld/branches/release_90/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Aug  7 01:34:28 2019
@@ -1 +1 @@
-/lld/trunk:366445,366500,366504,366780,366784,367836
+/lld/trunk:366445,366500,366504,366780,366784,367836-367837

Modified: lld/branches/release_90/MinGW/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/branches/release_90/MinGW/Driver.cpp?rev=368134&r1=368133&r2=368134&view=diff
==============================================================================
--- lld/branches/release_90/MinGW/Driver.cpp (original)
+++ lld/branches/release_90/MinGW/Driver.cpp Wed Aug  7 01:34:28 2019
@@ -303,6 +303,8 @@ bool mingw::link(ArrayRef<const char *>
     add("-include:" + StringRef(a->getValue()));
   for (auto *a : args.filtered(OPT_undefined))
     add("-includeoptional:" + StringRef(a->getValue()));
+  for (auto *a : args.filtered(OPT_delayload))
+    add("-delayload:" + StringRef(a->getValue()));
 
   std::vector<StringRef> searchPaths;
   for (auto *a : args.filtered(OPT_L)) {

Modified: lld/branches/release_90/MinGW/Options.td
URL: http://llvm.org/viewvc/llvm-project/lld/branches/release_90/MinGW/Options.td?rev=368134&r1=368133&r2=368134&view=diff
==============================================================================
--- lld/branches/release_90/MinGW/Options.td (original)
+++ lld/branches/release_90/MinGW/Options.td Wed Aug  7 01:34:28 2019
@@ -80,6 +80,8 @@ def require_defined_eq: J<"require-defin
 def _HASH_HASH_HASH : Flag<["-"], "###">,
     HelpText<"Print (but do not run) the commands to run for this compilation">;
 def appcontainer: F<"appcontainer">, HelpText<"Set the appcontainer flag in the executable">;
+def delayload: S<"delayload">, HelpText<"DLL to load only on demand">;
+def delayload_eq: J<"delayload=">, Alias<delayload>;
 def mllvm: S<"mllvm">;
 def pdb: S<"pdb">, HelpText<"Output PDB debug info file, chosen implicitly if the argument is empty">;
 def pdb_eq: J<"pdb=">, Alias<pdb>;

Modified: lld/branches/release_90/test/MinGW/driver.test
URL: http://llvm.org/viewvc/llvm-project/lld/branches/release_90/test/MinGW/driver.test?rev=368134&r1=368133&r2=368134&view=diff
==============================================================================
--- lld/branches/release_90/test/MinGW/driver.test (original)
+++ lld/branches/release_90/test/MinGW/driver.test Wed Aug  7 01:34:28 2019
@@ -200,3 +200,7 @@ APPCONTAINER: -appcontainer
 # RUN: ld.lld -m i386pep --help 2>&1 | FileCheck -check-prefix=HELP %s
 # HELP: USAGE:
 # HELP: --enable-auto-import
+
+RUN: ld.lld -### -m i386pep foo.o -delayload user32.dll --delayload shell32.dll | FileCheck -check-prefix DELAYLOAD %s
+RUN: ld.lld -### -m i386pep foo.o -delayload=user32.dll --delayload=shell32.dll | FileCheck -check-prefix DELAYLOAD %s
+DELAYLOAD: -delayload:user32.dll -delayload:shell32.dll




More information about the llvm-branch-commits mailing list