summaryrefslogtreecommitdiffstats
path: root/lld/lib/Driver/DarwinLdDriver.cpp
diff options
context:
space:
mode:
authorTim Northover <tnorthover@apple.com>2014-07-10 11:46:08 +0000
committerTim Northover <tnorthover@apple.com>2014-07-10 11:46:08 +0000
commit18af0573dfcd8a23e22ca3faa031373b89d8475a (patch)
tree8cd58103bf118d110f2d6a99e24100cec93c3eb7 /lld/lib/Driver/DarwinLdDriver.cpp
parent02bb0ec3687f5045fd55de08b515909e8406af74 (diff)
downloadbcm5719-llvm-18af0573dfcd8a23e22ca3faa031373b89d8475a.tar.gz
bcm5719-llvm-18af0573dfcd8a23e22ca3faa031373b89d8475a.zip
[mach-o]: support user-specified (-L) library search paths
llvm-svn: 212712
Diffstat (limited to 'lld/lib/Driver/DarwinLdDriver.cpp')
-rw-r--r--lld/lib/Driver/DarwinLdDriver.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/lld/lib/Driver/DarwinLdDriver.cpp b/lld/lib/Driver/DarwinLdDriver.cpp
index 64107d80629..34eca5da39a 100644
--- a/lld/lib/Driver/DarwinLdDriver.cpp
+++ b/lld/lib/Driver/DarwinLdDriver.cpp
@@ -296,8 +296,12 @@ bool DarwinLdDriver::parse(int argc, const char *argv[],
syslibRoots.push_back(syslibRoot->getValue());
}
- // FIXME: handle -L options: these get added *before* the default paths,
- // possibly modified by any syslibroot options.
+ // Paths specified with -L come first, and are not considered system paths for
+ // the case where there is precisely 1 -syslibroot.
+ for (auto libPath : parsedArgs->filtered(OPT_L)) {
+ ctx.addModifiedSearchDir(libPath->getValue(), syslibRoots, false);
+ }
+
ctx.addModifiedSearchDir("/usr/lib", syslibRoots, true);
ctx.addModifiedSearchDir("/usr/local/lib", syslibRoots, true);
OpenPOWER on IntegriCloud