+@@ -7415,10 +7415,12 @@
+ const char *GCCName;
+ if (!customGCCName.empty())
+ GCCName = customGCCName.c_str();
+- else if (D.CCCIsCXX()) {
+- GCCName = "g++";
+- } else
+- GCCName = "gcc";
++ else
++ // Termux modification: 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.
++ GCCName = "false";
+
+ const char *Exec = Args.MakeArgString(getToolChain().GetProgramPath(GCCName));
+ C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));