[lld] r344123 - [MinGW] Pass libpath to the COFF linker
Martin Storsjo via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 10 02:00:04 PDT 2018
Author: mstorsjo
Date: Wed Oct 10 02:00:03 2018
New Revision: 344123
URL: http://llvm.org/viewvc/llvm-project?rev=344123&view=rev
Log:
[MinGW] Pass libpath to the COFF linker
This is necessary for handling defaultlib directives embedded in
object files, unless they use an absolute path.
Differential Revision: https://reviews.llvm.org/D53015
Modified:
lld/trunk/MinGW/Driver.cpp
lld/trunk/test/MinGW/driver.test
Modified: lld/trunk/MinGW/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/MinGW/Driver.cpp?rev=344123&r1=344122&r2=344123&view=diff
==============================================================================
--- lld/trunk/MinGW/Driver.cpp (original)
+++ lld/trunk/MinGW/Driver.cpp Wed Oct 10 02:00:03 2018
@@ -216,8 +216,10 @@ bool mingw::link(ArrayRef<const char *>
Add("-include:" + StringRef(A->getValue()));
std::vector<StringRef> 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;
Modified: lld/trunk/test/MinGW/driver.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/MinGW/driver.test?rev=344123&r1=344122&r2=344123&view=diff
==============================================================================
--- lld/trunk/test/MinGW/driver.test (original)
+++ lld/trunk/test/MinGW/driver.test Wed Oct 10 02:00:03 2018
@@ -148,3 +148,6 @@ MAP: -lldmap:bar.map
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
More information about the llvm-commits
mailing list