aboutsummaryrefslogtreecommitdiff
path: root/lld/MinGW
diff options
context:
space:
mode:
authorMartin Storsjo <martin@martin.st>2018-09-10 17:41:40 +0000
committerMartin Storsjo <martin@martin.st>2018-09-10 17:41:40 +0000
commitdb62913f2850f93dfcd1434af031ec315a99e4b9 (patch)
treeea1ddb9063b9a70575d45e1ad93711268ad6b1b3 /lld/MinGW
parent7feb3ed78c10bcc72a20a878fb9449385aef4082 (diff)
downloadllvm-project-db62913f2850f93dfcd1434af031ec315a99e4b9.tar.gz
[MinGW] Hook up the --require-defined option to -include:
Differential Revision: https://reviews.llvm.org/D51840 llvm-svn: 341846
Diffstat (limited to 'lld/MinGW')
-rw-r--r--lld/MinGW/Driver.cpp3
-rw-r--r--lld/MinGW/Options.td3
2 files changed, 6 insertions, 0 deletions
diff --git a/lld/MinGW/Driver.cpp b/lld/MinGW/Driver.cpp
index 27a5550ec9c7..dc9b046c5d13 100644
--- a/lld/MinGW/Driver.cpp
+++ b/lld/MinGW/Driver.cpp
@@ -212,6 +212,9 @@ bool mingw::link(ArrayRef<const char *> ArgsArr, raw_ostream &Diag) {
else
Add("-alternatename:__image_base__=__ImageBase");
+ for (auto *A : Args.filtered(OPT_require_defined))
+ Add("-include:" + StringRef(A->getValue()));
+
std::vector<StringRef> SearchPaths;
for (auto *A : Args.filtered(OPT_L))
SearchPaths.push_back(A->getValue());
diff --git a/lld/MinGW/Options.td b/lld/MinGW/Options.td
index ad699f71134a..948faa687521 100644
--- a/lld/MinGW/Options.td
+++ b/lld/MinGW/Options.td
@@ -40,6 +40,9 @@ def strip_debug: F<"strip-debug">,
def whole_archive: F<"whole-archive">,
HelpText<"Include all object files for following archives">;
def verbose: F<"verbose">, HelpText<"Verbose mode">;
+def require_defined: S<"require-defined">,
+ HelpText<"Force symbol to be added to symbol table as an undefined one">;
+def require_defined_eq: J<"require-defined=">, Alias<require_defined>;
// LLD specific options
def _HASH_HASH_HASH : Flag<["-"], "###">,