-
Notifications
You must be signed in to change notification settings - Fork 312
/
build_cross_compilers.sh
executable file
·62 lines (54 loc) · 1.35 KB
/
build_cross_compilers.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/bash
set -exuo pipefail
finish() {
# shellcheck disable=SC2317
ce builder stop
}
trap finish EXIT
ce builder status
ce builder start
LOG_DIR=~/build_logs
BUILD_FAILED=0
run_on_build() {
local logdir=${LOG_DIR}/$1
mkdir -p "${logdir}"
shift
set +e
date >"${logdir}/begin"
if ! ce builder exec -- "$@" 2>&1 | tee "${logdir}/log"; then
BUILD_FAILED=1
echo FAILED >"${logdir}/status"
else
echo OK >"${logdir}/status"
fi
date >"${logdir}/end"
set -e
}
build_cross() {
local ARCH=$1
local VERSION=$2
shift 2
local OUTPUT=s3://compiler-explorer/opt/${ARCH}-gcc-${VERSION}.tar.xz
if aws s3 ls "${OUTPUT}"; then
echo "File ${OUTPUT} exists, skipping"
return
fi
run_on_build gcc-cross \
sudo docker run --rm --name gcc-cross.build -v/home/ubuntu/.s3cfg:/home/gcc-user/.s3cfg:ro compilerexplorer/gcc-cross-builder \
bash ./build.sh "${ARCH}" "${VERSION}" s3://compiler-explorer/opt/
}
build_cross powerpc64le at12
build_cross powerpc64 at12
build_cross powerpc64le at13
build_cross powerpc64 at13
build_cross arm 6.4.0
build_cross arm 7.3.0
build_cross arm 8.2.0
build_cross arm64 6.4.0
build_cross arm64 7.3.0
build_cross arm64 8.2.0
build_cross riscv64 8.2.0
build_cross riscv32 8.2.0
build_cross k1 7.4.1
build_cross k1 7.5.0
exit ${BUILD_FAILED}