From: Vladimir Serbinenko Date: Fri, 1 Sep 2017 00:16:41 +0000 (+0200) Subject: clang: Disable calling into gcc from clang. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/termux-packages/commitdiff_plain/1a709d1143eb70b33e7e4df808f00b6caf2b8c29?ds=inline 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. --- diff --git a/packages/libllvm/gcc_loop.patch b/packages/libllvm/gcc_loop.patch new file mode 100644 index 00000000..06dded89 --- /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));