Index: lld/trunk/MinGW/Driver.cpp =================================================================== --- lld/trunk/MinGW/Driver.cpp +++ lld/trunk/MinGW/Driver.cpp @@ -216,8 +216,10 @@ Add("-include:" + StringRef(A->getValue())); std::vector SearchPaths; - for (auto *A : Args.filtered(OPT_L)) + for (auto *A : Args.filtered(OPT_L)) { SearchPaths.push_back(A->getValue()); + Add("-libpath:" + StringRef(A->getValue())); + } StringRef Prefix = ""; bool Static = false; Index: lld/trunk/test/MinGW/driver.test =================================================================== --- lld/trunk/test/MinGW/driver.test +++ lld/trunk/test/MinGW/driver.test @@ -148,3 +148,6 @@ RUN: ld.lld -### foo.o -m i386pe -require-defined _foo --require-defined _bar -require-defined=_baz --require-defined=_foo2 | FileCheck -check-prefix=REQUIRE-DEFINED %s REQUIRE-DEFINED: -include:_foo -include:_bar -include:_baz -include:_foo2 + +RUN: ld.lld -### -m i386pep foo.o -Llibpath | FileCheck -check-prefix LIBPATH %s +LIBPATH: -libpath:libpath