Browse Source

libllvm: Fix patch and bump revision

android-5
Fredrik Fornwall 7 years ago
parent
commit
8ab024d0c0
  1. 2
      packages/libllvm/build.sh
  2. 20
      packages/libllvm/gcc_loop.patch
  3. 17
      packages/libllvm/tools-clang-lib-Driver-Tools.cpp.patch

2
packages/libllvm/build.sh

@ -2,7 +2,7 @@ TERMUX_PKG_HOMEPAGE=http://clang.llvm.org/
TERMUX_PKG_DESCRIPTION="Modular compiler and toolchain technologies library"
_PKG_MAJOR_VERSION=4.0
TERMUX_PKG_VERSION=${_PKG_MAJOR_VERSION}.1
TERMUX_PKG_REVISION=2
TERMUX_PKG_REVISION=3
TERMUX_PKG_SRCURL=http://llvm.org/releases/${TERMUX_PKG_VERSION}/llvm-${TERMUX_PKG_VERSION}.src.tar.xz
TERMUX_PKG_SHA256=da783db1f82d516791179fe103c71706046561f7972b18f0049242dee6712b51
TERMUX_PKG_HOSTBUILD=true

20
packages/libllvm/gcc_loop.patch

@ -1,20 +0,0 @@
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));

17
packages/libllvm/tools-clang-lib-Driver-Tools.cpp.patch

@ -1,6 +1,23 @@
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
@@ -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));
@@ -9357,9 +9357,12 @@
const llvm::Triple::ArchType Arch = ToolChain.getArch();
const bool isAndroid = ToolChain.getTriple().isAndroid();

Loading…
Cancel
Save