chiark / gitweb /
clang: Disable calling into gcc from clang.
[termux-packages] / packages / libllvm / gcc_loop.patch
1 Disable calling into gcc from clang.
2
3 Clang calls into gcc if it tries to compile a language it doesn't understand.
4 On termux gcc is a symlink to clang, so this leads into fork loop until
5 the whole system runs out of memory.
6
7 --- libllvm/tools/clang/lib/Driver/ToolChains/Gnu.cpp   2017-08-31 21:08:36.602287744 +0200
8 +++ libllvm-mod/tools/clang/lib/Driver/ToolChains/Gnu.cpp       2017-09-01 01:00:41.695209952 +0200
9 @@ -157,9 +157,9 @@
10    if (!customGCCName.empty())
11      GCCName = customGCCName.c_str();
12    else if (D.CCCIsCXX()) {
13 -    GCCName = "g++";
14 +    GCCName = "false";
15    } else
16 -    GCCName = "gcc";
17 +    GCCName = "false";
18  
19    const char *Exec = Args.MakeArgString(getToolChain().GetProgramPath(GCCName));
20    C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));