Skip to content

Fix submodule update failure #56

Fix submodule update failure

Fix submodule update failure #56

name: Build for CentOS 7
on:
push:
branches:
- centos7-build
jobs:
build:
runs-on: ubuntu-22.04
container:
image: centos:7
volumes:
- /opt/:/opt/
- /usr/share/:/host/usr/share/
- /usr/local/lib/:/host/usr/local/lib/
steps:
- name: Remove unneeded frameworks to recover disk space
run: |
rm -rf /host/usr/share/dotnet
rm -rf /host/usr/local/lib/android
- 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 \
devtoolset-11-gcc devtoolset-11-gcc-c++ devtoolset-11-make \
git236-core rh-python38
curl -Lo cmake.sh https://github.com/Kitware/CMake/releases/download/v3.28.0/cmake-3.28.0-linux-x86_64.sh && \
chmod +x cmake.sh && \
./cmake.sh --skip-license --prefix=/usr && \
rm -f cmake.sh
- uses: actions/checkout@v3
- name: Checkout submodules
run: |
git config --global --add safe.directory ${GITHUB_WORKSPACE}
git submodule init binutils gcc gdb glibc newlib spike
git submodule update --recursive --progress --depth=1 -j 0
git submodule update --progress --depth=1 -j 0 qemu
- 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 QEMU
run: |
git config --global user.name builder
git config --global user.email [email protected]
pushd qemu
git am ../patches/qemu8-on-centos7.mbox
popd
scl enable devtoolset-11 rh-python38 -- make -j $(nproc) build-sim SIM=qemu
- 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 /opt/rv-gnu-toolchain-centos7.txz -C /opt/ riscv/
- uses: actions/upload-artifact@v3
with:
name: toolchain-for-centos7
path: /opt/rv-gnu-toolchain-centos7.txz