getProgramPaths().push_back(Path);
}
-void DarwinClang::AddLinkSearchPathArgs(const ArgList &Args,
- ArgStringList &CmdArgs) const {
- // The Clang toolchain uses explicit paths for internal libraries.
-
- // Unfortunately, we still might depend on a few of the libraries that are
- // only available in the gcc library directory (in particular
- // libstdc++.dylib). For now, hardcode the path to the known install location.
- // FIXME: This should get ripped out someday. However, when building on
- // 10.6 (darwin10), we're still relying on this to find libstdc++.dylib.
- llvm::sys::Path P(getDriver().Dir);
- P.eraseComponent(); // .../usr/bin -> ../usr
- P.appendComponent("llvm-gcc-4.2");
- P.appendComponent("lib");
- P.appendComponent("gcc");
- switch (getTriple().getArch()) {
- default:
- llvm_unreachable("Invalid Darwin arch!");
- case llvm::Triple::x86:
- case llvm::Triple::x86_64:
- P.appendComponent("i686-apple-darwin10");
- break;
- case llvm::Triple::arm:
- case llvm::Triple::thumb:
- P.appendComponent("arm-apple-darwin10");
- break;
- case llvm::Triple::ppc:
- case llvm::Triple::ppc64:
- P.appendComponent("powerpc-apple-darwin10");
- break;
- }
- P.appendComponent("4.2.1");
-
- // Determine the arch specific GCC subdirectory.
- const char *ArchSpecificDir = 0;
- switch (getTriple().getArch()) {
- default:
- break;
- case llvm::Triple::arm:
- case llvm::Triple::thumb: {
- std::string Triple = ComputeLLVMTriple(Args);
- StringRef TripleStr = Triple;
- if (TripleStr.startswith("armv5") || TripleStr.startswith("thumbv5"))
- ArchSpecificDir = "v5";
- else if (TripleStr.startswith("armv6") || TripleStr.startswith("thumbv6"))
- ArchSpecificDir = "v6";
- else if (TripleStr.startswith("armv7") || TripleStr.startswith("thumbv7"))
- ArchSpecificDir = "v7";
- break;
- }
- case llvm::Triple::ppc64:
- ArchSpecificDir = "ppc64";
- break;
- case llvm::Triple::x86_64:
- ArchSpecificDir = "x86_64";
- break;
- }
-
- if (ArchSpecificDir) {
- P.appendComponent(ArchSpecificDir);
- bool Exists;
- if (!llvm::sys::fs::exists(P.str(), Exists) && Exists)
- CmdArgs.push_back(Args.MakeArgString("-L" + P.str()));
- P.eraseComponent();
- }
-
- bool Exists;
- if (!llvm::sys::fs::exists(P.str(), Exists) && Exists)
- CmdArgs.push_back(Args.MakeArgString("-L" + P.str()));
-}
-
void DarwinClang::AddLinkARCArgs(const ArgList &Args,
ArgStringList &CmdArgs) const {
return TargetVersion < VersionTuple(V0, V1, V2);
}
- /// AddLinkSearchPathArgs - Add the linker search paths to \arg CmdArgs.
- ///
- /// \param Args - The input argument list.
- /// \param CmdArgs [out] - The command argument list to append the paths
- /// (prefixed by -L) to.
- virtual void AddLinkSearchPathArgs(const ArgList &Args,
- ArgStringList &CmdArgs) const = 0;
-
/// AddLinkARCArgs - Add the linker arguments to link the ARC runtime library.
virtual void AddLinkARCArgs(const ArgList &Args,
ArgStringList &CmdArgs) const = 0;
/// @name Darwin ToolChain Implementation
/// {
- virtual void AddLinkSearchPathArgs(const ArgList &Args,
- ArgStringList &CmdArgs) const;
-
virtual void AddLinkRuntimeLibArgs(const ArgList &Args,
ArgStringList &CmdArgs) const;
void AddLinkRuntimeLib(const ArgList &Args, ArgStringList &CmdArgs,