7 echo "Usage: ${0} <commit_id>"
11 target="x86_64-fortanix-unknown-sgx"
12 url="https://github.com/fortanix/llvm-project/archive/${1}.tar.gz"
13 repo_name="llvm-project"
18 apt-get install -y --no-install-recommends \
25 # Clone Fortanix's port of llvm-project to build libunwind that would link with this target.
26 # The below method to download a single commit from llvm-project is based on fetch_submodule
30 cached="download-${repo_name}.tar.gz"
31 curl -f -sSL -o ${cached} ${url}
33 mkdir "./${repo_name}" && tar -xf ${cached} -C ${repo_name} --strip-components 1
38 dir_name="${target}_temp"
39 rm -rf "./${dir_name}"
43 retry fetch_llvm_commit
44 cd "${repo_name}/libunwind"
49 cmake -DCMAKE_BUILD_TYPE="RELEASE" -DRUST_SGX=1 -G "Unix Makefiles" -DLLVM_PATH=../../llvm/ ../
51 install -D "lib/libunwind.a" "/${target}/lib/libunwind.a"
56 hide_output install_prereq
57 hide_output build_unwind