This fixes issues with -mms-bitfields together with "long double" on i686, and allows using the -static flag while building DLLs (to link dependent libraries statically), and implements stack probing for alloca calls on aarch64.
70 lines
1.8 KiB
Bash
Executable File
70 lines
1.8 KiB
Bash
Executable File
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
if [ $# -lt 1 ]; then
|
|
echo $0 dest
|
|
exit 1
|
|
fi
|
|
PREFIX="$1"
|
|
|
|
: ${CORES:=4}
|
|
|
|
if [ ! -d llvm ]; then
|
|
# When cloning master and checking out a pinned old hash, we can't use --depth=1.
|
|
# Do the git-svn rebase to populate git-svn information, to make
|
|
# "clang --version" produce SVN based version numbers.
|
|
git clone -b master https://github.com/llvm-mirror/llvm.git
|
|
cd llvm/tools
|
|
git clone -b master https://github.com/llvm-mirror/clang.git
|
|
git clone -b master https://github.com/llvm-mirror/lld.git
|
|
cd ..
|
|
git svn init https://llvm.org/svn/llvm-project/llvm/trunk
|
|
git config svn-remote.svn.fetch :refs/remotes/origin/master
|
|
git svn rebase -l
|
|
cd tools/clang
|
|
git svn init https://llvm.org/svn/llvm-project/cfe/trunk
|
|
git config svn-remote.svn.fetch :refs/remotes/origin/master
|
|
git svn rebase -l
|
|
cd ../lld
|
|
git svn init https://llvm.org/svn/llvm-project/lld/trunk
|
|
git config svn-remote.svn.fetch :refs/remotes/origin/master
|
|
git svn rebase -l
|
|
cd ../../..
|
|
CHECKOUT=1
|
|
fi
|
|
|
|
if [ -n "$SYNC" ] || [ -n "$CHECKOUT" ]; then
|
|
cd llvm
|
|
[ -z "$SYNC" ] || git fetch
|
|
git checkout 94aeacc62f8fe31aa76ef51fbd655f7f67fee251
|
|
cd tools/clang
|
|
[ -z "$SYNC" ] || git fetch
|
|
git checkout b4b42d682156c989482f9c03c0eb52e2c1b8aa90
|
|
cd ../lld
|
|
[ -z "$SYNC" ] || git fetch
|
|
git checkout bb9f186d26f72d9964bbc723c0ef942f0bf9cb92
|
|
cd ../../..
|
|
fi
|
|
|
|
if [ "$(which ninja)" != "" ]; then
|
|
CMAKE_GENERATOR="-G Ninja"
|
|
NINJA=1
|
|
fi
|
|
|
|
cd llvm
|
|
mkdir -p build
|
|
cd build
|
|
cmake \
|
|
$CMAKE_GENERATOR \
|
|
-DCMAKE_INSTALL_PREFIX="$PREFIX" \
|
|
-DCMAKE_BUILD_TYPE=Release \
|
|
-DLLVM_ENABLE_ASSERTIONS=ON \
|
|
-DLLVM_TARGETS_TO_BUILD="ARM;AArch64;X86" \
|
|
..
|
|
if [ -n "$NINJA" ]; then
|
|
ninja install
|
|
else
|
|
make -j$CORES install
|
|
fi
|