chiark / gitweb /
clang: Disable calling into gcc from clang.
authorVladimir Serbinenko <phcoder@google.com>
Fri, 1 Sep 2017 00:16:41 +0000 (02:16 +0200)
committerFredrik Fornwall <fredrik@fornwall.net>
Fri, 1 Sep 2017 23:45:45 +0000 (01:45 +0200)
Clang calls into gcc if it tries to compile a language it doesn't understand.
On termux gcc is a symlink to clang, so this leads into fork loop until
the whole system runs out of memory.

packages/libllvm/gcc_loop.patch [new file with mode: 0644]

diff --git a/packages/libllvm/gcc_loop.patch b/packages/libllvm/gcc_loop.patch
new file mode 100644 (file)
index 0000000..06dded8
--- /dev/null
@@ -0,0 +1,20 @@
+Disable calling into gcc from clang.
+
+Clang calls into gcc if it tries to compile a language it doesn't understand.
+On termux gcc is a symlink to clang, so this leads into fork loop until
+the whole system runs out of memory.
+
+--- libllvm/tools/clang/lib/Driver/ToolChains/Gnu.cpp  2017-08-31 21:08:36.602287744 +0200
++++ libllvm-mod/tools/clang/lib/Driver/ToolChains/Gnu.cpp      2017-09-01 01:00:41.695209952 +0200
+@@ -157,9 +157,9 @@
+   if (!customGCCName.empty())
+     GCCName = customGCCName.c_str();
+   else if (D.CCCIsCXX()) {
+-    GCCName = "g++";
++    GCCName = "false";
+   } else
+-    GCCName = "gcc";
++    GCCName = "false";
+   const char *Exec = Args.MakeArgString(getToolChain().GetProgramPath(GCCName));
+   C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));