From 6a8815706db9d15e1828b656018c8999e14a3972 Mon Sep 17 00:00:00 2001 From: "Zheng, Qi" Date: Fri, 17 Sep 2021 17:54:40 +0800 Subject: [PATCH] Add bash build script for both occlum-gcc and gcc Signed-off-by: Zheng, Qi --- tools/toolchains/bash/build.sh | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100755 tools/toolchains/bash/build.sh diff --git a/tools/toolchains/bash/build.sh b/tools/toolchains/bash/build.sh new file mode 100755 index 00000000..e227d6e2 --- /dev/null +++ b/tools/toolchains/bash/build.sh @@ -0,0 +1,34 @@ +#! /bin/bash +set -e +THIS_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" +INSTALL_DIR=/opt/occlum/toolchains/bash + +bash_source="https://github.com/occlum/bash.git" +bash_branch="bash_5.1_for_occlum" + +rm -rf ${INSTALL_DIR} + +# Download bash source +git clone -b ${bash_branch} ${bash_source} + +echo "Building bash with musl-gcc (occlum-gcc) ..." +cd bash +CC=occlum-gcc CXX=occlum-g++ ./configure --without-bash-malloc +make clean +make -j + +mkdir -p ${INSTALL_DIR}/musl +cp bash ${INSTALL_DIR}/musl/ + +# Restore code +make clean +git clean -dxf +git reset HEAD --hard + +echo "Building bash with gcc ..." +./configure +make -j + +mkdir -p ${INSTALL_DIR}/glibc +cp bash ${INSTALL_DIR}/glibc/ +