termux-packages/packages/libllvm/tools-clang-lib-Driver-Tool...

35 lines
1.7 KiB
Diff
Raw Normal View History

2016-09-04 22:17:03 +02:00
diff -u -r ../llvm-3.9.0.src/tools/clang/lib/Driver/Tools.cpp ./tools/clang/lib/Driver/Tools.cpp
--- ../llvm-3.9.0.src/tools/clang/lib/Driver/Tools.cpp 2016-08-13 16:43:56.000000000 -0400
+++ ./tools/clang/lib/Driver/Tools.cpp 2016-09-04 06:15:59.703422745 -0400
2017-09-02 02:30:19 +02:00
@@ -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));
2016-09-04 22:17:03 +02:00
@@ -9357,9 +9357,12 @@
2016-08-19 00:25:57 +02:00
const llvm::Triple::ArchType Arch = ToolChain.getArch();
const bool isAndroid = ToolChain.getTriple().isAndroid();
2016-09-04 22:17:03 +02:00
const bool IsIAMCU = ToolChain.getTriple().isOSIAMCU();
+ // Termux modification: Enable pie by default for Android and support the
+ // nopie flag.
2016-08-19 00:25:57 +02:00
const bool IsPIE =
!Args.hasArg(options::OPT_shared) && !Args.hasArg(options::OPT_static) &&
- (Args.hasArg(options::OPT_pie) || ToolChain.isPIEDefault());
2016-09-04 22:17:03 +02:00
+ (Args.hasArg(options::OPT_pie) || ToolChain.isPIEDefault() || isAndroid) &&
+ !Args.hasArg(options::OPT_nopie);
2016-08-19 00:25:57 +02:00
const bool HasCRTBeginEndFiles =
ToolChain.getTriple().hasEnvironment() ||
(ToolChain.getTriple().getVendor() != llvm::Triple::MipsTechnologies);