diff --git a/scripts/build-clang.sh b/scripts/build-clang.sh new file mode 100755 index 000000000..d88c50d9b --- /dev/null +++ b/scripts/build-clang.sh @@ -0,0 +1,53 @@ +#!/bin/bash +# Script to build clang with patch to make executables +# position-independent on Android by default. +# Currently unused as the clang binary in the NDK is used +# instead, wrapped with clang-pie-wrapper. + +set -e -u + +LLVM_VERSION=3.9.1 + +rm -Rf $HOME/clang-build +mkdir -p $HOME/clang-build +cd $HOME/clang-build + +curl -L --fail --retry 2 -o llvm.tar.xz \ + http://llvm.org/releases/${LLVM_VERSION}/llvm-${LLVM_VERSION}.src.tar.xz +TERMUX_PKG_SHA256=1fd90354b9cf19232e8f168faf2220e79be555df3aa743242700879e8fd329ee +curl -L --fail --retry 2 -o clang.tar.xz \ + http://llvm.org/releases/${LLVM_VERSION}/cfe-${LLVM_VERSION}.src.tar.xz + +tar xf llvm.tar.xz +tar xf clang.tar.xz + +mv llvm-3.9.1.src src +mv cfe-$LLVM_VERSION.src src/tools/clang +cd src + +patch -p1 <