Index: lib/Driver/ToolChains.cpp =================================================================== --- lib/Driver/ToolChains.cpp +++ lib/Driver/ToolChains.cpp @@ -4203,10 +4203,7 @@ getFilePaths().push_back(getDriver().Dir + "/../lib"); getFilePaths().push_back("/usr/lib"); - if (D.getVFS().exists("/usr/lib/gcc47")) - getFilePaths().push_back("/usr/lib/gcc47"); - else - getFilePaths().push_back("/usr/lib/gcc44"); + getFilePaths().push_back("/usr/lib/gcc50"); } Tool *DragonFly::buildAssembler() const { Index: lib/Driver/Tools.cpp =================================================================== --- lib/Driver/Tools.cpp +++ lib/Driver/Tools.cpp @@ -8978,7 +8978,6 @@ const char *LinkingOutput) const { const Driver &D = getToolChain().getDriver(); ArgStringList CmdArgs; - bool UseGCC47 = llvm::sys::fs::exists("/usr/lib/gcc47"); if (!D.SysRoot.empty()) CmdArgs.push_back(Args.MakeArgString("--sysroot=" + D.SysRoot)); @@ -8995,7 +8994,8 @@ CmdArgs.push_back("-dynamic-linker"); CmdArgs.push_back("/usr/libexec/ld-elf.so.2"); } - CmdArgs.push_back("--hash-style=both"); + CmdArgs.push_back("--hash-style=gnu"); + CmdArgs.push_back("--enable-new-dtags"); } // When building 32-bit code on DragonFly/pc64, we have to explicitly @@ -9041,21 +9041,11 @@ AddLinkerInputs(getToolChain(), Inputs, Args, CmdArgs); if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nodefaultlibs)) { - // FIXME: GCC passes on -lgcc, -lgcc_pic and a whole lot of - // rpaths - if (UseGCC47) - CmdArgs.push_back("-L/usr/lib/gcc47"); - else - CmdArgs.push_back("-L/usr/lib/gcc44"); + CmdArgs.push_back("-L/usr/lib/gcc50"); if (!Args.hasArg(options::OPT_static)) { - if (UseGCC47) { - CmdArgs.push_back("-rpath"); - CmdArgs.push_back("/usr/lib/gcc47"); - } else { - CmdArgs.push_back("-rpath"); - CmdArgs.push_back("/usr/lib/gcc44"); - } + CmdArgs.push_back("-rpath"); + CmdArgs.push_back("/usr/lib/gcc50"); } if (D.CCCIsCXX()) { @@ -9070,28 +9060,20 @@ CmdArgs.push_back("-lc"); } - if (UseGCC47) { - if (Args.hasArg(options::OPT_static) || - Args.hasArg(options::OPT_static_libgcc)) { + if (Args.hasArg(options::OPT_static) || + Args.hasArg(options::OPT_static_libgcc)) { CmdArgs.push_back("-lgcc"); CmdArgs.push_back("-lgcc_eh"); - } else { - if (Args.hasArg(options::OPT_shared_libgcc)) { + } else { + if (Args.hasArg(options::OPT_shared_libgcc)) { CmdArgs.push_back("-lgcc_pic"); if (!Args.hasArg(options::OPT_shared)) CmdArgs.push_back("-lgcc"); - } else { + } else { CmdArgs.push_back("-lgcc"); CmdArgs.push_back("--as-needed"); CmdArgs.push_back("-lgcc_pic"); CmdArgs.push_back("--no-as-needed"); - } - } - } else { - if (Args.hasArg(options::OPT_shared)) { - CmdArgs.push_back("-lgcc_pic"); - } else { - CmdArgs.push_back("-lgcc"); } } } Index: lib/Frontend/InitHeaderSearch.cpp =================================================================== --- lib/Frontend/InitHeaderSearch.cpp +++ lib/Frontend/InitHeaderSearch.cpp @@ -408,10 +408,7 @@ } break; case llvm::Triple::DragonFly: - if (llvm::sys::fs::exists("/usr/lib/gcc47")) - AddPath("/usr/include/c++/4.7", CXXSystem, false); - else - AddPath("/usr/include/c++/4.4", CXXSystem, false); + AddPath("/usr/include/c++/5.0", CXXSystem, false); break; case llvm::Triple::OpenBSD: { std::string t = triple.getTriple(); Index: test/Driver/dragonfly.c =================================================================== --- test/Driver/dragonfly.c +++ test/Driver/dragonfly.c @@ -2,6 +2,6 @@ // RUN: FileCheck -input-file %t.log %s // CHECK: clang{{.*}}" "-cc1" "-triple" "x86_64-pc-dragonfly" -// CHECK: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/usr/libexec/ld-elf.so.{{.*}}" "--hash-style=both" "-o" "a.out" "{{.*}}crt1.o" "{{.*}}crti.o" "{{.*}}crtbegin.o" "{{.*}}.o" "-L{{.*}}gcc4{{.*}}" "-rpath" "{{.*}}gcc4{{.*}}" "-lc" "-lgcc" "{{.*}}crtend.o" "{{.*}}crtn.o" +// CHECK: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/usr/libexec/ld-elf.so.{{.*}}" "--hash-style=gnu" "-o" "a.out" "{{.*}}crt1.o" "{{.*}}crti.o" "{{.*}}crtbegin.o" "{{.*}}.o" "-L{{.*}}gcc{{.*}}" "-rpath" "{{.*}}gcc{{.*}}" "-lc" "-lgcc" "{{.*}}crtend.o" "{{.*}}crtn.o"