forked from riscv-collab/riscv-gnu-toolchain
-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (63 loc) · 2.57 KB
/
build-centos7.yaml
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: Build for CentOS 7
on:
push:
branches:
- centos7-build
jobs:
build:
runs-on: ubuntu-22.04
container:
image: centos:7
steps:
- name: Update and install build tools
# Add python-devel to support python in gdb.
# actions/checkout@v3 requires git >= 2.18
run: |
yum -y update
yum -y install \
centos-release-scl \
https://repo.ius.io/ius-release-el7.rpm \
https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
yum -y install \
autoconf automake python3 libmpc-devel mpfr-devel gmp-devel gawk \
bison flex texinfo patchutils zlib-devel expat-devel \
python-devel \
ninja-build dtc glib2-devel \
cmake3 devtoolset-11-gcc devtoolset-11-gcc-c++ devtoolset-11-make \
git236-core
alternatives --install /usr/local/bin/cmake cmake /usr/bin/cmake3 20 \
--slave /usr/local/bin/ctest ctest /usr/bin/ctest3 \
--slave /usr/local/bin/cpack cpack /usr/bin/cpack3 \
--slave /usr/local/bin/ccmake ccmake /usr/bin/ccmake3 \
--family cmake
- uses: actions/checkout@v3
- name: Checkout submodules
run: |
git config --global --add safe.directory ${GITHUB_WORKSPACE}
git submodule init binutils gcc gdb glibc newlib qemu spike
git submodule update --recursive --progress --depth=1 -j 0
- name: Configure Newlib toolchain
run: |
scl enable devtoolset-11 -- \
./configure --prefix=/opt/riscv --enable-libsanitizer --with-cmodel=medany
- name: Build Newlib toolchain
run: scl enable devtoolset-11 -- make -j $(nproc)
- name: Build Spike
run: scl enable devtoolset-11 -- make -j $(nproc) build-sim SIM=spike
- name: Clean temporary files to free up space
run: make clean
- name: Configure Linux toolchain
run: |
scl enable devtoolset-11 -- \
./configure --prefix=/opt/riscv --enable-llvm --with-cmodel=medany
- name: Build Linux toolchain
run: scl enable devtoolset-11 -- make -j $(nproc) linux
- name: Clean temporary files to free up space
run: make clean
- name: Create tarball
# WARNING each xz thread consumes nearly 1 GB of memory
run: XZOPT=-T0 tar -cJvf rv-gnu-toolchain-centos7.txz -C /opt/ riscv/
- uses: actions/upload-artifact@v3
with:
name: toolchain-for-centos7
path: rv-gnu-toolchain-centos7.txz