From 2fe5dbafa1cd103935f6ce155efece394ddb8edb Mon Sep 17 00:00:00 2001 From: Ethan Roseman Date: Mon, 23 Aug 2021 04:44:42 +0900 Subject: [PATCH] Mips target (#15) * mips target * re-add section attribute support * revert target for test * test * test2 * test * refactor build script * macro * here goes nothin * here goes nothin again * here goes nothin again twice * abandon all hope, ye who enter here * gcc will rue the day --- .github/workflows/build.yml | 54 ++++++++++++++++++++++--------------- config/mips/mips.h | 5 ++++ 2 files changed, 37 insertions(+), 22 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8d780d2..d56c63f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,13 +13,13 @@ jobs: OS: 'ubuntu-latest', CFLAGS: '-std=gnu89 -m32 -static', HOST: 'i386-pc-linux', - ARCHIVE_NAME: 'linux.tar.gz' + ARCHIVE_NAME: 'linux.tar' } - { OS: 'macos-latest', CFLAGS: '-std=gnu89 -Wno-return-type -Wno-error -Wno-implicit-function-declaration', HOST: 'i386-apple-darwin', - ARCHIVE_NAME: 'mac.tar.gz' + ARCHIVE_NAME: 'mac.tar' } name: Building cc1 for ${{ matrix.TARGET.OS }} @@ -37,42 +37,52 @@ jobs: sudo apt update sudo apt install -y gcc-6 gcc-6-multilib sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 1 - - name: Configure + - name: Configure for mips-nintendo-nu64 shell: bash run: | ./configure --target=mips-nintendo-nu64 --prefix=/opt/cross --with-gnu-as --disable-gprof --disable-gdb --disable-werror --host=${{ matrix.TARGET.HOST }} --build=${{ matrix.TARGET.HOST }} - - name: Make + - name: Make everything except cpp continue-on-error: true shell: bash run: | - make cpp CFLAGS="${{ matrix.TARGET.CFLAGS }}" - make cc1 CFLAGS="${{ matrix.TARGET.CFLAGS }}" - make xgcc CFLAGS="${{ matrix.TARGET.CFLAGS }}" - make cc1plus CFLAGS="${{ matrix.TARGET.CFLAGS }}" - make g++ CFLAGS="${{ matrix.TARGET.CFLAGS }}" + make cpp cc1 xgcc cc1plus g++ CFLAGS="${{ matrix.TARGET.CFLAGS }}" - name: Test for file shell: bash run: | test -f cc1 file cc1 - - name: Upload output - uses: actions/upload-artifact@v2 - with: - name: cc1-${{ matrix.TARGET.OS }} - path: | - cpp - cc1 - xgcc - cc1plus - g++ - - name: Create release archive + - name: Start release archive shell: bash run: | cp xgcc gcc - tar -czf ${{ matrix.TARGET.ARCHIVE_NAME }} cpp cc1 gcc cc1plus g++ + tar -cf ${{ matrix.TARGET.ARCHIVE_NAME }} cc1 gcc cc1plus g++ + - name: Clean + shell: bash + run: | + make clean + - name: Configure for mips + shell: bash + run: | + ./configure --target=mips --prefix=/opt/cross --with-gnu-as --disable-gprof --disable-gdb --disable-werror --host=${{ matrix.TARGET.HOST }} --build=${{ matrix.TARGET.HOST }} + - name: Make cpp + continue-on-error: true + shell: bash + run: | + make cpp CFLAGS="${{ matrix.TARGET.CFLAGS }}" + - name: Add cpp to release archive + shell: bash + run: | + tar -uf ${{ matrix.TARGET.ARCHIVE_NAME }} cpp + gzip -9 ${{ matrix.TARGET.ARCHIVE_NAME }} + - name: Upload archive + uses: actions/upload-artifact@v2 + with: + name: gcc-2.7.1-${{ matrix.TARGET.OS }} + path: | + ${{ matrix.TARGET.ARCHIVE_NAME }}.gz - name: Update release uses: johnwbyrd/update-release@v1.0.0 if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} with: token: ${{ secrets.GITHUB_TOKEN }} - files: ${{ matrix.TARGET.ARCHIVE_NAME }} + files: ${{ matrix.TARGET.ARCHIVE_NAME }}.gz diff --git a/config/mips/mips.h b/config/mips/mips.h index e1def4f..c1120a3 100644 --- a/config/mips/mips.h +++ b/config/mips/mips.h @@ -4074,3 +4074,8 @@ while (0) true. */ #define DONT_ACCESS_GBLS_AFTER_EPILOGUE (TARGET_ABICALLS && mips_abi != ABI_32) + +#define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME, RELOC)\ + do { \ + fprintf (FILE, "\t.section %s\n", NAME); \ + } while (0) \ No newline at end of file