Skip to content

Commit

Permalink
Build QEMU separately on Ubuntu 24.04
Browse files Browse the repository at this point in the history
  • Loading branch information
NoMore201 committed Dec 10, 2024
1 parent 179c921 commit 61a24b1
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 9 deletions.
55 changes: 49 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ on:
- main

jobs:
build:
name: Toolchain build
build-gcc:
name: GCC toolchain build
runs-on: ubuntu-22.04

steps:
Expand All @@ -21,7 +21,7 @@ jobs:

- name: Install dependencies
run: |
sudo ./scripts/install-deps
sudo ./scripts/install-gcc-deps
- name: Build Linux
run: |
Expand All @@ -31,7 +31,7 @@ jobs:
export CXXFLAGS="-O2"
export LDFLAGS="-static -s"
../configure --prefix /opt/gcc/linux
make -j$(nproc)
make -j$(nproc) stamps/build-gcc-stage2
- name: Build Win32
run: |
Expand All @@ -51,9 +51,52 @@ jobs:
- name: Package
run: |
cd /opt/gcc/linux
zip -r9 ../linux.zip .
zip -r9 ../gcc-linux.zip .
cd /opt/gcc/win32
zip -r9 ../win32.zip .
zip -r9 ../gcc-win32.zip .
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
if-no-files-found: error
name: tricore-gcc-artifacts
path: /opt/gcc/*.zip

build-qemu:
name: QEMU build
runs-on: ubuntu-24.04

steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive

- name: Install dependencies
run: |
sudo ./scripts/install-qemu-deps
- name: Build Linux
run: |
mkdir build-linux
cd build-linux
../configure --prefix /opt/gcc/linux
make -j$(nproc) stamps/build-qemu
- name: Build Win32
run: |
mkdir build-win32
cd build-win32
../configure --prefix /opt/gcc/win32 --with-host=x86_64-w64-mingw32
make -j$(nproc) stamps/build-qemu
- name: Package
run: |
cd /opt/gcc/linux
zip -r9 ../qemu-linux.zip .
cd /opt/gcc/win32
mv qemu-system-tricore.exe bin/
zip -r9 ../qemu-win32.zip bin share
- name: Upload artifacts
uses: actions/upload-artifact@v4
Expand Down
4 changes: 1 addition & 3 deletions scripts/install-deps → scripts/install-gcc-deps
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,4 @@ apt-get update
DEBIAN_FRONTEND=noninteractive apt-get -y install \
build-essential texinfo \
flex bison libmpfr-dev libgmp-dev libmpc-dev zip libdebuginfod-dev \
gcc-mingw-w64 g++-mingw-w64 mingw-w64-tools \
git libglib2.0-dev libfdt-dev libpixman-1-dev zlib1g-dev ninja-build \
python3-dev python3-pip curl
gcc-mingw-w64 g++-mingw-w64 mingw-w64-tools
23 changes: 23 additions & 0 deletions scripts/install-qemu-deps
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/sh

set -e

if [ ! -f /etc/lsb_release ] && [ ! -f /etc/debian_version ]
then
echo "Script is meant to install packages on Debian/Ubuntu based distributions"
echo "Please install dependencies manually on other distributions"
exit 1
fi

apt-get update
DEBIAN_FRONTEND=noninteractive apt-get -y install \
build-essential \
gcc-mingw-w64 g++-mingw-w64 mingw-w64-tools \
git libglib2.0-dev libfdt-dev libpixman-1-dev zlib1g-dev ninja-build \
python3-pip curl

# Make sure MingGW compiler uses Posix threads
update-alternatives --set x86_64-w64-mingw32-gcc /usr/bin/x86_64-w64-mingw32-gcc-posix
update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix

pip3 install --break-system-packages meson==1.4.0

0 comments on commit 61a24b1

Please sign in to comment.