Skip to content

rename to macos

rename to macos #33

Workflow file for this run

name: Build
on: [push, pull_request]
jobs:
build:
runs-on: ${{ matrix.TARGET.OS }}
strategy:
fail-fast: false
matrix:
TARGET:
- {
OS: 'ubuntu-20.04',
CFLAGS: '-static -fno-stack-protector -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0',
HOST: 'i386-pc-linux',
ARCHIVE_NAME: 'mips-binutils-egcs-2.9.5-linux.tar.gz',
HOST_GCC: 'gcc'
}
- {
OS: 'macos-13',
CFLAGS: '-DDARWIN -Wno-implicit-int -Wno-return-type -Wno-error -Wno-implicit-function-declaration -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0',
HOST: 'i386-apple-darwin',
ARCHIVE_NAME: 'mips-binutils-egcs-2.9.5-macos.tar.gz',
HOST_GCC: 'gcc-13'
}
name: Building binutils for ${{ matrix.TARGET.OS }}
steps:
- uses: actions/checkout@v4
- name: Install dependencies (Ubuntu)
shell: bash
if: matrix.TARGET.OS == 'ubuntu-20.04'
run: |
sudo apt-get update
sudo apt-get install -y build-essential bison file gperf flex
- name: Configure for mips
shell: bash
run: |
CC="${{ matrix.TARGET.HOST_GCC }}" CFLAGS="-Wno-implicit-int" ./configure --target=mips-linux --prefix=/opt/cross --disable-gprof --disable-gdb --disable-werror --host=${{ matrix.TARGET.HOST }} --build=${{ matrix.TARGET.HOST }}
- name: Make
shell: bash
run: |
make -C bfd CFLAGS="${{ matrix.TARGET.CFLAGS }}"
make -C opcodes CFLAGS="${{ matrix.TARGET.CFLAGS }}"
make -C libiberty CFLAGS="${{ matrix.TARGET.CFLAGS }}"
make -C intl CFLAGS="${{ matrix.TARGET.CFLAGS }}"
make -C gas CFLAGS="${{ matrix.TARGET.CFLAGS }}"
make -C binutils CFLAGS="${{ matrix.TARGET.CFLAGS }}"
make -C ld CFLAGS="${{ matrix.TARGET.CFLAGS }}"
- name: Test for file
shell: bash
run: |
test -f binutils/ar
file binutils/ar
- name: Create release archive
shell: bash
run: |
mkdir -p release
cp binutils/ar release/ar
cp binutils/addr2line release/addr2line
cp binutils/cxxfilt release/cxxfilt
cp binutils/nm-new release/nm
cp binutils/objcopy release/objcopy
cp binutils/objdump release/objdump
cp binutils/ranlib release/ranlib
cp binutils/readelf release/readelf
cp binutils/strings release/strings
cp binutils/strip-new release/strip
cp gas/as-new release/as
cp ld/ld-new release/ld
strip release/*
chmod +x release/*
cd release && tar -czf ../${{ matrix.TARGET.ARCHIVE_NAME }} *
- name: Upload archive
uses: actions/upload-artifact@v3
with:
name: mips-binutils-egcs-2.9.5-${{ matrix.TARGET.OS }}
path: |
${{ matrix.TARGET.ARCHIVE_NAME }}
- name: Publish release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: ${{ matrix.TARGET.ARCHIVE_NAME }}