File tree 5 files changed +35
-25
lines changed
5 files changed +35
-25
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ RUN /tmp/build-solaris-toolchain.sh sparcv9 sparcv9 solaris-sparc
32
32
COPY dist-various-2/build-x86_64-fortanix-unknown-sgx-toolchain.sh /tmp/
33
33
# We pass the commit id of the port of LLVM's libunwind to the build script.
34
34
# Any update to the commit id here, should cause the container image to be re-built from this point on.
35
- RUN /tmp/build-x86_64-fortanix-unknown-sgx-toolchain.sh "13fad13f8ea83a8da58d04a5faa45943151b3398 "
35
+ RUN /tmp/build-x86_64-fortanix-unknown-sgx-toolchain.sh "53b586346f2c7870e20b170decdc30729d97c42b "
36
36
37
37
COPY scripts/sccache.sh /scripts/
38
38
RUN sh /scripts/sccache.sh
Original file line number Diff line number Diff line change @@ -12,8 +12,7 @@ target="x86_64-fortanix-unknown-sgx"
12
12
url=" https://github.com/fortanix/llvm-project/archive/${1} .tar.gz"
13
13
repo_name=" llvm-project"
14
14
15
- install_prereq ()
16
- {
15
+ install_prereq () {
17
16
apt-get update
18
17
apt-get install -y --no-install-recommends \
19
18
build-essential \
@@ -22,36 +21,32 @@ install_prereq()
22
21
git
23
22
}
24
23
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
27
- # from init_repo.sh
28
- fetch_llvm_commit ()
29
- {
30
- cached=" download-${repo_name} .tar.gz"
31
- curl -f -sSL -o ${cached} ${url}
32
- tar -xvzf ${cached}
33
- mkdir " ./${repo_name} " && tar -xf ${cached} -C ${repo_name} --strip-components 1
34
- }
35
-
36
- build_unwind ()
37
- {
24
+ build_unwind () {
25
+ set -x
38
26
dir_name=" ${target} _temp"
39
- rm -rf " ./ ${dir_name} "
27
+ rm -rf ${dir_name}
40
28
mkdir -p ${dir_name}
41
- cd ${dir_name}
29
+ pushd ${dir_name}
42
30
43
- retry fetch_llvm_commit
31
+ # Clone Fortanix's fork of llvm-project which has a port of libunwind
32
+ fetch_github_commit_archive " $repo_name " " $url "
44
33
cd " ${repo_name} /libunwind"
45
34
46
35
# Build libunwind
47
36
mkdir -p build
48
37
cd build
49
- cmake -DCMAKE_BUILD_TYPE=" RELEASE" -DRUST_SGX=1 -G " Unix Makefiles" -DLLVM_PATH=../../llvm/ ../
38
+ cmake -DCMAKE_BUILD_TYPE=" RELEASE" -DRUST_SGX=1 -G " Unix Makefiles" \
39
+ -DLLVM_ENABLE_WARNINGS=1 -DLIBUNWIND_ENABLE_WERROR=1 -DLIBUNWIND_ENABLE_PEDANTIC=0 \
40
+ -DLLVM_PATH=../../llvm/ ../
50
41
make unwind_static
51
42
install -D " lib/libunwind.a" " /${target} /lib/libunwind.a"
43
+
44
+ popd
52
45
rm -rf ${dir_name}
46
+
47
+ { set +x; } 2> /dev/null
53
48
}
54
49
55
50
set -x
56
51
hide_output install_prereq
57
- hide_output build_unwind
52
+ build_unwind
Original file line number Diff line number Diff line change 1
1
hide_output () {
2
- set +x
2
+ { set +x; } 2> /dev/null
3
3
on_err="
4
4
echo ERROR: An error was encountered with the build.
5
5
cat /tmp/build.log
14
14
set -x
15
15
}
16
16
17
+ # Copied from ../../shared.sh
17
18
function retry {
18
19
echo " Attempting with retry:" " $@ "
19
20
local n=1
@@ -31,3 +32,15 @@ function retry {
31
32
}
32
33
done
33
34
}
35
+
36
+ # Copied from ../../init_repo.sh
37
+ function fetch_github_commit_archive {
38
+ local module=$1
39
+ local cached=" download-${module// \/ / -} .tar.gz"
40
+ retry sh -c " rm -f $cached && \
41
+ curl -f -sSL -o $cached $2 "
42
+ mkdir $module
43
+ touch " $module /.git"
44
+ tar -C $module --strip-components=1 -xf $cached
45
+ rm $cached
46
+ }
Original file line number Diff line number Diff line change @@ -34,11 +34,12 @@ if grep -q RUST_RELEASE_CHANNEL=beta src/ci/run.sh; then
34
34
git fetch origin --unshallow beta master
35
35
fi
36
36
37
- function fetch_submodule {
37
+ # Duplicated in docker/dist-various-2/shared.sh
38
+ function fetch_github_commit_archive {
38
39
local module=$1
39
40
local cached=" download-${module// \/ / -} .tar.gz"
40
41
retry sh -c " rm -f $cached && \
41
- curl -sSL -o $cached $2 "
42
+ curl -f - sSL -o $cached $2 "
42
43
mkdir $module
43
44
touch " $module /.git"
44
45
tar -C $module --strip-components=1 -xf $cached
@@ -58,7 +59,7 @@ for i in ${!modules[@]}; do
58
59
git rm $module
59
60
url=${urls[$i]}
60
61
url=${url/ \. git/ }
61
- fetch_submodule $module " $url /archive/$commit .tar.gz" &
62
+ fetch_github_commit_archive $module " $url /archive/$commit .tar.gz" &
62
63
continue
63
64
else
64
65
use_git=" $use_git $module "
Original file line number Diff line number Diff line change 5
5
# marked as an executable file in git.
6
6
7
7
# See http://unix.stackexchange.com/questions/82598
8
+ # Duplicated in docker/dist-various-2/shared.sh
8
9
function retry {
9
10
echo " Attempting with retry:" " $@ "
10
11
local n=1
You can’t perform that action at this time.
0 commit comments