diff --git a/clang/lib/Driver/ToolChains/Darwin.cpp b/clang/lib/Driver/ToolChains/Darwin.cpp --- a/clang/lib/Driver/ToolChains/Darwin.cpp +++ b/clang/lib/Driver/ToolChains/Darwin.cpp @@ -615,6 +615,8 @@ Args.AddAllArgs(CmdArgs, options::OPT_L); + getToolChain().AddFilePathLibArgs(Args, CmdArgs); + AddLinkerInputs(getToolChain(), Inputs, Args, CmdArgs, JA); // Build the input file for -filelist (list of linker input files) in case we // need it later @@ -802,6 +804,7 @@ getProgramPaths().push_back(getDriver().getInstalledDir()); if (getDriver().getInstalledDir() != getDriver().Dir) getProgramPaths().push_back(getDriver().Dir); + getFilePaths().push_back(getDriver().Dir + "/../lib"); } /// Darwin - Darwin tool chain for i386 and x86_64. diff --git a/clang/test/Driver/darwin-ld.c b/clang/test/Driver/darwin-ld.c --- a/clang/test/Driver/darwin-ld.c +++ b/clang/test/Driver/darwin-ld.c @@ -365,3 +365,8 @@ // RUN: FileCheck -check-prefix=MNO_OUTLINE %s < %t.log // MNO_OUTLINE: {{ld(.exe)?"}} // MNO_OUTLINE-SAME: "-mllvm" "-enable-machine-outliner=never" + +// RUN: %clang -target x86_64-apple-darwin10 -### %t.o 2> %t.log +// RUN: FileCheck -check-prefix=INSTALL-DIR %s < %t.log +// INSTALL-DIR: InstalledDir: [[INSTALLDIR:.+$]] +// INSTALL-DIR: "-L[[INSTALLDIR]]/../lib"