Skip to content

Commit

Permalink
powerpcspe
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e committed Sep 5, 2024
1 parent f3068b6 commit 6083d88
Show file tree
Hide file tree
Showing 6 changed files with 165 additions and 156 deletions.
101 changes: 51 additions & 50 deletions .github/workflows/base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ permissions:
on:
# pull_request:
push:
# branches:
branches:
# - main
# - dev
- dev
tags:
- 'base-[0-9]+-[0-9]+-[0-9]+'
schedule:
Expand All @@ -29,59 +29,60 @@ jobs:
fail-fast: false
matrix:
include:
# Linux (musl)
- target: aarch64-unknown-linux-musl
- target: arm-unknown-linux-musleabi
- target: arm-unknown-linux-musleabihf
- target: armv5te-unknown-linux-musleabi
- target: armv7-unknown-linux-musleabi
- target: armv7-unknown-linux-musleabihf
- target: hexagon-unknown-linux-musl # tier3
- target: i586-unknown-linux-musl
- target: i686-unknown-linux-musl
# - target: loongarch64-unknown-linux-musl # tier3, musl-cross-make doesn't support this target
- target: mips-unknown-linux-musl # tier3
- target: mips64-unknown-linux-muslabi64 # tier3
- target: mips64el-unknown-linux-muslabi64 # tier3
- target: mipsel-unknown-linux-musl # tier3
- target: powerpc-unknown-linux-musl # tier3
- target: powerpc64-unknown-linux-musl # tier3
- target: powerpc64le-unknown-linux-musl # tier3
- target: riscv32gc-unknown-linux-musl # tier3
- target: riscv64gc-unknown-linux-musl # tier3
- target: s390x-unknown-linux-musl # tier3
- target: thumbv7neon-unknown-linux-musleabihf # tier3
- target: x86_64-unknown-linux-musl
# # Linux (musl)
# - target: aarch64-unknown-linux-musl
# - target: arm-unknown-linux-musleabi
# - target: arm-unknown-linux-musleabihf
# - target: armv5te-unknown-linux-musleabi
# - target: armv7-unknown-linux-musleabi
# - target: armv7-unknown-linux-musleabihf
# - target: hexagon-unknown-linux-musl # tier3
# - target: i586-unknown-linux-musl
# - target: i686-unknown-linux-musl
# # - target: loongarch64-unknown-linux-musl # musl-cross-make doesn't support this target
# - target: mips-unknown-linux-musl # tier3
# - target: mips64-unknown-linux-muslabi64 # tier3
# - target: mips64el-unknown-linux-muslabi64 # tier3
# - target: mipsel-unknown-linux-musl # tier3
# - target: powerpc-unknown-linux-musl # tier3
- target: powerpc-unknown-linux-muslspe # tier3
# - target: powerpc64-unknown-linux-musl # tier3
# - target: powerpc64le-unknown-linux-musl # tier3
# - target: riscv32gc-unknown-linux-musl # tier3
# - target: riscv64gc-unknown-linux-musl
# - target: s390x-unknown-linux-musl # tier3
# - target: thumbv7neon-unknown-linux-musleabihf # tier3
# - target: x86_64-unknown-linux-musl

# NetBSD
- target: aarch64-unknown-netbsd # tier3
- target: aarch64_be-unknown-netbsd # tier3
- target: armv6-unknown-netbsd-eabihf # tier3
- target: armv7-unknown-netbsd-eabihf # tier3
- target: i586-unknown-netbsd # tier3
- target: i686-unknown-netbsd # tier3
- target: mipsel-unknown-netbsd # tier3
- target: powerpc-unknown-netbsd # tier3
- target: sparc64-unknown-netbsd # tier3
- target: x86_64-unknown-netbsd
# # NetBSD
# - target: aarch64-unknown-netbsd # tier3
# - target: aarch64_be-unknown-netbsd # tier3
# - target: armv6-unknown-netbsd-eabihf # tier3
# - target: armv7-unknown-netbsd-eabihf # tier3
# - target: i586-unknown-netbsd # tier3
# - target: i686-unknown-netbsd # tier3
# - target: mipsel-unknown-netbsd # tier3
# - target: powerpc-unknown-netbsd # tier3
# - target: sparc64-unknown-netbsd # tier3
# - target: x86_64-unknown-netbsd

# Solaris
- target: sparcv9-sun-solaris
- target: x86_64-pc-solaris
# # Solaris
# - target: sparcv9-sun-solaris
# - target: x86_64-pc-solaris

# illumos
- target: x86_64-unknown-illumos
# # illumos
# - target: x86_64-unknown-illumos

# Windows (MinGW)
- target: i686-pc-windows-gnu
- target: x86_64-pc-windows-gnu
- target: x86_64-pc-windows-gnu
host: aarch64
# # Windows (MinGW)
# - target: i686-pc-windows-gnu
# - target: x86_64-pc-windows-gnu
# - target: x86_64-pc-windows-gnu
# host: aarch64

# Misc
- target: various
- target: various
host: aarch64
# # Misc
# - target: various
# - target: various
# host: aarch64

runs-on: ubuntu-latest
timeout-minutes: 120
Expand Down
152 changes: 76 additions & 76 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
push:
branches:
- main
- dev
# - dev
tags:
- '[0-9]+-[0-9]+-[0-9]+'
schedule:
Expand All @@ -24,43 +24,43 @@ concurrency:
cancel-in-progress: true

jobs:
tidy:
uses: taiki-e/github-actions/.github/workflows/tidy.yml@main
# tidy:
# uses: taiki-e/github-actions/.github/workflows/tidy.yml@main

build:
needs: tidy
# needs: tidy
strategy:
fail-fast: false
matrix:
include:
- target: linux-gnu
- target: linux-gnu
host: aarch64
# TODO(linux-musl): https://github.com/rust-lang/rust/pull/107129/
# - target: linux-musl
# musl: '1.1'
# - target: linux-gnu
# - target: linux-gnu
# host: aarch64
# # TODO(linux-musl): https://github.com/rust-lang/rust/pull/107129/
# # - target: linux-musl
# # musl: '1.1'
- target: linux-musl
musl: '1.2'
- target: linux-uclibc
- target: android
- target: freebsd
- target: netbsd
- target: openbsd
- target: dragonfly
- target: solaris
- target: illumos
- target: redox
# - target: fuchsia
- target: wasi
- target: wasi
host: aarch64
# - target: emscripten # TODO: wasm-ld: error: /tmp/test-emcc/rust/target/wasm32-unknown-emscripten/debug/deps/rust_test.216hq58untngdnb12cddqxyyf.rcgu.o: Invalid symbol type
- target: windows-gnu
- target: windows-gnu
host: aarch64
- target: none
- target: none
host: aarch64
# - target: linux-uclibc
# - target: android
# - target: freebsd
# - target: netbsd
# - target: openbsd
# - target: dragonfly
# - target: solaris
# - target: illumos
# - target: redox
# # - target: fuchsia
# - target: wasi
# - target: wasi
# host: aarch64
# # - target: emscripten # TODO: wasm-ld: error: /tmp/test-emcc/rust/target/wasm32-unknown-emscripten/debug/deps/rust_test.216hq58untngdnb12cddqxyyf.rcgu.o: Invalid symbol type
# - target: windows-gnu
# - target: windows-gnu
# host: aarch64
# - target: none
# - target: none
# host: aarch64
runs-on: ubuntu-latest
timeout-minutes: 150
permissions:
Expand All @@ -79,50 +79,50 @@ jobs:
HOST_ARCH: ${{ matrix.host }}
MUSL_VERSION: ${{ matrix.musl }}

manifest:
if: github.repository_owner == 'taiki-e' && github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/'))
needs: build
runs-on: ubuntu-latest
timeout-minutes: 60
permissions:
contents: read
packages: write
steps:
- uses: taiki-e/checkout-action@v1
- run: |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin
echo "PUSH_TO_GHCR=1" >>"${GITHUB_ENV}"
if: github.repository_owner == 'taiki-e' && (github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')) || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule')
- run: tools/docker-manifest.sh
# manifest:
# if: github.repository_owner == 'taiki-e' && github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/'))
# needs: build
# runs-on: ubuntu-latest
# timeout-minutes: 60
# permissions:
# contents: read
# packages: write
# steps:
# - uses: taiki-e/checkout-action@v1
# - run: |
# echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin
# echo "PUSH_TO_GHCR=1" >>"${GITHUB_ENV}"
# if: github.repository_owner == 'taiki-e' && (github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')) || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule')
# - run: tools/docker-manifest.sh

codegen:
runs-on: ubuntu-latest
timeout-minutes: 60
permissions:
contents: read
pull-requests: write # for gh pr edit --add-assignee
repository-projects: read # for gh pr edit --add-assignee
steps:
- uses: taiki-e/checkout-action@v1
- name: Install Rust
run: rustup toolchain add nightly --no-self-update && rustup default nightly
- run: tools/gen.sh
- id: diff
run: tools/ci/gen.sh
if: github.repository_owner == 'taiki-e' && (github.event_name == 'schedule' || github.event_name == 'push' && github.ref == 'refs/heads/main')
- id: create-pull-request
uses: peter-evans/create-pull-request@v7
with:
title: Update generated code
body: |
Auto-generated by CI using [create-pull-request](https://github.com/peter-evans/create-pull-request).
branch: update-generated-code
token: ${{ secrets.CREATE_PR_TOKEN }}
if: github.repository_owner == 'taiki-e' && (github.event_name == 'schedule' || github.event_name == 'push' && github.ref == 'refs/heads/main') && steps.diff.outputs.success == 'false'
- name: Notify PR author by assigning PR
run: gh pr edit --add-assignee taiki-e "${PR_NUMBER:?}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ steps.create-pull-request.outputs.pull-request-number }}
if: github.repository_owner == 'taiki-e' && (github.event_name == 'schedule' || github.event_name == 'push' && github.ref == 'refs/heads/main') && steps.diff.outputs.success == 'false'
- run: git add -N . && git diff --exit-code
# codegen:
# runs-on: ubuntu-latest
# timeout-minutes: 60
# permissions:
# contents: read
# pull-requests: write # for gh pr edit --add-assignee
# repository-projects: read # for gh pr edit --add-assignee
# steps:
# - uses: taiki-e/checkout-action@v1
# - name: Install Rust
# run: rustup toolchain add nightly --no-self-update && rustup default nightly
# - run: tools/gen.sh
# - id: diff
# run: tools/ci/gen.sh
# if: github.repository_owner == 'taiki-e' && (github.event_name == 'schedule' || github.event_name == 'push' && github.ref == 'refs/heads/main')
# - id: create-pull-request
# uses: peter-evans/create-pull-request@v7
# with:
# title: Update generated code
# body: |
# Auto-generated by CI using [create-pull-request](https://github.com/peter-evans/create-pull-request).
# branch: update-generated-code
# token: ${{ secrets.CREATE_PR_TOKEN }}
# if: github.repository_owner == 'taiki-e' && (github.event_name == 'schedule' || github.event_name == 'push' && github.ref == 'refs/heads/main') && steps.diff.outputs.success == 'false'
# - name: Notify PR author by assigning PR
# run: gh pr edit --add-assignee taiki-e "${PR_NUMBER:?}"
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# PR_NUMBER: ${{ steps.create-pull-request.outputs.pull-request-number }}
# if: github.repository_owner == 'taiki-e' && (github.event_name == 'schedule' || github.event_name == 'push' && github.ref == 'refs/heads/main') && steps.diff.outputs.success == 'false'
# - run: git add -N . && git diff --exit-code
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ See also [setup-cross-toolchain-action](https://github.com/taiki-e/setup-cross-t
| ---- | --- | ----- | --- | ---- | ---- |
| musl 1.2.3 [6] | 9.4.0 [1] | [2] | ✓ (libstdc++) [1] | ✓ (qemu) [3] [4] | [5] |

[1] 13.2.0 for risc64gc-unknown-linux-musl, unavailable for hexagon-unknown-linux-musl<br>
[1] 8.5.0 for powerpc-unknown-linux-muslspe, 13.2.0 for risc64gc-unknown-linux-musl, unavailable for hexagon-unknown-linux-musl<br>
[2] 17.0.0-rc3 for hexagon-unknown-linux-musl, otherwise host<br>
[3] hexagon-unknown-linux-musl requires release mode for building test<br>
[4] Except for riscv32gc-unknown-linux-musl<br>
Expand All @@ -108,6 +108,7 @@ See also [setup-cross-toolchain-action](https://github.com/taiki-e/setup-cross-t
| `mips64el-unknown-linux-muslabi64` (tier3) | x86_64 Linux (any libc) |
| `mipsel-unknown-linux-musl` (tier3) | x86_64 Linux (any libc) |
| `powerpc-unknown-linux-musl` (tier3) | x86_64 Linux (any libc) |
| `powerpc-unknown-linux-muslspe` (tier3) | x86_64 Linux (any libc) |
| `powerpc64le-unknown-linux-musl` (tier3) | x86_64 Linux (any libc) |
| `riscv32gc-unknown-linux-musl` (tier3) | x86_64 Linux (any libc) |
| `riscv64gc-unknown-linux-musl` | x86_64 Linux (any libc) |
Expand Down
14 changes: 10 additions & 4 deletions docker/base/linux-musl.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
# Use the fork that contains a patch to fix CVE-2020-28928 for musl 1.1 and add some hashes for riscv.
# https://github.com/taiki-e/musl-cross-make/tree/dev
ARG MUSL_CROSS_MAKE_REV=060a2763225cbc325cffce7e7e08e62a7df1ad3b
# Available versions: https://github.com/richfelker/musl-cross-make/tree/HEAD/hashes
# Default: https://github.com/richfelker/musl-cross-make/blob/HEAD/Makefile
# Available versions: https://github.com/taiki-e/musl-cross-make/tree/dev/hashes
# Default: https://github.com/taiki-e/musl-cross-make/tree/dev/Makefile
ARG BINUTILS_VERSION=2.33.1
ARG GCC_VERSION=9.4.0
ARG MUSL_VERSION
Expand Down Expand Up @@ -55,12 +55,17 @@ ARG LINUX_VERSION
# https://github.com/richfelker/musl-cross-make/blob/0f22991b8d47837ef8dd60a0c43cf40fcf76217a/config.mak.dist
# https://conf.musl.cc/plain_20210301_10-2-1.txt
# See also cc-rs for target flags: https://github.com/rust-lang/cc-rs/blob/1.0.73/src/lib.rs#L1649
# Use GCC 8 for powerpcspe GCC 9 removed support for this target: https://gcc.gnu.org/gcc-8/changes.html
# Use binutils 2.40 for riscv because linker error "unknown z ISA extension `zmmul'" with LLVM 19
# Use gcc 13.2 for riscv because linker error "relocation R_RISCV_JAL against `__udivsi3' which may bind externally can not be used when making a shared object; recompile with -fPIC"
# Use GCC 13 for riscv because linker error "relocation R_RISCV_JAL against `__udivsi3' which may bind externally can not be used when making a shared object; recompile with -fPIC"
# Use musl 1.2.5 for riscv32/loongarch64 because support for them has been added in 1.2.5: https://github.com/bminor/musl/commit/01d9fe4d9f7cce7a6dbaece0e2e405a2e3279244 / https://github.com/bminor/musl/commit/522bd54edaa2fa404fd428f8ad0bcb0f0bec5639
RUN <<EOF
cc_target=$(</CC_TARGET)
case "${RUST_TARGET}" in
powerpc-*spe)
GCC_VERSION=8.5.0
gcc_config=' --enable-obsolete'
;;
riscv*)
BINUTILS_VERSION=2.40
GCC_VERSION=13.2.0
Expand Down Expand Up @@ -89,7 +94,7 @@ COMMON_CONFIG += --with-debug-prefix-map=\$(CURDIR)=
GCC_CONFIG += --enable-default-pie --enable-static-pie
GCC_CONFIG += --enable-languages=c,c++,fortran
GCC_CONFIG += --disable-libquadmath --disable-libquadmath-support --disable-decimal-float
GCC_CONFIG += --disable-multilib
GCC_CONFIG += --disable-multilib${gcc_config:-}
EOF2
case "${RUST_TARGET}" in
arm-*hf) common_config="--with-arch=armv6 --with-fpu=vfp --with-float=hard --with-mode=arm" ;;
Expand Down Expand Up @@ -130,6 +135,7 @@ case "${RUST_TARGET}" in
mips64-*) ldso_arch=mips64 ;;
mips64el-*) ldso_arch=mips64el ;;
mipsel-*) ldso_arch=mipsel-sf ;;
powerpc-*spe) ldso_arch=powerpc-sf ;;
powerpc-*) ldso_arch=powerpc ;;
powerpc64-*) ldso_arch=powerpc64 ;;
powerpc64le-*) ldso_arch=powerpc64le ;;
Expand Down
1 change: 1 addition & 0 deletions docker/test/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -989,6 +989,7 @@ case "${RUST_TARGET}" in
mips64-*) ldso_arch=mips64 ;;
mips64el-*) ldso_arch=mips64el ;;
mipsel-*) ldso_arch=mipsel-sf ;;
powerpc-*spe) ldso_arch=powerpc-sf ;;
powerpc-*) ldso_arch=powerpc ;;
powerpc64-*) ldso_arch=powerpc64 ;;
powerpc64le-*) ldso_arch=powerpc64le ;;
Expand Down
Loading

0 comments on commit 6083d88

Please sign in to comment.