:: commit a716e43efae14d0a355413042d1f470447df70bc

mintsuki <mintsuki@protonmail.com> — 2024-08-20 19:42

parents: ce8f0b4c4d

workflows/check: Use Linux kernel GCC crosstools to build Limine with GCC

diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml
index f2dc0880..2f342678 100644
--- a/.github/workflows/check.yml
+++ b/.github/workflows/check.yml
@@ -10,7 +10,7 @@ jobs:
 
     steps:
       - name: Install dependencies
-        run: pacman --noconfirm -Syu && pacman --needed --noconfirm -S base-devel git autoconf automake nasm curl mtools llvm clang lld aarch64-linux-gnu-gcc riscv64-linux-gnu-gcc
+        run: pacman --noconfirm -Syu && pacman --needed --noconfirm -S base-devel git autoconf automake nasm curl mtools llvm clang lld
 
       - name: Checkout code
         uses: actions/checkout@v4
@@ -21,11 +21,25 @@ jobs:
       - name: Build the bootloader (LLVM)
         run: ./bootstrap && ./configure TOOLCHAIN_FOR_TARGET=llvm --enable-werror --enable-all && make all && make maintainer-clean
 
+      - name: Set cross GCC version
+        run: echo "GCC_VERSION=14.2.0" >> $GITHUB_ENV
+
+      - name: Download GCC cross toolchains
+        run: |
+          set -e
+          for i in aarch64 loongarch64 riscv64 x86_64; do
+            curl -Lo x86_64-gcc-${{ env.GCC_VERSION }}-nolibc-$i-linux.tar.gz https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/x86_64/${{ env.GCC_VERSION }}/x86_64-gcc-${{ env.GCC_VERSION }}-nolibc-$i-linux.tar.gz
+            tar -xf x86_64-gcc-${{ env.GCC_VERSION }}-nolibc-$i-linux.tar.gz
+          done
+
       - name: Build the bootloader (GNU, x86)
-        run: ./bootstrap && ./configure TOOLCHAIN_FOR_TARGET=gnu --enable-werror --enable-bios --enable-uefi-ia32 --enable-uefi-x86-64 && make all && make maintainer-clean
+        run: export PATH="$(pwd -P)"/gcc-${{ env.GCC_VERSION }}-nolibc/x86_64-linux/bin:"$PATH" && ./bootstrap && ./configure TOOLCHAIN_FOR_TARGET=x86_64-linux --enable-werror --enable-bios --enable-uefi-ia32 --enable-uefi-x86-64 && make all && make maintainer-clean
 
       - name: Build the bootloader (GNU, aarch64)
-        run: ./bootstrap && ./configure TOOLCHAIN_FOR_TARGET=aarch64-linux-gnu --enable-werror --enable-uefi-aarch64 && make all && make maintainer-clean
+        run: export PATH="$(pwd -P)"/gcc-${{ env.GCC_VERSION }}-nolibc/aarch64-linux/bin:"$PATH" && ./bootstrap && ./configure TOOLCHAIN_FOR_TARGET=aarch64-linux --enable-werror --enable-uefi-aarch64 && make all && make maintainer-clean
 
       - name: Build the bootloader (GNU, riscv64)
-        run: ./bootstrap && ./configure TOOLCHAIN_FOR_TARGET=riscv64-linux-gnu --enable-werror --enable-uefi-riscv64 && make all && make maintainer-clean
+        run: export PATH="$(pwd -P)"/gcc-${{ env.GCC_VERSION }}-nolibc/riscv64-linux/bin:"$PATH" && ./bootstrap && ./configure TOOLCHAIN_FOR_TARGET=riscv64-linux --enable-werror --enable-uefi-riscv64 && make all && make maintainer-clean
+
+      - name: Build the bootloader (GNU, loongarch64)
+        run: export PATH="$(pwd -P)"/gcc-${{ env.GCC_VERSION }}-nolibc/loongarch64-linux/bin:"$PATH" && ./bootstrap && ./configure TOOLCHAIN_FOR_TARGET=loongarch64-linux --enable-werror --enable-uefi-loongarch64 && make all && make maintainer-clean
tab: 248 wrap: offon