chiark / gitweb /
preload-hacks: Some patches to make it work.
[termux-packages] / packages / libllvm / tools-clang-lib-Driver-ToolChains-Gnu.cpp.patch
1 diff -u -r ../llvm-5.0.0.src/tools/clang/lib/Driver/ToolChains/Gnu.cpp ./tools/clang/lib/Driver/ToolChains/Gnu.cpp
2 --- ../llvm-5.0.0.src/tools/clang/lib/Driver/ToolChains/Gnu.cpp 2017-08-11 03:47:32.000000000 +0200
3 +++ ./tools/clang/lib/Driver/ToolChains/Gnu.cpp 2017-09-10 20:14:54.636653647 +0200
4 @@ -152,14 +152,11 @@
5      }
6    }
7  
8 -  const std::string &customGCCName = D.getCCCGenericGCCName();
9 -  const char *GCCName;
10 -  if (!customGCCName.empty())
11 -    GCCName = customGCCName.c_str();
12 -  else if (D.CCCIsCXX()) {
13 -    GCCName = "g++";
14 -  } else
15 -    GCCName = "gcc";
16 +  // Termux modification: Disable calling into gcc from clang.
17 +  // Clang calls into gcc if it tries to compile a language it doesn't understand.
18 +  // On Termux gcc is a symlink to clang, so this leads into fork loop until
19 +  // the whole system runs out of memory.
20 +  const char *GCCName = "false";
21  
22    const char *Exec = Args.MakeArgString(getToolChain().GetProgramPath(GCCName));
23    C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));