Skip to content

Commit

Permalink
CI: Add support for ppc64le
Browse files Browse the repository at this point in the history
For now only using clang.

Adds -vga none to the qemu command for all targets. But AFAICS that's
safe as both x86 and arm use serial consoles already.

Uses RUST_OPT_LEVEL_SIMILAR_AS_CHOSEN_FOR_C, not RUST_OPT_LEVEL_0 like
other configs. In order to avoid crashes like:

  Rust Example (init)
  Am I built-in? true
  Parameters:
    my_bool:    true
    my_i32:     123321
    my_str:     🦀mod
    my_usize:   42
    my_array:   [0, 1]
  Value: 10
  Value: 10
  Large array has length: 514
  Kernel panic - not syncing: corrupted stack end detected inside scheduler
  CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.12.0-rc3+ #1

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
  • Loading branch information
mpe committed Mar 31, 2021
1 parent 659f7bd commit c4e64ba
Show file tree
Hide file tree
Showing 2 changed files with 1,590 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@ jobs:
install: standalone
sysroot: custom

- arch: ppc64le
toolchain: clang
config: debug
rustc: 2021-02-20
output: src
install: rustup
sysroot: common

steps:
# Setup: checkout
- uses: actions/checkout@v2
Expand All @@ -68,6 +76,14 @@ jobs:
echo 'QEMU_ARCH=aarch64' >> $GITHUB_ENV
echo 'QEMU_MACHINE=virt' >> $GITHUB_ENV
echo 'QEMU_CPU=cortex-a72' >> $GITHUB_ENV
- if: matrix.arch == 'ppc64le'
run: |
echo 'MAKE_ARCH=ARCH=powerpc' >> $GITHUB_ENV
echo 'MAKE_CROSS_COMPILE=CROSS_COMPILE=powerpc64le-linux-gnu-' >> $GITHUB_ENV
echo 'IMAGE_PATH=vmlinux' >> $GITHUB_ENV
echo 'QEMU_ARCH=ppc64' >> $GITHUB_ENV
echo 'QEMU_MACHINE=pseries' >> $GITHUB_ENV
echo 'QEMU_CPU=POWER9' >> $GITHUB_ENV
- if: matrix.toolchain == 'clang'
run: echo 'MAKE_TOOLCHAIN=CC=clang-11' >> $GITHUB_ENV
Expand All @@ -94,6 +110,8 @@ jobs:
# Setup: GCC
- if: matrix.arch == 'arm64'
run: sudo apt-get install -y gcc-aarch64-linux-gnu
- if: matrix.arch == 'ppc64le'
run: sudo apt-get install -y gcc-powerpc64le-linux-gnu

# Setup: libelf
- run: sudo apt-get install -y libelf-dev
Expand All @@ -103,6 +121,8 @@ jobs:
run: sudo apt-get install -y qemu-system-x86
- if: matrix.arch == 'arm64'
run: sudo apt-get install -y qemu-system-arm
- if: matrix.arch == 'ppc64le'
run: sudo apt-get install -y qemu-system-ppc64

# Setup: rustc
- if: matrix.install == 'rustup'
Expand Down Expand Up @@ -164,6 +184,7 @@ jobs:
-cpu ${{ env.QEMU_CPU }} \
-smp 2 \
-nographic \
-vga none \
-no-reboot \
-append '${{ env.QEMU_APPEND }} \
rust_example.my_i32=123321 \
Expand Down
Loading

0 comments on commit c4e64ba

Please sign in to comment.