From 0b0122e72a75582d009ac250efc557044c1a8372 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Fri, 1 Sep 2017 02:16:41 +0200 Subject: [PATCH] clang: 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. --- packages/libllvm/gcc_loop.patch | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 packages/libllvm/gcc_loop.patch diff --git a/packages/libllvm/gcc_loop.patch b/packages/libllvm/gcc_loop.patch new file mode 100644 index 000000000..06dded895 --- /dev/null +++ b/packages/libllvm/gcc_loop.patch @@ -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(JA, *this, Exec, CmdArgs, Inputs));