diff options
Diffstat (limited to 'lib/Driver')
-rw-r--r-- | lib/Driver/ToolChain.cpp | 3 | ||||
-rw-r--r-- | lib/Driver/ToolChains.cpp | 14 | ||||
-rw-r--r-- | lib/Driver/Tools.cpp | 10 |
3 files changed, 18 insertions, 9 deletions
diff --git a/lib/Driver/ToolChain.cpp b/lib/Driver/ToolChain.cpp index e4051a1..e305683 100644 --- a/lib/Driver/ToolChain.cpp +++ b/lib/Driver/ToolChain.cpp @@ -198,7 +198,8 @@ void ToolChain::AddClangCXXStdlibIncludeArgs(const ArgList &Args, switch (Type) { case ToolChain::CST_Libcxx: - CmdArgs.push_back("-cxx-system-include"); + CmdArgs.push_back("-nostdinc++"); + CmdArgs.push_back("-cxx-isystem"); CmdArgs.push_back("/usr/include/c++/v1"); break; diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp index 13b8b46..1c396bd 100644 --- a/lib/Driver/ToolChains.cpp +++ b/lib/Driver/ToolChains.cpp @@ -42,7 +42,7 @@ Darwin::Darwin(const HostInfo &Host, const llvm::Triple& Triple) // Compute the initial Darwin version based on the host. bool HadExtra; std::string OSName = Triple.getOSName(); - if (!Driver::GetReleaseVersion(&OSName[6], + if (!Driver::GetReleaseVersion(&OSName.c_str()[6], DarwinVersion[0], DarwinVersion[1], DarwinVersion[2], HadExtra)) getDriver().Diag(clang::diag::err_drv_invalid_darwin_version) << OSName; @@ -1271,6 +1271,7 @@ Tool &AuroraUX::SelectTool(const Compilation &C, const JobAction &JA) const { /// Linux toolchain (very bare-bones at the moment). enum LinuxDistro { + ArchLinux, DebianLenny, DebianSqueeze, Exherbo, @@ -1367,6 +1368,9 @@ static LinuxDistro DetectLinuxDistro(llvm::Triple::ArchType Arch) { if (!llvm::sys::fs::exists("/etc/exherbo-release", Exists) && Exists) return Exherbo; + if (!llvm::sys::fs::exists("/etc/arch-release", Exists) && Exists) + return ArchLinux; + return UnknownDistro; } @@ -1436,8 +1440,9 @@ Linux::Linux(const HostInfo &Host, const llvm::Triple &Triple) GccTriple = "i586-suse-linux"; } - const char* GccVersions[] = {"4.5.1", "4.5", "4.4.5", "4.4.4", "4.4.3", "4.4", - "4.3.4", "4.3.3", "4.3.2"}; + const char* GccVersions[] = {"4.5.2", "4.5.1", "4.5", "4.4.5", "4.4.4", + "4.4.3", "4.4", "4.3.4", "4.3.3", "4.3.2", + "4.3"}; std::string Base = ""; for (unsigned i = 0; i < sizeof(GccVersions)/sizeof(char*); ++i) { std::string Suffix = GccTriple + "/" + GccVersions[i]; @@ -1498,6 +1503,9 @@ Linux::Linux(const HostInfo &Host, const llvm::Triple &Triple) Distro == UbuntuKarmic) ExtraOpts.push_back("--build-id"); + if (Distro == ArchLinux) + Lib = "lib"; + Paths.push_back(Base + Suffix); if (HasMultilib(Arch, Distro)) { if (IsOpenSuse(Distro) && Is32Bits) diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index 6717349..9f4a0bc 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -1546,10 +1546,10 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, CmdArgs.push_back("-fobjc-default-synthesize-properties"); } - // -fobjc-exceptions is default. - if (!Args.hasFlag(options::OPT_fobjc_exceptions, - options::OPT_fno_objc_exceptions)) - CmdArgs.push_back("-fno-objc-exceptions"); + // -fno-objc-exceptions is default. + if (IsRewriter || Args.hasFlag(options::OPT_fobjc_exceptions, + options::OPT_fno_objc_exceptions)) + CmdArgs.push_back("-fobjc-exceptions"); } if (!Args.hasFlag(options::OPT_fassume_sane_operator_new, @@ -3085,7 +3085,7 @@ void openbsd::Link::ConstructJob(Compilation &C, const JobAction &JA, CmdArgs.push_back("-lgcc"); if (Args.hasArg(options::OPT_pthread)) - CmdArgs.push_back("-pthread"); + CmdArgs.push_back("-lpthread"); if (!Args.hasArg(options::OPT_shared)) CmdArgs.push_back("-lc"); CmdArgs.push_back("-lgcc"); |