From 9cba8c4c27451c3185e419e8e77ef960d7e87b63 Mon Sep 17 00:00:00 2001 From: Penny Zheng Date: Thu, 20 Feb 2020 09:54:09 +0800 Subject: [PATCH] musl: install musl on aarch64 The original musl-installing method is only for x86_64 and i386(see musl config.mak template file). musl.cc provides small and reliable pre-built musl toolchains for many architectures. Static so they run on supported platforms without dependencies. Fixes: #411 Signed-off-by: Penny Zheng --- scripts/lib.sh | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/scripts/lib.sh b/scripts/lib.sh index 1ddaa5fce..c7a09aeb8 100644 --- a/scripts/lib.sh +++ b/scripts/lib.sh @@ -296,9 +296,23 @@ RUN pushd /root; \ make install > /dev/null 2>\&1; \ popd " - local musl_tar="musl-${MUSL_VERSION}.tar.gz" - local musl_dir="musl-${MUSL_VERSION}" - readonly install_musl=" + # install musl for compiling rust-agent + install_musl= + if [ "${muslarch}" == "aarch64" ]; then + local musl_tar="${muslarch}-linux-musl-native.tgz" + local musl_dir="${muslarch}-linux-musl-native" + install_musl=" +RUN cd /tmp; \ + curl -sLO https://musl.cc/${musl_tar}; tar -zxf ${musl_tar}; \ + mkdir -p /usr/local/musl/; \ + cp -r ${musl_dir}/* /usr/local/musl/ +ENV PATH=\$PATH:/usr/local/musl/bin +RUN ln -sf /usr/local/musl/bin/g++ /usr/bin/g++ +" + else + local musl_tar="musl-${MUSL_VERSION}.tar.gz" + local musl_dir="musl-${MUSL_VERSION}" + install_musl=" RUN pushd /root; \ curl -sLO https://www.musl-libc.org/releases/${musl_tar}; tar -zxf ${musl_tar}; \ cd ${musl_dir}; \ @@ -310,6 +324,8 @@ RUN pushd /root; \ popd ENV PATH=\$PATH:/usr/local/musl/bin " + fi + readonly install_rust=" RUN curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSLf --output /tmp/rust-init; \ chmod a+x /tmp/rust-init; \