Skip to content

Commit

Permalink
Try new canadian-cross build approach
Browse files Browse the repository at this point in the history
  • Loading branch information
NoMore201 committed Oct 22, 2024
1 parent 31f470c commit 47806c1
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 43 deletions.
66 changes: 23 additions & 43 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ on:
- main

jobs:
linux-build:
name: Toolchain Linux build
build:
name: Toolchain build
runs-on: ubuntu-22.04

steps:
Expand All @@ -24,65 +24,45 @@ 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
uses: actions/upload-artifact@v4
with:
if-no-files-found: error
name: tricore-gcc-artifacts
path: /opt/win32.zip
path: /opt/gcc/*.zip
35 changes: 35 additions & 0 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -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 $@) && $</configure \
CFLAGS_FOR_TARGET='-g -gdwarf-3 -O2 -ffast-math -ffunction-sections -mfast-div -fno-common -mno-eabi-bitfield-limit' \
CPPFLAGS_FOR_TARGET='-g -gdwarf-3 -O2 -ffast-math -ffunction-sections -mfast-div -fno-common -mno-eabi-bitfield-limit' \
--target=tricore-elf \
--enable-lib32 \
--disable-lib64 \
--prefix=$(INSTALL_DIR) \
$(CONFIGURE_HOST) \
--enable-languages=c,c++ \
--enable-libstdcxx-debug-flags='-gdwarf-3 -g -O0 -D_GLIBCXX_ASSERTIONS' \
--enable-c99 \
--enable-long-long \
--enable-checking \
--enable-nls \
--enable-static \
--disable-threads \
--disable-shared \
--with-headers=yes \
--with-gnu-ld \
--with-gnu-as \
--with-newlib=yes \
--enable-mingw-wildcard \
--disable-libstdcxx-pch \
--enable-newlib-elix-level=3 \
--enable-newlib-io-long-long \
--disable-newlib-supplied-syscalls \
--disable-libssp \
--disable-test-suite
$(MAKE) -C $(notdir $@) all
$(MAKE) -C $(notdir $@) install
mkdir -p $(dir $@) && touch $@

0 comments on commit 47806c1

Please sign in to comment.