From 8d48597850a2f3077c977a327aabc9a024191bc4 Mon Sep 17 00:00:00 2001 From: Owen Avery Date: Wed, 12 Feb 2025 21:24:34 -0500 Subject: [PATCH] Add testing on powerpc to the github CI ChangeLog: * .github/workflows/ccpp.yml: Add powerpc target compile and test. Signed-off-by: Owen Avery --- .github/workflows/ccpp.yml | 87 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index bdc2d8df3e5e..6e9ba26681be 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -512,3 +512,90 @@ jobs: else \ exit 0; \ fi + + build-and-check-powerpc: + + env: + # Force locale, in particular for reproducible results re '.github/log_expected_warnings' (see below). + LC_ALL: C.UTF-8 + + runs-on: ubuntu-22.04 + + steps: + - uses: actions/checkout@v4 + + - name: Install Deps + run: | + sudo apt-get update; + sudo apt-get install -y \ + automake \ + autoconf \ + libtool \ + autogen \ + bison \ + flex \ + libgmp3-dev \ + libmpfr-dev \ + libmpc-dev \ + build-essential \ + gcc-multilib \ + g++-multilib \ + dejagnu; + # install Rust directly using rustup + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain=1.72.0; + # set up combined tree build + git clone https://sourceware.org/git/binutils-gdb.git \ + -b binutils-2_44-branch --depth 1 ../binutils; + ln -s "$(pwd)"/../binutils/* . || true; + git clone https://sourceware.org/git/newlib-cygwin.git \ + -b newlib-4.5.0 --depth 1 ../newlib; + ln -s "$(pwd)"/../newlib/* . || true; + git clone https://git.savannah.gnu.org/git/dejagnu.git \ + -b dejagnu-1.6.3-release --depth 1 ../dejagnu; + ln -s "$(pwd)"/../dejagnu/* . || true; + git clone https://sourceware.org/git/binutils-gdb.git \ + -b gdb-16.2-release --depth 1 ../gdb; + ln -s "$(pwd)"/../gdb/* . || true; + + - name: Make Source Read-Only + run: chmod -R a-w ./* + + - name: Configure + run: | + mkdir -p gccrs-build; + cd gccrs-build; + ../configure \ + --enable-languages=rust \ + --disable-bootstrap \ + --enable-multilib \ + --target=powerpc-eabisim + + - name: Build + shell: bash + run: | + cd gccrs-build; \ + # Add cargo to our path quickly + . "$HOME/.cargo/env"; + make -Otarget -j $(nproc) 2>&1 | tee log + + - name: Run Tests + run: | + cd gccrs-build; \ + make check-rust RUNTESTFLAGS="--target_board=powerpc-sim" + - name: Archive check-rust results + uses: actions/upload-artifact@v4 + with: + name: check-rust-logs-powerpc + path: | + gccrs-build/gcc/testsuite/rust/ + - name: Check regressions + run: | + cd gccrs-build; \ + if grep -e "unexpected" -e "unresolved" -e "ERROR:" gcc/testsuite/rust/rust.sum;\ + then \ + echo "::error title=Regression test failed::some tests are not correct"; \ + perl -n ../.github/emit_test_errors.pl < gcc/testsuite/rust/rust.sum; \ + exit 1; \ + else \ + exit 0; \ + fi