From 47806c11f7dd7852b07c7b7877011c5912f95fb7 Mon Sep 17 00:00:00 2001 From: Domenico Iezzi Date: Tue, 22 Oct 2024 13:44:36 +0200 Subject: [PATCH] Try new canadian-cross build approach --- .github/workflows/build.yml | 66 +++++++++++++------------------------ Makefile.in | 35 ++++++++++++++++++++ 2 files changed, 58 insertions(+), 43 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 25a9bde..68f4aac 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,8 +10,8 @@ on: - main jobs: - linux-build: - name: Toolchain Linux build + build: + name: Toolchain build runs-on: ubuntu-22.04 steps: @@ -24,60 +24,40 @@ jobs: run: | sudo apt-get update sudo apt-get -y install build-essential build-essential texinfo \ - flex bison libmpfr-dev libgmp-dev libmpc-dev zip libdebuginfod-dev + flex bison libmpfr-dev libgmp-dev libmpc-dev zip libdebuginfod-dev \ + gcc-mingw-w64 g++-mingw-w64 - - name: Build + - name: Build Linux run: | - mkdir build - cd build + mkdir build-linux + cd build-linux export CFLAGS="-O2" export CXXFLAGS="-O2" export LDFLAGS="-static -s" - ../configure --prefix /opt/gcc + ../configure --prefix /opt/gcc/linux make -j$(nproc) - - name: Package + - name: Build Win32 run: | - cd /opt/gcc - zip -r9 ../linux.zip . - - - name: Upload artifacts - uses: actions/upload-artifact@v4 - with: - if-no-files-found: error - name: tricore-gcc-artifacts - path: /opt/linux.zip - - win32-build: - name: Toolchain Windows build - runs-on: ubuntu-22.04 - - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - submodules: recursive - - - name: Install dependencies - run: | - sudo apt-get update - sudo apt-get -y install build-essential build-essential texinfo \ - flex bison libmpfr-dev libgmp-dev libmpc-dev zip libdebuginfod-dev \ - gcc-mingw-w64 g++-mingw-w64 - - - name: Build - run: | - mkdir build - cd build + cd build-linux/build-newlib + make install prefix=/opt/gcc/win32 + cd ../.. + mkdir build-win32 + cd build-win32 export CFLAGS="-O2" export CXXFLAGS="-O2" export LDFLAGS="-static -s" - ../configure --prefix /opt/gcc --with-host=x86_64-w64-mingw32 - make -j$(nproc) + ../configure --prefix /opt/gcc/win32 --with-host=x86_64-w64-mingw32 + make -j$(nproc) stamps/build-binutils-tc + export PATH="/opt/gcc/linux/bin:$PATH" + echo $PATH + make -j$(nproc) stamps/build-gcc-stage2-only - name: Package run: | - cd /opt/gcc + cd /opt/gcc/linux + zip -r9 ../linux.zip . + cd /opt/gcc/win32 zip -r9 ../win32.zip . - name: Upload artifacts @@ -85,4 +65,4 @@ jobs: with: if-no-files-found: error name: tricore-gcc-artifacts - path: /opt/win32.zip \ No newline at end of file + path: /opt/gcc/*.zip diff --git a/Makefile.in b/Makefile.in index eda360f..5760d2a 100644 --- a/Makefile.in +++ b/Makefile.in @@ -186,3 +186,38 @@ stamps/build-gcc-stage2: $(GCC_SRCDIR) stamps/install-deps stamps/build-newlib $(MAKE) -C $(notdir $@) all $(MAKE) -C $(notdir $@) install mkdir -p $(dir $@) && touch $@ + +stamps/build-gcc-stage2-only: $(GCC_SRCDIR) stamps/install-deps + rm -rf $@ $(notdir $@) + mkdir $(notdir $@) + cd $(notdir $@) && $