diff --git a/pkgs/development/compilers/llvm/clang-ld-flags.patch b/pkgs/development/compilers/llvm/clang-ld-flags.patch new file mode 100644 index 00000000000..fc625a0e0b7 --- /dev/null +++ b/pkgs/development/compilers/llvm/clang-ld-flags.patch @@ -0,0 +1,45 @@ +diff -Naur a/tools/clang/lib/Driver/ToolChains.cpp b/tools/clang/lib/Driver/ToolChains.cpp +--- a/tools/clang/lib/Driver/ToolChains.cpp 2011-03-21 17:29:27.000000000 -0400 ++++ b/tools/clang/lib/Driver/ToolChains.cpp 2011-10-18 19:43:48.999590771 -0400 +@@ -1482,12 +1482,9 @@ + Lib = Lib64; + } + +- llvm::sys::Path LinkerPath(Base + "/../../../../" + GccTriple + "/bin/ld"); +- if (!llvm::sys::fs::exists(LinkerPath.str(), Exists) && Exists) +- Linker = LinkerPath.str(); +- else +- Linker = GetProgramPath("ld"); ++ Linker = GetProgramPath("ld"); + ++#if 0 + LinuxDistro Distro = DetectLinuxDistro(Arch); + + if (IsUbuntu(Distro)) { +@@ -1531,6 +1528,7 @@ + Paths.push_back(Base + "/../../.."); + if (Arch == getArch() && IsUbuntu(Distro)) + Paths.push_back("/usr/lib/" + GccTriple); ++#endif + } + + bool Linux::HasNativeLLVMSupport() const { +diff -Naur a/tools/clang/lib/Driver/Tools.cpp b/tools/clang/lib/Driver/Tools.cpp +--- a/tools/clang/lib/Driver/Tools.cpp 2011-03-06 18:31:01.000000000 -0500 ++++ b/tools/clang/lib/Driver/Tools.cpp 2011-10-18 18:44:00.799604267 -0400 +@@ -3619,6 +3619,7 @@ + ToolChain.getArch() == llvm::Triple::thumb || + (!Args.hasArg(options::OPT_static) && + !Args.hasArg(options::OPT_shared))) { ++#if 0 + CmdArgs.push_back("-dynamic-linker"); + if (ToolChain.getArch() == llvm::Triple::x86) + CmdArgs.push_back("/lib/ld-linux.so.2"); +@@ -3627,6 +3628,7 @@ + CmdArgs.push_back("/lib/ld-linux.so.3"); + else + CmdArgs.push_back("/lib64/ld-linux-x86-64.so.2"); ++#endif + } + + CmdArgs.push_back("-o"); diff --git a/pkgs/development/compilers/llvm/default.nix b/pkgs/development/compilers/llvm/default.nix index 3044acede21..c98005417c9 100644 --- a/pkgs/development/compilers/llvm/default.nix +++ b/pkgs/development/compilers/llvm/default.nix @@ -47,7 +47,7 @@ stdenv.mkDerivation ({ find ''; - patches = [ ./clang-include-paths.patch ]; + patches = [ ./clang-include-paths.patch ./clang-ld-flags.patch ]; # Set up the header file paths preConfigure = ''