clang: Don't send extra -I flags to the linker

svn path=/nixpkgs/trunk/; revision=29883
This commit is contained in:
Shea Levy 2011-10-19 04:14:55 +00:00
parent db619f2d55
commit 1ed93241cd
2 changed files with 46 additions and 1 deletions

View File

@ -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");

View File

@ -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 = ''