From 12e91f45fe3c3cf84adea8e6036360415dc43d97 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Wed, 19 Aug 2020 00:08:17 +1000 Subject: [PATCH] CI: Add Linux AArch64 builds --- .github/workflows/rolling-release.yml | 28 +++++++++++++++++++--- CMakeModules/aarch64-cross-toolchain.cmake | 14 +++++++++++ README.md | 3 ++- 3 files changed, 41 insertions(+), 4 deletions(-) create mode 100644 CMakeModules/aarch64-cross-toolchain.cmake diff --git a/.github/workflows/rolling-release.yml b/.github/workflows/rolling-release.yml index 698d1bebd..46f815090 100644 --- a/.github/workflows/rolling-release.yml +++ b/.github/workflows/rolling-release.yml @@ -144,6 +144,12 @@ jobs: with: fetch-depth: 0 + - name: Install packages + shell: bash + run: | + sudo apt-get update + sudo apt-get -y install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu + - name: Compile and zip Linux x64 libretro core shell: bash run: | @@ -151,13 +157,28 @@ jobs: cd build-libretro-linux-x64 cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_LIBRETRO_CORE=ON .. cmake --build . --parallel 2 - zip -j duckstation_libretro.so.zip duckstation_libretro.so + zip -j duckstation_libretro_x64.so.zip duckstation_libretro.so - name: Upload Linux x64 libretro core uses: actions/upload-artifact@v1 with: name: "linux-libretro" - path: "build-libretro-linux-x64/duckstation_libretro.so.zip" + path: "build-libretro-linux-x64/duckstation_libretro_x64.so.zip" + + - name: Compile and zip Linux AArch64 libretro core + shell: bash + run: | + mkdir build-libretro-linux-aarch64 + cd build-libretro-linux-aarch64 + cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_LIBRETRO_CORE=ON -DCMAKE_TOOLCHAIN_FILE=../CMakeModules/aarch64-cross-toolchain.cmake .. + cmake --build . --parallel 2 + zip -j duckstation_libretro_linux_aarch64.so.zip duckstation_libretro.so + + - name: Upload Linux AArch64 libretro core + uses: actions/upload-artifact@v1 + with: + name: "linux-libretro" + path: "build-libretro-linux-aarch64/duckstation_libretro_linux_aarch64.so.zip" - name: Compile and zip Android AArch64 libretro core shell: bash @@ -271,7 +292,8 @@ jobs: linux-x64-appimage-sdl-zsync/duckstation-sdl-x64.AppImage.zsync linux-x64-appimage-qt/duckstation-qt-x64.AppImage linux-x64-appimage-qt-zsync/duckstation-qt-x64.AppImage.zsync - linux-libretro/duckstation_libretro.so.zip + linux-libretro/duckstation_libretro_x64.so.zip + linux-libretro/duckstation_libretro_linux_aarch64.so.zip linux-libretro/duckstation_libretro_android_aarch64.so.zip android/duckstation-android-aarch64.apk diff --git a/CMakeModules/aarch64-cross-toolchain.cmake b/CMakeModules/aarch64-cross-toolchain.cmake new file mode 100644 index 000000000..1391797b7 --- /dev/null +++ b/CMakeModules/aarch64-cross-toolchain.cmake @@ -0,0 +1,14 @@ +# Source: https://github.com/stenzek/duckstation/issues/626#issuecomment-660718306 + +# Target system +SET(CMAKE_SYSTEM_NAME Linux) +SET(CMAKE_SYSTEM_PROCESSOR aarch64) +SET(CMAKE_SYSTEM_VERSION 1) +set(CMAKE_CROSSCOMPILING TRUE) + +# Cross compiler +SET(CMAKE_C_COMPILER aarch64-linux-gnu-gcc) +SET(CMAKE_CXX_COMPILER aarch64-linux-gnu-g++) +set(CMAKE_LIBRARY_ARCHITECTURE aarch64-linux-gnu) + +set(THREADS_PTHREAD_ARG "0" CACHE STRING "Result from TRY_RUN" FORCE) diff --git a/README.md b/README.md index 99ecff446..f08e0028a 100644 --- a/README.md +++ b/README.md @@ -228,7 +228,8 @@ DuckStation is available as a libretro core, which can be loaded into a frontend Prebuilt binaries for 64-bit Windows, Linux and Android can be found on the releases page. Direct links: - 64-bit Windows: https://github.com/stenzek/duckstation/releases/download/latest/duckstation_libretro.dll.zip -- 64-bit Linux: https://github.com/stenzek/duckstation/releases/download/latest/duckstation_libretro.so.zip +- 64-bit Linux: https://github.com/stenzek/duckstation/releases/download/latest/duckstation_libretro_x64.so.zip +- AArch64 Linux: https://github.com/stenzek/duckstation/releases/download/latest/duckstation_libretro_aarch64.so.zip - AArch64 Android: https://github.com/stenzek/duckstation/releases/download/latest/duckstation_libretro_android_aarch64.so.zip To use, download and extract, and install the core file in RetroArch or your preferred frontend.