Skip to content

Update from CMake 3.28.0 to 3.29.6 #64

Update from CMake 3.28.0 to 3.29.6

Update from CMake 3.28.0 to 3.29.6 #64

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.
# mirror.centos.org doens't exist anymore after CentOS 7 EOL.
run: |
sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/*.repo
sed -i s/^#.*baseurl=http/baseurl=http/g /etc/yum.repos.d/*.repo
sed -i s/^mirrorlist=http/#mirrorlist=http/g /etc/yum.repos.d/*.repo
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
sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/*.repo
sed -i s/^#.*baseurl=http/baseurl=http/g /etc/yum.repos.d/*.repo
sed -i s/^mirrorlist=http/#mirrorlist=http/g /etc/yum.repos.d/*.repo
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.29.6/cmake-3.29.6-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 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 QEMU
run: 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