diff --git a/.github/workflows/avr-gcc-build-msys2-gcc.yml b/.github/workflows/avr-gcc-build-msys2-gcc.yml new file mode 100644 index 0000000..2ab192a --- /dev/null +++ b/.github/workflows/avr-gcc-build-msys2-gcc.yml @@ -0,0 +1,47 @@ +############################################################################## +# Copyright Christopher Kormanyos 2023. +# Distributed under The Unlicense. + +name: avr-gcc-build-msys2-gcc +on: + push: + branches: + - '**' + pull_request: +jobs: + avr-gcc-build-msys2: + runs-on: windows-latest + defaults: + run: + shell: msys2 {0} + strategy: + fail-fast: false + matrix: + gccversion: [ 12.3.0 ] + steps: + - uses: actions/checkout@v3 + - name: unpack-repo-nuwen-mingw-subset + shell: cmd + run: | + start /b /wait ./mingw.exe -y -gm2 -InstallPath="D:\\a\\avr-gcc-build\\avr-gcc-build\\mingw" + - uses: msys2/setup-msys2@v2 + with: + msystem: mingw64 + update: true + install: autoconf automake bzip2 cmake git make ninja patch python texinfo wget + - name: avr-gcc-100-12.3.0_x86_64-w64-mingw32 + shell: msys2 {0} + run: | + echo 'avr-gcc-100-12.3.0_x86_64-w64-mingw32.sh' + ./avr-gcc-100-12.3.0_x86_64-w64-mingw32.sh + - name: avr-gcc-partially-verify-result + shell: msys2 {0} + run: | + echo 'avr-gcc partial verify result' + ls -la /d/a/avr-gcc-build/avr-gcc-build/local/gcc-12.3.0-avr/bin + ls -la /d/a/avr-gcc-build/avr-gcc-build/local/gcc-12.3.0-avr/bin/avr-gcc.exe + ls -la /d/a/avr-gcc-build/avr-gcc-build/local/gcc-12.3.0-avr/bin/avr-g++.exe + - uses: actions/upload-artifact@v4 + with: + name: gcc-12.3.0-avr + path: d:/a/avr-gcc-build/avr-gcc-build/local/gcc-12.3.0-avr diff --git a/.github/workflows/avr-gcc-build.yml b/.github/workflows/avr-gcc-build.yml index 7a040cc..0166838 100644 --- a/.github/workflows/avr-gcc-build.yml +++ b/.github/workflows/avr-gcc-build.yml @@ -79,4 +79,9 @@ jobs: cd ${{ runner.workspace }}/avr-gcc-build/real-time-cpp/ref_app PATH=${{ runner.workspace }}/avr-gcc-build/local/gcc-${{ matrix.branchname }}-avr/bin:"$PATH" ./target/build/build.sh avr rebuild - ls -la bin/ref_app.elf bin/ref_app.hex bin/ref_app.map bin/ref_app.s19 bin/ref_app_cppfilt.txt bin/ref_app_nm.txt bin/ref_app_readelf.txt bin/ref_app_size.txt + ls -la bin/ref_app.elf bin/ref_app.hex + ls -la bin/ref_app.map bin/ref_app.s19 + ls -la bin/ref_app_cppfilt.txt + ls -la bin/ref_app_nm.txt + ls -la bin/ref_app_readelf.txt + ls -la bin/ref_app_size.txt diff --git a/README.md b/README.md index c69f176..4b6d18d 100644 --- a/README.md +++ b/README.md @@ -16,11 +16,10 @@ directly from the Workflow-Run(s) on GHA. Design goals: - Use shell and YAML scripts to build modern `avr-gcc` on-the-fly. - - Build `avr-gcc` from up-to-date branches such as `trunk` and `releases/gcc-13` found in [`gcc-mirror/gcc`](https://github.com/gcc-mirror/gcc). + - Build `avr-gcc` from up-to-date releases such as 12.3.0 or modern branches like `trunk` and `releases/gcc-13` found in [`gcc-mirror/gcc`](https://github.com/gcc-mirror/gcc). - Provide a non-trivial test of the newly-built toolchain(s) based on a real-world project. - Support cyclic monthly build of modern, evolving GCC branch(es) and trunk. - Publish the build artifacts directly from the Workflow-Run(s) on GHA. - - Provide a [shell script recipe](./avr-gcc-100-12.3.0_x86_64-w64-mingw32.sh) for local build of `avr-gcc` on `x86_64-w64-mingw32` host. This does not run on GHA at the moment, but can be executed locally. ## Workflow-Run @@ -41,10 +40,9 @@ is used for archiving build artifacts. ## Additional Details -This project is distributed under [The Unlicense](./UNLICENSE). - -Limitations: - - At the moment, the Workflow-Run builds `avr-gcc` for the _host_ `x86_64-linux-gnu` only. Cross-host compilation for `x86_64-w64-mingw32` does not work. - - A [shell script recipe](./avr-gcc-100-12.3.0_x86_64-w64-mingw32.sh) for local build of `avr-gcc` on `x86_64-w64-mingw32` host. It does not run on GHA at the moment, but can be executed locally. +Details: + - This project is distributed under [The Unlicense](./UNLICENSE). + - The Workflow-Run [avr-gcc-build.yml](./.github/workflows/avr-gcc-build.yml) and associated shell scripts (`avr-gcc-010*.sh`, `avr-gcc-020*.sh`, and `avr-gcc-030*.sh`) build `avr-gcc` for the _host_ `x86_64-linux-gnu`. These run on GHA using `ubuntu-latest` runners. + - The Workflow-Run [avr-gcc-build-msys2-gcc.yml](./.github/workflows/avr-gcc-build-msys2-gcc.yml) and shell script [avr-gcc-100-12.3.0_x86_64-w64-mingw32.sh](./avr-gcc-100-12.3.0_x86_64-w64-mingw32.sh) build `avr-gcc` for the _host_ `x86_64-w64-mingw32`. These run on GHA within `msys2` using `windows-latest` runners. This work has been inspired by a similar project: [`ZakKemble/avr-gcc-build`](https://github.com/ZakKemble/avr-gcc-build). diff --git a/_reference_avr-gcc-100-12.3.0_x86_64-w64-mingw32.sh b/_reference_avr-gcc-100-12.3.0_x86_64-w64-mingw32.sh new file mode 100644 index 0000000..b3b49bc --- /dev/null +++ b/_reference_avr-gcc-100-12.3.0_x86_64-w64-mingw32.sh @@ -0,0 +1,203 @@ +#!/usr/bin/env bash +# +# Copyright Christopher Kormanyos 2023. +# Distributed under The Unlicense. +# + +SCRIPT_PATH=$(readlink -f "$BASH_SOURCE") +SCRIPT_DIR=$(dirname "$SCRIPT_PATH") + + +# echo 'install necessary packages and build tools' +# pacman -S --needed --noconfirm wget git make cmake ninja patch texinfo bzip2 xz autoconf automake python + +# Get standalone msys2 from nuwen (contains standalone gcc-x86_64-w64-mingw32). +# The page describing this is: https://nuwen.net/mingw.html +# The exact download link is: https://nuwen.net/files/mingw/mingw-18.0.exe + +# For detailed background information, see also the detailed instructions +# at GitHub from Stephan T. Lavavej's repositiony. +# These can be found here: https://github.com/StephanTLavavej/mingw-distro + + +echo 'clean gcc_build directory' +rm -rf gcc_build | true + + +echo 'make and enter gcc_build directory' +mkdir -p $SCRIPT_DIR/gcc_build +echo + + +echo 'copy gcc 12.3.0 patch file' +cd $SCRIPT_DIR/gcc_build +cp ../avr-gcc-100-12.3.0_x86_64-w64-mingw32.patch . +echo + + +echo 'append standalone gcc-x86_64-w64-mingw32 path' +export X_DISTRO_ROOT=/c/mingw +export X_DISTRO_BIN=$X_DISTRO_ROOT/bin +export X_DISTRO_INC=$X_DISTRO_ROOT/include +export X_DISTRO_LIB=$X_DISTRO_ROOT/lib +export PATH=$PATH:$X_DISTRO_BIN +export C_INCLUDE_PATH=$X_DISTRO_INC +export CPLUS_INCLUDE_PATH=$X_DISTRO_INC +echo + + +echo 'query version pre-installed standalone gcc-x86_64-w64-mingw32' +g++ -v +echo + + +cd $SCRIPT_DIR/gcc_build +echo 'get tar-balls' +wget --no-check-certificate https://github.com/facebook/zstd/releases/download/v1.5.5/zstd-1.5.5.tar.gz +wget --no-check-certificate https://ftp.gnu.org/gnu/libiconv/libiconv-1.17.tar.gz +wget --no-check-certificate https://ftp.gnu.org/gnu/gmp/gmp-6.3.0.tar.xz +wget --no-check-certificate https://ftp.gnu.org/gnu/mpfr/mpfr-4.2.1.tar.xz +wget --no-check-certificate https://ftp.gnu.org/gnu/mpc/mpc-1.3.1.tar.gz +wget --no-check-certificate https://gcc.gnu.org/pub/gcc/infrastructure/isl-0.15.tar.bz2 +wget --no-check-certificate https://gcc.gnu.org/pub/gcc/infrastructure/cloog-0.18.1.tar.gz +wget --no-check-certificate https://ftp.gnu.org/gnu/binutils/binutils-2.41.tar.xz +wget --no-check-certificate https://ftp.gnu.org/gnu/gcc/gcc-12.3.0/gcc-12.3.0.tar.xz +echo + + +cd $SCRIPT_DIR/gcc_build +echo 'build zstd' +tar -xf zstd-1.5.5.tar.gz +mkdir objdir-zstd-1.5.5 +cd objdir-zstd-1.5.5 +cmake "-DCMAKE_BUILD_TYPE=Release" "-DCMAKE_C_FLAGS=-s -O3" "-DCMAKE_INSTALL_PREFIX=/usr/local/zstd-1.5.5" "-DZSTD_BUILD_SHARED=OFF" -G Ninja $SCRIPT_DIR/gcc_build/zstd-1.5.5/build/cmake +ninja +ninja install +echo + + +cd $SCRIPT_DIR/gcc_build +echo 'build libiconv' +tar -xf libiconv-1.17.tar.gz +mkdir objdir-libiconv-1.17 +cd objdir-libiconv-1.17 +../libiconv-1.17/configure --prefix=/usr/local/libiconv-1.17 --build=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --enable-static --disable-shared +make --jobs=6 +make install +echo + + +cd $SCRIPT_DIR/gcc_build +echo 'build gmp' +tar -xf gmp-6.3.0.tar.xz +mkdir objdir-gmp-6.3.0 +cd objdir-gmp-6.3.0 +../gmp-6.3.0/configure --prefix=/usr/local/gmp-6.3.0 --build=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --enable-static --disable-shared +make --jobs=6 +make install +echo + + +cd $SCRIPT_DIR/gcc_build +echo 'build mpfr' +tar -xf mpfr-4.2.1.tar.xz +mkdir objdir-mpfr-4.2.1 +cd objdir-mpfr-4.2.1 +../mpfr-4.2.1/configure --prefix=/usr/local/mpfr-4.2.1 --build=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --enable-static --disable-shared --with-gmp=/usr/local/gmp-6.3.0 +make --jobs=6 +make install +echo + + +cd $SCRIPT_DIR/gcc_build +echo 'build mpc' +tar -xf mpc-1.3.1.tar.gz +mkdir objdir-mpc-1.3.1 +cd objdir-mpc-1.3.1 +../mpc-1.3.1/configure --prefix=/usr/local/mpc-1.3.1 --build=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --enable-static --disable-shared --with-gmp=/usr/local/gmp-6.3.0 --with-mpfr=/usr/local/mpfr-4.2.1 +make --jobs=6 +make install +echo + + +cd $SCRIPT_DIR/gcc_build +echo 'build isl' +tar -xjf isl-0.15.tar.bz2 +mkdir objdir-isl-0.15 +cd objdir-isl-0.15 +../isl-0.15/configure --prefix=/usr/local/isl-0.15 --build=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --enable-static --disable-shared --with-gmp-prefix=/usr/local/gmp-6.3.0 +make --jobs=6 +make install +echo + + +cd $SCRIPT_DIR/gcc_build +echo 'build cloog' +tar -xf cloog-0.18.1.tar.gz +mkdir objdir-cloog-0.18.1 +cd objdir-cloog-0.18.1 +../cloog-0.18.1/configure --prefix=/usr/local/cloog-0.18.1 --build=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --enable-static --disable-shared --with-isl=/usr/local/isl-0.15 --with-gmp=/usr/local/gmp-6.3.0 +make --jobs=6 +make install +echo + + +cd $SCRIPT_DIR/gcc_build +echo 'build binutils' +tar -xf binutils-2.41.tar.xz +mkdir objdir-binutils-2.41-avr-gcc-12.3.0 +cd objdir-binutils-2.41-avr-gcc-12.3.0 +../binutils-2.41/configure --prefix=/usr/local/gcc-12.3.0-avr --target=avr --enable-languages=c,c++ --build=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --with-pkgversion='Built by ckormanyos/real-time-cpp' --enable-static --disable-shared --disable-libada --disable-libssp --disable-nls --enable-mingw-wildcard --with-gnu-as --with-dwarf2 --with-isl=/usr/local/isl-0.15 --with-cloog=/usr/local/cloog-0.18.1 --with-gmp=/usr/local/gmp-6.3.0 --with-mpfr=/usr/local/mpfr-4.2.1 --with-mpc=/usr/local/mpc-1.3.1 --with-libiconv-prefix=/usr/local/libiconv-1.17 --with-zstd=/usr/local/zstd-1.5.5/lib --disable-werror +make --jobs=6 +make install +echo + + +# +# Notes on patch of GCC-12.3.0 +# + +# How do you make the patch? +# diff -ru gcc-12.3.0/ gcc-12.3.0_new/ > avr-gcc-100-12.3.0_x86_64-w64-mingw32.patch + +# How do you apply the patch? +# patch -p0 < avr-gcc-100-12.3.0_x86_64-w64-mingw32.patch + + +cd $SCRIPT_DIR/gcc_build +echo 'build gcc' +tar -xf gcc-12.3.0.tar.xz +patch -p0 < avr-gcc-100-12.3.0_x86_64-w64-mingw32.patch +mkdir objdir-gcc-12.3.0-avr +cd objdir-gcc-12.3.0-avr +../gcc-12.3.0/configure --prefix=/usr/local/gcc-12.3.0-avr --target=avr --enable-languages=c,c++ --build=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --with-pkgversion='Built by ckormanyos/real-time-cpp' --enable-static --disable-shared --disable-libada --disable-libssp --disable-nls --enable-mingw-wildcard --with-gnu-as --with-dwarf2 --with-isl=/usr/local/isl-0.15 --with-cloog=/usr/local/cloog-0.18.1 --with-gmp=/usr/local/gmp-6.3.0 --with-mpfr=/usr/local/mpfr-4.2.1 --with-mpc=/usr/local/mpc-1.3.1 --with-libiconv-prefix=/usr/local/libiconv-1.17 --with-zstd=/usr/local/zstd-1.5.5/lib +make --jobs=6 +make install +echo + + +cd $SCRIPT_DIR/gcc_build +echo 'clone and bootstrap avr-libc' +git clone -b main --depth 1 https://github.com/avrdudes/avr-libc.git ./avr-libc +rm -f avr-libc/tests/simulate/time/aux.c +cd avr-libc +./bootstrap +echo + + +cd $SCRIPT_DIR/gcc_build +echo 'add avr-gcc path' +PATH=/usr/local/gcc-12.3.0-avr/bin:"$PATH" +export PATH +CC="" +export CC +echo + + +cd $SCRIPT_DIR/gcc_build +echo 'build avr-libc' +cd objdir-gcc-12.3.0-avr +../avr-libc/configure --prefix=/usr/local/gcc-12.3.0-avr --build=x86_64-w64-mingw32 --host=avr --enable-static --disable-shared +make --jobs=6 +make install +echo diff --git a/avr-gcc-100-12.3.0_x86_64-w64-mingw32.sh b/avr-gcc-100-12.3.0_x86_64-w64-mingw32.sh index f43754c..bbb2bc2 100755 --- a/avr-gcc-100-12.3.0_x86_64-w64-mingw32.sh +++ b/avr-gcc-100-12.3.0_x86_64-w64-mingw32.sh @@ -9,7 +9,15 @@ SCRIPT_DIR=$(dirname "$SCRIPT_PATH") # echo 'install necessary packages and build tools' -# pacman -S --needed --noconfirm wget make patch git mingw-w64-ucrt-x86_64-gcc texinfo bzip2 xz autoconf automake python unzip +# pacman -S --needed --noconfirm wget git make cmake ninja patch texinfo bzip2 xz autoconf automake python + +# Get standalone msys2 from nuwen (contains standalone gcc-x86_64-w64-mingw32). +# The page describing this is: https://nuwen.net/mingw.html +# The exact download link is: https://nuwen.net/files/mingw/mingw-18.0.exe + +# For detailed background information, see also the detailed instructions +# at GitHub from Stephan T. Lavavej's repositiony. +# These can be found here: https://github.com/StephanTLavavej/mingw-distro echo 'clean gcc_build directory' @@ -17,15 +25,35 @@ rm -rf gcc_build | true echo 'make and enter gcc_build directory' -mkdir $SCRIPT_DIR/gcc_build +mkdir -p $SCRIPT_DIR/gcc_build +echo +echo 'copy gcc 12.3.0 patch file' cd $SCRIPT_DIR/gcc_build cp ../avr-gcc-100-12.3.0_x86_64-w64-mingw32.patch . +echo + + +echo 'append standalone gcc-x86_64-w64-mingw32 path' +export X_DISTRO_ROOT=$SCRIPT_DIR/mingw +export X_DISTRO_BIN=$X_DISTRO_ROOT/bin +export X_DISTRO_INC=$X_DISTRO_ROOT/include +export X_DISTRO_LIB=$X_DISTRO_ROOT/lib +export PATH=$PATH:$X_DISTRO_BIN +export C_INCLUDE_PATH=$X_DISTRO_INC +export CPLUS_INCLUDE_PATH=$X_DISTRO_INC +echo + + +echo 'query version pre-installed standalone gcc-x86_64-w64-mingw32' +g++ -v +echo cd $SCRIPT_DIR/gcc_build echo 'get tar-balls' +wget --no-check-certificate https://github.com/facebook/zstd/releases/download/v1.5.5/zstd-1.5.5.tar.gz wget --no-check-certificate https://ftp.gnu.org/gnu/libiconv/libiconv-1.17.tar.gz wget --no-check-certificate https://ftp.gnu.org/gnu/gmp/gmp-6.3.0.tar.xz wget --no-check-certificate https://ftp.gnu.org/gnu/mpfr/mpfr-4.2.1.tar.xz @@ -34,6 +62,18 @@ wget --no-check-certificate https://gcc.gnu.org/pub/gcc/infrastructure/isl-0.15. wget --no-check-certificate https://gcc.gnu.org/pub/gcc/infrastructure/cloog-0.18.1.tar.gz wget --no-check-certificate https://ftp.gnu.org/gnu/binutils/binutils-2.41.tar.xz wget --no-check-certificate https://ftp.gnu.org/gnu/gcc/gcc-12.3.0/gcc-12.3.0.tar.xz +echo + + +cd $SCRIPT_DIR/gcc_build +echo 'build zstd' +tar -xf zstd-1.5.5.tar.gz +mkdir objdir-zstd-1.5.5 +cd objdir-zstd-1.5.5 +cmake "-DCMAKE_BUILD_TYPE=Release" "-DCMAKE_C_FLAGS=-s -O3" "-DCMAKE_INSTALL_PREFIX=$SCRIPT_DIR/local/zstd-1.5.5" "-DZSTD_BUILD_SHARED=OFF" -G Ninja $SCRIPT_DIR/gcc_build/zstd-1.5.5/build/cmake +ninja +ninja install +echo cd $SCRIPT_DIR/gcc_build @@ -41,9 +81,10 @@ echo 'build libiconv' tar -xf libiconv-1.17.tar.gz mkdir objdir-libiconv-1.17 cd objdir-libiconv-1.17 -../libiconv-1.17/configure --prefix=/usr/local/libiconv-1.17 --build=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --enable-static --disable-shared -make --job=6 +../libiconv-1.17/configure --prefix=$SCRIPT_DIR/local/libiconv-1.17 --build=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --enable-static --disable-shared +make --jobs=6 make install +echo cd $SCRIPT_DIR/gcc_build @@ -51,9 +92,10 @@ echo 'build gmp' tar -xf gmp-6.3.0.tar.xz mkdir objdir-gmp-6.3.0 cd objdir-gmp-6.3.0 -../gmp-6.3.0/configure --prefix=/usr/local/gmp-6.3.0 --build=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --enable-static --disable-shared +../gmp-6.3.0/configure --prefix=$SCRIPT_DIR/local/gmp-6.3.0 --build=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --enable-static --disable-shared make --jobs=6 make install +echo cd $SCRIPT_DIR/gcc_build @@ -61,9 +103,10 @@ echo 'build mpfr' tar -xf mpfr-4.2.1.tar.xz mkdir objdir-mpfr-4.2.1 cd objdir-mpfr-4.2.1 -../mpfr-4.2.1/configure --prefix=/usr/local/mpfr-4.2.1 --build=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --enable-static --disable-shared --with-gmp=/usr/local/gmp-6.3.0 +../mpfr-4.2.1/configure --prefix=$SCRIPT_DIR/local/mpfr-4.2.1 --build=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --enable-static --disable-shared --with-gmp=$SCRIPT_DIR/local/gmp-6.3.0 make --jobs=6 make install +echo cd $SCRIPT_DIR/gcc_build @@ -71,9 +114,10 @@ echo 'build mpc' tar -xf mpc-1.3.1.tar.gz mkdir objdir-mpc-1.3.1 cd objdir-mpc-1.3.1 -../mpc-1.3.1/configure --prefix=/usr/local/mpc-1.3.1 --build=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --enable-static --disable-shared --with-gmp=/usr/local/gmp-6.3.0 --with-mpfr=/usr/local/mpfr-4.2.1 +../mpc-1.3.1/configure --prefix=$SCRIPT_DIR/local/mpc-1.3.1 --build=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --enable-static --disable-shared --with-gmp=$SCRIPT_DIR/local/gmp-6.3.0 --with-mpfr=$SCRIPT_DIR/local/mpfr-4.2.1 make --jobs=6 make install +echo cd $SCRIPT_DIR/gcc_build @@ -81,9 +125,10 @@ echo 'build isl' tar -xjf isl-0.15.tar.bz2 mkdir objdir-isl-0.15 cd objdir-isl-0.15 -../isl-0.15/configure --prefix=/usr/local/isl-0.15 --build=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --enable-static --disable-shared --with-gmp=/usr/local/gmp-6.3.0 +../isl-0.15/configure --prefix=$SCRIPT_DIR/local/isl-0.15 --build=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --enable-static --disable-shared --with-gmp-prefix=$SCRIPT_DIR/local/gmp-6.3.0 make --jobs=6 make install +echo cd $SCRIPT_DIR/gcc_build @@ -91,9 +136,10 @@ echo 'build cloog' tar -xf cloog-0.18.1.tar.gz mkdir objdir-cloog-0.18.1 cd objdir-cloog-0.18.1 -../cloog-0.18.1/configure --prefix=/usr/local/cloog-0.18.1 --build=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --enable-static --disable-shared --with-isl=/usr/local/isl-0.15 --with-gmp=/usr/local/gmp-6.3.0 +../cloog-0.18.1/configure --prefix=$SCRIPT_DIR/local/cloog-0.18.1 --build=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --enable-static --disable-shared --with-isl=$SCRIPT_DIR/local/isl-0.15 --with-gmp-prefix=$SCRIPT_DIR/local/gmp-6.3.0 make --jobs=6 make install +echo cd $SCRIPT_DIR/gcc_build @@ -101,9 +147,19 @@ echo 'build binutils' tar -xf binutils-2.41.tar.xz mkdir objdir-binutils-2.41-avr-gcc-12.3.0 cd objdir-binutils-2.41-avr-gcc-12.3.0 -../binutils-2.41/configure --prefix=/usr/local/gcc-12.3.0-avr --target=avr --enable-languages=c,c++ --build=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --with-pkgversion='Built by ckormanyos/real-time-cpp' --enable-static --disable-shared --disable-libada --disable-libssp --disable-nls --enable-mingw-wildcard --with-gnu-as --with-dwarf2 --with-isl=/usr/local/isl-0.15 --with-cloog=/usr/local/cloog-0.18.1 --with-gmp=/usr/local/gmp-6.3.0 --with-mpfr=/usr/local/mpfr-4.2.1 --with-mpc=/usr/local/mpc-1.3.1 --with-libiconv-prefix=/usr/local/libiconv-1.17 --disable-werror -make --jobs=6 +../binutils-2.41/configure --prefix=$SCRIPT_DIR/local/gcc-12.3.0-avr --target=avr --enable-languages=c,c++ --build=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --with-pkgversion='Built by ckormanyos/real-time-cpp' --enable-static --disable-shared --disable-libada --disable-libssp --disable-nls --enable-mingw-wildcard --with-gnu-as --with-dwarf2 --with-isl=$SCRIPT_DIR/local/isl-0.15 --with-cloog=$SCRIPT_DIR/local/cloog-0.18.1 --with-gmp=$SCRIPT_DIR/local/gmp-6.3.0 --with-mpfr=$SCRIPT_DIR/local/mpfr-4.2.1 --with-mpc=$SCRIPT_DIR/local/mpc-1.3.1 --with-libiconv-prefix=$SCRIPT_DIR/local/libiconv-1.17 --with-zstd=$SCRIPT_DIR/local/zstd-1.5.5/lib --disable-werror +make --jobs=8 make install +echo + + +ls -la $SCRIPT_DIR/local/gcc-12.3.0-avr/bin +ls -la $SCRIPT_DIR/local/gcc-12.3.0-avr/bin/avr-ld.exe +result_binutils=$? + + +echo "result_binutils: " "result_binutils" +echo # @@ -123,9 +179,10 @@ tar -xf gcc-12.3.0.tar.xz patch -p0 < avr-gcc-100-12.3.0_x86_64-w64-mingw32.patch mkdir objdir-gcc-12.3.0-avr cd objdir-gcc-12.3.0-avr -../gcc-12.3.0/configure --prefix=/usr/local/gcc-12.3.0-avr --target=avr --enable-languages=c,c++ --build=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --with-pkgversion='Built by ckormanyos/real-time-cpp' --enable-static --disable-shared --disable-libada --disable-libssp --disable-nls --enable-mingw-wildcard --with-gnu-as --with-dwarf2 --with-isl=/usr/local/isl-0.15 --with-cloog=/usr/local/cloog-0.18.1 --with-gmp=/usr/local/gmp-6.3.0 --with-mpfr=/usr/local/mpfr-4.2.1 --with-mpc=/usr/local/mpc-1.3.1 --with-libiconv-prefix=/usr/local/libiconv-1.17 -make --jobs=6 +../gcc-12.3.0/configure --prefix=$SCRIPT_DIR/local/gcc-12.3.0-avr --target=avr --enable-languages=c,c++ --build=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --with-pkgversion='Built by ckormanyos/real-time-cpp' --enable-static --disable-shared --disable-libada --disable-libssp --disable-nls --enable-mingw-wildcard --with-gnu-as --with-dwarf2 --with-isl=$SCRIPT_DIR/local/isl-0.15 --with-cloog=$SCRIPT_DIR/local/cloog-0.18.1 --with-gmp=$SCRIPT_DIR/local/gmp-6.3.0 --with-mpfr=$SCRIPT_DIR/local/mpfr-4.2.1 --with-mpc=$SCRIPT_DIR/local/mpc-1.3.1 --with-libiconv-prefix=$SCRIPT_DIR/local/libiconv-1.17 --with-zstd=$SCRIPT_DIR/local/zstd-1.5.5/lib +make --jobs=8 make install +echo cd $SCRIPT_DIR/gcc_build @@ -134,19 +191,41 @@ git clone -b main --depth 1 https://github.com/avrdudes/avr-libc.git ./avr-libc rm -f avr-libc/tests/simulate/time/aux.c cd avr-libc ./bootstrap +echo cd $SCRIPT_DIR/gcc_build echo 'add avr-gcc path' -PATH=/usr/local/gcc-12.3.0-avr/bin:"$PATH" +PATH=$SCRIPT_DIR/local/gcc-12.3.0-avr/bin:"$PATH" export PATH CC="" export CC +echo cd $SCRIPT_DIR/gcc_build echo 'build avr-libc' cd objdir-gcc-12.3.0-avr -../avr-libc/configure --prefix=/usr/local/gcc-12.3.0-avr --build=x86_64-w64-mingw32 --host=avr --enable-static --disable-shared -make --jobs=6 +../avr-libc/configure --prefix=$SCRIPT_DIR/local/gcc-12.3.0-avr --build=x86_64-w64-mingw32 --host=avr --enable-static --disable-shared +make --jobs=8 make install +echo + + +ls -la $SCRIPT_DIR/local/gcc-12.3.0-avr/bin +ls -la $SCRIPT_DIR/local/gcc-12.3.0-avr/bin/avr-g++.exe +result_gcc=$? + + +echo "result_gcc: " "result_gcc" +echo + + +result_total=$((result_binutils+result_gcc)) + + +echo "result_total: " "$result_total" +echo + + +exit $result_total diff --git a/mingw.exe b/mingw.exe new file mode 100644 index 0000000..8693aa1 Binary files /dev/null and b/mingw.exe differ