summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lld/MinGW/Driver.cpp2
-rw-r--r--lld/MinGW/Options.td1
-rw-r--r--lld/test/MinGW/driver.test3
3 files changed, 6 insertions, 0 deletions
diff --git a/lld/MinGW/Driver.cpp b/lld/MinGW/Driver.cpp
index be1b757e45b..f981e6ebee2 100644
--- a/lld/MinGW/Driver.cpp
+++ b/lld/MinGW/Driver.cpp
@@ -216,6 +216,8 @@ bool mingw::link(ArrayRef<const char *> argsArr, raw_ostream &diag) {
add("-base:" + StringRef(a->getValue()));
if (auto *a = args.getLastArg(OPT_map))
add("-lldmap:" + StringRef(a->getValue()));
+ if (auto *a = args.getLastArg(OPT_reproduce))
+ add("-reproduce:" + StringRef(a->getValue()));
if (auto *a = args.getLastArg(OPT_o))
add("-out:" + StringRef(a->getValue()));
diff --git a/lld/MinGW/Options.td b/lld/MinGW/Options.td
index aa57cb32673..17a964c119b 100644
--- a/lld/MinGW/Options.td
+++ b/lld/MinGW/Options.td
@@ -63,6 +63,7 @@ def strip_all: F<"strip-all">,
HelpText<"Omit all symbol information from the output binary">;
def strip_debug: F<"strip-debug">,
HelpText<"Omit all debug information, but keep symbol information">;
+defm reproduce: Eq<"reproduce", "Write a tar file containing input files and command line options to reproduce link">;
defm undefined: Eq<"undefined", "Include symbol in the link, if available">;
def whole_archive: F<"whole-archive">,
HelpText<"Include all object files for following archives">;
diff --git a/lld/test/MinGW/driver.test b/lld/test/MinGW/driver.test
index 8fa1199af3f..b16c814d8a3 100644
--- a/lld/test/MinGW/driver.test
+++ b/lld/test/MinGW/driver.test
@@ -189,6 +189,9 @@ UNDEFINED: -includeoptional:_foo -includeoptional:_bar -includeoptional:_baz -in
RUN: ld.lld -### -m i386pep foo.o -Llibpath | FileCheck -check-prefix LIBPATH %s
LIBPATH: -libpath:libpath
+RUN: ld.lld -### -m i386pep foo.o --reproduce=foo.tar | FileCheck -check-prefix REPRO %s
+REPRO: -reproduce:foo.tar
+
RUN: ld.lld -### -m i386pep foo.o --no-insert-timestamp | FileCheck -check-prefix NOTIMESTAMP %s
RUN: ld.lld -### -m i386pep foo.o --insert-timestamp --no-insert-timestamp | FileCheck -check-prefix NOTIMESTAMP %s
NOTIMESTAMP: -timestamp:0
OpenPOWER on IntegriCloud