diff --git a/lld/MinGW/Driver.cpp b/lld/MinGW/Driver.cpp --- a/lld/MinGW/Driver.cpp +++ b/lld/MinGW/Driver.cpp @@ -348,6 +348,8 @@ add("-includeoptional:" + StringRef(a->getValue())); for (auto *a : args.filtered(OPT_delayload)) add("-delayload:" + StringRef(a->getValue())); + for (auto *a : args.filtered(OPT_thinlto_cache_dir)) + add("-lldltocache:" + StringRef(a->getValue())); std::vector searchPaths; for (auto *a : args.filtered(OPT_L)) { diff --git a/lld/MinGW/Options.td b/lld/MinGW/Options.td --- a/lld/MinGW/Options.td +++ b/lld/MinGW/Options.td @@ -81,6 +81,10 @@ defm require_defined: Eq<"require-defined", "Force symbol to be added to symbol table as an undefined one">; +// ThinLTO options +defm thinlto_cache_dir: Eq<"thinlto-cache-dir", + "Path to ThinLTO cached object file directory">; + // LLD specific options def _HASH_HASH_HASH : Flag<["-"], "###">, HelpText<"Print (but do not run) the commands to run for this compilation">; diff --git a/lld/test/MinGW/driver.test b/lld/test/MinGW/driver.test --- a/lld/test/MinGW/driver.test +++ b/lld/test/MinGW/driver.test @@ -241,3 +241,6 @@ RUN: ld.lld -### -m i386pep foo.o --disable-runtime-pseudo-reloc | FileCheck -check-prefix DISABLE_RUNTIME_PSEUDO_RELOC %s RUN: ld.lld -### -m i386pep foo.o -disable-runtime-pseudo-reloc | FileCheck -check-prefix DISABLE_RUNTIME_PSEUDO_RELOC %s DISABLE_RUNTIME_PSEUDO_RELOC: -runtime-pseudo-reloc:no + +RUN: ld.lld -### foo.o -m i386pe --thinlto-cache-dir=_foo | FileCheck -check-prefix=THINLTO_CACHEDIR %s +THINLTO_CACHEDIR: -lldltocache:_foo \ No newline at end of file