From 098f6750d792c2515acb31619df5a3cfca780c77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Mon, 15 Jan 2018 11:19:01 +0200 Subject: [PATCH] Automatically extract the clang version number when installing compiler-rt --- Dockerfile | 2 +- build-all.sh | 2 +- build-compiler-rt.sh | 7 ++++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index d81c13d..540a0be 100644 --- a/Dockerfile +++ b/Dockerfile @@ -39,7 +39,7 @@ RUN ./build-mingw-w64.sh $TOOLCHAIN_PREFIX # Build compiler-rt COPY build-compiler-rt.sh . -RUN ./build-compiler-rt.sh $TOOLCHAIN_PREFIX 6.0.0 +RUN ./build-compiler-rt.sh $TOOLCHAIN_PREFIX # Build C test applications WORKDIR /build diff --git a/build-all.sh b/build-all.sh index 9a78baa..b2b6cf6 100755 --- a/build-all.sh +++ b/build-all.sh @@ -11,5 +11,5 @@ PREFIX="$1" ./build-llvm.sh $PREFIX ./install-wrappers.sh $PREFIX ./build-mingw-w64.sh $PREFIX -./build-compiler-rt.sh $PREFIX 6.0.0 +./build-compiler-rt.sh $PREFIX ./build-libcxx.sh $PREFIX diff --git a/build-compiler-rt.sh b/build-compiler-rt.sh index e158add..edea545 100755 --- a/build-compiler-rt.sh +++ b/build-compiler-rt.sh @@ -2,17 +2,18 @@ set -e -if [ $# -lt 2 ]; then - echo $0 dest clang-version +if [ $# -lt 1 ]; then + echo $0 dest exit 1 fi PREFIX="$1" -CLANG_VERSION="$2" export PATH=$PREFIX/bin:$PATH : ${CORES:=4} : ${ARCHS:=${TOOLCHAIN_ARCHS-i686 x86_64 armv7 aarch64}} +CLANG_VERSION=$(basename $(dirname $(dirname $(dirname $($PREFIX/bin/clang --print-libgcc-file-name -rtlib=compiler-rt))))) + if [ ! -d compiler-rt ]; then git clone -b master https://github.com/llvm-mirror/compiler-rt.git CHECKOUT=1