Bump binutils to 2.42 #19
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build libgcc | |
on: [push] | |
jobs: | |
libgcc: | |
strategy: | |
matrix: | |
target_arch: [i386, i686, x86_64, arm, aarch64, riscv64, riscv64-softfloat] | |
name: Build and upload libgcc for ${{matrix.target_arch}} | |
runs-on: ubuntu-latest | |
container: archlinux:latest | |
steps: | |
- name: Install dependencies | |
run: pacman --noconfirm -Syu && pacman --needed --noconfirm -S base-devel git autoconf automake wget | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Git config | |
run: git config --global --add safe.directory "$GITHUB_WORKSPACE" | |
- name: Extrapolate target triplet | |
run: | | |
set -ex | |
case "${{matrix.target_arch}}" in \ | |
arm) \ | |
echo "arm-none-eabi" >target-triplet ;; \ | |
riscv64-softfloat) \ | |
echo "riscv64-elf" >target-triplet ;; \ | |
*) \ | |
echo "${{matrix.target_arch}}-elf" >target-triplet ;; \ | |
esac | |
- name: Build the toolchain | |
run: | | |
CFLAGS_FOR_TARGET=""; \ | |
if [ "${{matrix.target_arch}}" = "riscv64-softfloat" ]; then \ | |
CFLAGS_FOR_TARGET="-march=rv64imac_zicsr_zifencei -mabi=lp64"; \ | |
fi; \ | |
case "${{matrix.target_arch}}" in \ | |
riscv64*) \ | |
CFLAGS_FOR_TARGET="$CFLAGS_FOR_TARGET -mno-relax";; \ | |
esac; \ | |
CFLAGS_FOR_TARGET="-O2 -pipe -fPIC -Wa,--noexecstack $CFLAGS_FOR_TARGET" TARGET="$(cat target-triplet)" GCCVERSION="$(cat gcc-version)" BINUTILSVERSION="$(cat binutils-version)" ./make_toolchain.sh | |
- name: Copy libgcc.a | |
run: cp toolchain/lib/gcc/$(cat target-triplet)/$(cat gcc-version)/libgcc.a ./libgcc-${{matrix.target_arch}}.a | |
- name: Copy extra libgcc.a's | |
run: | | |
set -ex | |
case "${{matrix.target_arch}}" in \ | |
x86_64) \ | |
cp toolchain/lib/gcc/$(cat target-triplet)/$(cat gcc-version)/no-red-zone/libgcc.a ./libgcc-x86_64-no-red-zone.a ;; \ | |
esac | |
- name: Remove target-triplet | |
run: rm target-triplet | |
- name: Push new binaries | |
run: | | |
set -ex | |
git config user.name 'mintsuki' | |
git config user.email 'mintsuki@users.noreply.github.com' | |
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/mintsuki/libgcc-binaries.git | |
while true; do \ | |
git pull --all; \ | |
git add .; \ | |
git commit -m "Upload binaries (${{matrix.target_arch}}) [ci skip]"; \ | |
if git push origin trunk; then \ | |
break; \ | |
else \ | |
git reset HEAD~1; \ | |
fi; \ | |
done |